Merge branch 'master' into develop
This commit is contained in:
commit
6ac027beac
2 changed files with 18 additions and 14 deletions
|
|
@ -421,17 +421,19 @@ class DefaultAccount(with_metaclass(TypeclassBase, AccountDB)):
|
||||||
|
|
||||||
kwargs["options"] = options
|
kwargs["options"] = options
|
||||||
|
|
||||||
if not (isinstance(text, basestring) or isinstance(text, tuple)):
|
if text is not None:
|
||||||
# sanitize text before sending across the wire
|
if not (isinstance(text, basestring) or isinstance(text, tuple)):
|
||||||
try:
|
# sanitize text before sending across the wire
|
||||||
text = to_str(text, force_string=True)
|
try:
|
||||||
except Exception:
|
text = to_str(text, force_string=True)
|
||||||
text = repr(text)
|
except Exception:
|
||||||
|
text = repr(text)
|
||||||
|
kwargs['text'] = text
|
||||||
|
|
||||||
# session relay
|
# session relay
|
||||||
sessions = make_iter(session) if session else self.sessions.all()
|
sessions = make_iter(session) if session else self.sessions.all()
|
||||||
for session in sessions:
|
for session in sessions:
|
||||||
session.data_out(text=text, **kwargs)
|
session.data_out(**kwargs)
|
||||||
|
|
||||||
def execute_cmd(self, raw_string, session=None, **kwargs):
|
def execute_cmd(self, raw_string, session=None, **kwargs):
|
||||||
"""
|
"""
|
||||||
|
|
|
||||||
|
|
@ -569,17 +569,19 @@ class DefaultObject(with_metaclass(TypeclassBase, ObjectDB)):
|
||||||
except Exception:
|
except Exception:
|
||||||
logger.log_trace()
|
logger.log_trace()
|
||||||
|
|
||||||
if not (isinstance(text, basestring) or isinstance(text, tuple)):
|
if text is not None:
|
||||||
# sanitize text before sending across the wire
|
if not (isinstance(text, basestring) or isinstance(text, tuple)):
|
||||||
try:
|
# sanitize text before sending across the wire
|
||||||
text = to_str(text, force_string=True)
|
try:
|
||||||
except Exception:
|
text = to_str(text, force_string=True)
|
||||||
text = repr(text)
|
except Exception:
|
||||||
|
text = repr(text)
|
||||||
|
kwargs['text'] = text
|
||||||
|
|
||||||
# relay to session(s)
|
# relay to session(s)
|
||||||
sessions = make_iter(session) if session else self.sessions.all()
|
sessions = make_iter(session) if session else self.sessions.all()
|
||||||
for session in sessions:
|
for session in sessions:
|
||||||
session.data_out(text=text, **kwargs)
|
session.data_out(**kwargs)
|
||||||
|
|
||||||
|
|
||||||
def for_contents(self, func, exclude=None, **kwargs):
|
def for_contents(self, func, exclude=None, **kwargs):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue