Mercurial > mozilla > hg > ProfileManager
diff 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 |
line wrap: on
line diff
--- a/profilemanager/command.py Fri May 07 12:16:05 2010 -0700 +++ b/profilemanager/command.py Fri May 07 12:23:49 2010 -0700 @@ -172,8 +172,16 @@ for key in sorted(retval.keys()): print '%s: %s' % (key, retval[key]) elif hasattr(retval, '__iter__'): - for val in retval: - print val + + # hack since python doesn't have ordered dicts + if not [ val for val in retval + if not(isinstance(val, tuple) and len(val) == 2) ]: + for val in retval: + print '%s: %s' % (val[0], val[1]) + + else: + for val in retval: + print val else: pprint(retval)