summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
f88d985)
Raising Exception is considered bad since the only way to catch
it is to do 'except Exception'. Raising a TypeError is more
appropriate.
Since the format parameter has already been validated, checking
it again is not necessary. Simplify this conditional.
Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
set_end = "]"
set_sep = ", "
else:
set_end = "]"
set_sep = ", "
else:
+ raise TypeError("format must be either 'text' or 'json'")
if (match or entire_thread):
if format.lower() == "text":
sys.stdout.write(msg.format_message_as_text(indent))
if (match or entire_thread):
if format.lower() == "text":
sys.stdout.write(msg.format_message_as_text(indent))
- elif format.lower() == "json":
- sys.stdout.write(msg.format_message_as_json(indent))
+ sys.stdout.write(msg.format_message_as_json(indent))
next_indent = indent + 1
# get replies and print them also out (if there are any)
next_indent = indent + 1
# get replies and print them also out (if there are any)