src/mercurialserver/config.py
changeset 303 3f9f247b72bd
parent 242 03d8f07230b3
child 374 7a1d6b228af6
--- a/src/mercurialserver/config.py	Mon Apr 18 12:49:02 2011 +0100
+++ b/src/mercurialserver/config.py	Mon Apr 18 13:26:05 2011 +0100
@@ -20,7 +20,7 @@
 def _getPath(name):
     return os.path.expanduser(_getConf().get("paths", name))
 
-def _getPaths(name): 
+def _getPaths(name):
     return [os.path.expanduser(p)
         for p in _getConf().get("paths", name).split(":")]
 
@@ -40,6 +40,17 @@
 
 def getEnv(): return _getConf().items("env")
 
+def _getdefault(section, option, default, f = lambda x: x):
+    conf = _getConf()
+    if conf.has_option(section, option):
+        return f(conf.get(section, option))
+    else:
+        return default
+
+def getAllowedDots():
+    return _getdefault("exceptions", "allowdots", [],
+        lambda s: s.split(":"))
+
 # Work out where we are, don't use config.
 def initExe():
     global _exePath
@@ -49,4 +60,3 @@
 
 def getExePath():
     return _exePath
-