aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.com>2006-10-18 14:51:53 +0000
committerOlivier Blin <oblin@mandriva.com>2006-10-18 14:51:53 +0000
commitacabf3f5e1f0e0107c3caba55fa822f49ee79bf1 (patch)
treea0e9e7430e66ef5c35e7fca5e156073d21429f01
parentfd7f921881519dc24105989edf4fb7b029563f56 (diff)
downloadmgarepo-acabf3f5e1f0e0107c3caba55fa822f49ee79bf1.tar
mgarepo-acabf3f5e1f0e0107c3caba55fa822f49ee79bf1.tar.gz
mgarepo-acabf3f5e1f0e0107c3caba55fa822f49ee79bf1.tar.bz2
mgarepo-acabf3f5e1f0e0107c3caba55fa822f49ee79bf1.tar.xz
mgarepo-acabf3f5e1f0e0107c3caba55fa822f49ee79bf1.zip
use a different "submit <target>" section per target in configuration file
-rw-r--r--RepSys/cgiutil.py33
1 files changed, 16 insertions, 17 deletions
diff --git a/RepSys/cgiutil.py b/RepSys/cgiutil.py
index ebb65c9..6dda91e 100644
--- a/RepSys/cgiutil.py
+++ b/RepSys/cgiutil.py
@@ -2,6 +2,7 @@
from RepSys import Error, config
from RepSys.svn import SVN
import time
+import re
class CgiError(Error): pass
@@ -19,24 +20,22 @@ def get_targets():
if not TARGETS:
target = SubmitTarget()
targetoptions = {}
- for option, value in config.walk("submit"):
- if targetoptions.has_key(option):
- TARGETS.append(target)
+ submit_re = re.compile("^submit\s+(.+)$")
+ for section in config.sections():
+ m = submit_re.match(section)
+ if m:
target = SubmitTarget()
- targetoptions = {}
- targetoptions[option] = 1
- if option == "name":
- target.name = value
- elif option == "target":
- target.target = value.split()
- elif option == "allowed":
- target.allowed = value.split()
- elif option == "scripts":
- target.scripts = value.split()
- else:
- raise Error, "unknown [submit] option %s" % option
- if targetoptions:
- TARGETS.append(target)
+ target.name = m.group(1)
+ for option, value in config.walk(section):
+ if option == "target":
+ target.target = value.split()
+ elif option == "allowed":
+ target.allowed = value.split()
+ elif option == "scripts":
+ target.scripts = value.split()
+ else:
+ raise Error, "unknown [%s] option %s" % (section, option)
+ TARGETS.append(target)
return TARGETS
# vim:et:ts=4:sw=4