Mercurial > hg
changeset 2499:894435215344
Added ui.configlist method to get comma/space separated lists of strings.
For example:
users = alice, bob
colors = red green blue
author | Thomas Arendsen Hein <thomas@intevation.de> |
---|---|
date | Mon, 26 Jun 2006 14:52:26 +0200 |
parents | 1e2ec4fd16df |
children | 76ff5efe8181 |
files | mercurial/ui.py |
diffstat | 1 files changed, 9 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- 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)]