# HG changeset patch # User Jeff Hammel # Date 1273194063 25200 # Node ID 81500171fda8a62708cb416932b227a1af077abb # Parent 76fc1a23182c888fce1f62688cbbd11aec6a7ff0 change output format diff -r 76fc1a23182c -r 81500171fda8 profilemanager/command.py --- 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 diff -r 76fc1a23182c -r 81500171fda8 profilemanager/manager.py --- a/profilemanager/manager.py Thu May 06 17:52:06 2010 -0700 +++ b/profilemanager/manager.py Thu May 06 18:01:03 2010 -0700 @@ -91,13 +91,9 @@ - directories : display the directories """ profiles = self.profiles_dict() - retval = [] - for name in sorted(profiles.keys()): - values = [name] - if directories: - values.append(self.path(name)) - retval.append(values) - return format_tabular(retval) # XXX: TBD upstream + if not directories: + return sorted(profiles.keys()) + return dict([(name, self.path(name)) for name in profiles.keys()]) def clone(self, source, dest, hash=True): """