+ return '\n'.join(urls) if urls else ""
+
+
+class ListsFormatter(object):
+ def __call__(self, list):
+ if list['description']:
+ list_str = "%-30s (%s)" % (list['name'], list['description'])
+ else:
+ list_str = "%-30s" % (list['name'])
+ return "%s\n" % list_str
+
+class ListsVerboseFormatter(object):
+ def __call__(self, list):
+ list_str = "%-30s\n description: %s\n members: %s\n mode:%s\n" % (list['name'], list['description'], list['member_count'], list['mode'])
+ return list_str
+
+class AnsiListsFormatter(object):
+ def __init__(self):
+ self._colourMap = ansi.ColourMap()
+
+ def __call__(self, list):
+ colour = self._colourMap.colourFor(list['name'])
+ return ("%s%-15s%s %s" %(
+ ansi.cmdColour(colour), list['name'],
+ ansi.cmdReset(), list['description']))
+