changeset 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 2f58555b3b28
children 1cd3e3c71bff
files profilemanager/command.py profilemanager/manager.py
diffstat 2 files changed, 11 insertions(+), 3 deletions(-) [+]
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)
 
--- 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