Skip to content

Commit

Permalink
Improved printing of raw parameters in devtools.out
Browse files Browse the repository at this point in the history
  • Loading branch information
jacob414 committed Mar 4, 2021
1 parent 253945e commit 6ac6ea6
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion kingston/devtool.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,14 @@ def loud(self):
self.say = print

def __call__(self, formatted, **kwargs):
self.say(self.spaces + textwrap.dedent(formatted.format(**kwargs)))
try:
dedented = textwrap.dedent(formatted)
except TypeError:
dedented = pprint.pformat(formatted)
try:
self.say(self.spaces + dedented.format(**kwargs))
except AttributeError:
self.say(self.spaces + dedented)


out = PrintfDebugging()
Expand Down

0 comments on commit 6ac6ea6

Please sign in to comment.