Added ui.configlist method to get comma/space separated lists of strings.
authorThomas Arendsen Hein <thomas@intevation.de>
Mon, 26 Jun 2006 14:52:26 +0200
changeset 2499 894435215344
parent 2498 1e2ec4fd16df
child 2500 76ff5efe8181
Added ui.configlist method to get comma/space separated lists of strings. For example: users = alice, bob colors = red green blue
mercurial/ui.py
--- a/mercurial/ui.py	Mon Jun 26 14:49:18 2006 +0200
+++ b/mercurial/ui.py	Mon Jun 26 14:52:26 2006 +0200
@@ -95,6 +95,15 @@
         else:
             return self.parentui.config(section, name, default)
 
+    def configlist(self, section, name, default=None):
+        """Return a list of comma/space separated strings"""
+        result = self.config(section, name)
+        if result is None:
+            return []
+        else:
+            return result.replace(",", " ").split()
+
+
     def configbool(self, section, name, default=False):
         if self.overlay.has_key((section, name)):
             return self.overlay[(section, name)]