diff options
author | Olivier Blin <oblin@mandriva.com> | 2006-10-18 14:51:09 +0000 |
---|---|---|
committer | Olivier Blin <oblin@mandriva.com> | 2006-10-18 14:51:09 +0000 |
commit | 40bd5fadb90f1e23f48704baf7906744f66ccc5a (patch) | |
tree | 425d6da6c966355f619fe950162b25ed1c3d735e | |
parent | 0e21c25bc766d7635a1d901d228bd239b9ba304a (diff) | |
download | mgarepo-40bd5fadb90f1e23f48704baf7906744f66ccc5a.tar mgarepo-40bd5fadb90f1e23f48704baf7906744f66ccc5a.tar.gz mgarepo-40bd5fadb90f1e23f48704baf7906744f66ccc5a.tar.bz2 mgarepo-40bd5fadb90f1e23f48704baf7906744f66ccc5a.tar.xz mgarepo-40bd5fadb90f1e23f48704baf7906744f66ccc5a.zip |
use a different "submit <target>" section per target in configuration file
-rw-r--r-- | RepSys/cgiutil.py | 33 |
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 |