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 @@
# "Incremental Processing Architecture
# for Artificial Conversational Agents".
#
# Copyright (c) 2009-2013 Sociable Agents Group
# Copyright (c) 2009-2014 Social Cognitive Systems Group
# CITEC, Bielefeld University
#
# http://opensource.cit-ec.de/projects/ipaaca/
......@@ -52,6 +52,7 @@ def highlight_if_color(s, c='1'):
def pretty_printed_iu_payload(iu):
s='{ '
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'))
s += '\n' + '\t\t\'' + highlight_if_color(unicode(k),'1')+'\': '+unicode(v2)+', '
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