Skip to content
Snippets Groups Projects
Commit 59da9e49 authored by Hendrik Buschmeier's avatar Hendrik Buschmeier
Browse files

Fixed a JSON-related printing bug in the sniffer.

parent d475a45f
No related branches found
No related tags found
No related merge requests found
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
# "Incremental Processing Architecture # "Incremental Processing Architecture
# for Artificial Conversational Agents". # for Artificial Conversational Agents".
# #
# Copyright (c) 2009-2013 Sociable Agents Group # Copyright (c) 2009-2014 Social Cognitive Systems Group
# CITEC, Bielefeld University # CITEC, Bielefeld University
# #
# http://opensource.cit-ec.de/projects/ipaaca/ # http://opensource.cit-ec.de/projects/ipaaca/
...@@ -52,6 +52,7 @@ def highlight_if_color(s, c='1'): ...@@ -52,6 +52,7 @@ def highlight_if_color(s, c='1'):
def pretty_printed_iu_payload(iu): def pretty_printed_iu_payload(iu):
s='{ ' s='{ '
for k,v in iu.payload.items(): for k,v in iu.payload.items():
v = str(v)
v2 = (('\''+v+'\'') if len(v)<=max_size else ('\''+v[:max_size]+'\'<excess length omitted>')).replace('\\','\\\\').replace('\n',highlight_if_color('\\n')) v2 = (('\''+v+'\'') if len(v)<=max_size else ('\''+v[:max_size]+'\'<excess length omitted>')).replace('\\','\\\\').replace('\n',highlight_if_color('\\n'))
s += '\n' + '\t\t\'' + highlight_if_color(unicode(k),'1')+'\': '+unicode(v2)+', ' s += '\n' + '\t\t\'' + highlight_if_color(unicode(k),'1')+'\': '+unicode(v2)+', '
s+=' }' s+=' }'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment