diff profilemanager/command.py @ 38:81500171fda8

change output format
author Jeff Hammel <jhammel@mozilla.com>
date Thu, 06 May 2010 18:01:03 -0700
parents ca57920aa223
children 3b53d584195f
line wrap: on
line diff
--- a/profilemanager/command.py	Thu May 06 17:52:06 2010 -0700
+++ b/profilemanager/command.py	Thu May 06 18:01:03 2010 -0700
@@ -162,9 +162,19 @@
 
         # invoke the command
         retval = getattr(_object, name)(*command_args, **command_options.__dict__)
+
+        # print the output
         if isinstance(retval, basestring):
             print retval
+        elif isinstance(retval, dict):
+            for key in sorted(retval.keys()):
+                print '%s: %s' % (key, retval[key])
+        elif hasattr(retval, '__iter__'):
+            for val in retval:
+                print val
         else:
             pprint(retval)
+
+        # return the value
         return retval