# HG changeset patch # User Jeff Hammel # Date 1273260229 25200 # Node ID 18f16bd1ba6bf5e7fd1fd484ce80e9e92b84cf4e # Parent 2f58555b3b28b14f90694d29bf6d21982473f78a finish backups listing function and formatting for it diff -r 2f58555b3b28 -r 18f16bd1ba6b profilemanager/command.py --- 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) diff -r 2f58555b3b28 -r 18f16bd1ba6b profilemanager/manager.py --- a/profilemanager/manager.py Fri May 07 12:16:05 2010 -0700 +++ b/profilemanager/manager.py Fri May 07 12:23:49 2010 -0700 @@ -175,7 +175,7 @@ profiles_dict = self.profiles_dict() for profile in profiles_dict: if 'Backups' in profiles_dict[profile]: - retval[profile] = profiles_dict[profile].split(':') + retval[profile] = self.backups(profile, datestamp) return retval # single profile