comparison profilemanager/command.py @ 64:18f16bd1ba6b

finish backups listing function and formatting for it
author Jeff Hammel <jhammel@mozilla.com>
date Fri, 07 May 2010 12:23:49 -0700
parents 3b53d584195f
children 145e111903d2
comparison
equal deleted inserted replaced
63:2f58555b3b28 64:18f16bd1ba6b
170 print retval 170 print retval
171 elif isinstance(retval, dict): 171 elif isinstance(retval, dict):
172 for key in sorted(retval.keys()): 172 for key in sorted(retval.keys()):
173 print '%s: %s' % (key, retval[key]) 173 print '%s: %s' % (key, retval[key])
174 elif hasattr(retval, '__iter__'): 174 elif hasattr(retval, '__iter__'):
175 for val in retval: 175
176 print val 176 # hack since python doesn't have ordered dicts
177 if not [ val for val in retval
178 if not(isinstance(val, tuple) and len(val) == 2) ]:
179 for val in retval:
180 print '%s: %s' % (val[0], val[1])
181
182 else:
183 for val in retval:
184 print val
177 else: 185 else:
178 pprint(retval) 186 pprint(retval)
179 187
180 # return the value 188 # return the value
181 return retval 189 return retval