diff options
author | Olivier Blin <oblin@mandriva.com> | 2006-10-18 14:50:44 +0000 |
---|---|---|
committer | Olivier Blin <oblin@mandriva.com> | 2006-10-18 14:50:44 +0000 |
commit | 28577e8c743a934806ebf8725fb9166eb0a7ec72 (patch) | |
tree | a7de4ddcc547a4972b50e1247c368e7cd3e0135c /RepSys/cgiutil.py | |
parent | 99a0f968aa6f0b0f5d21bf649c91d40067530b63 (diff) | |
download | mgarepo-28577e8c743a934806ebf8725fb9166eb0a7ec72.tar mgarepo-28577e8c743a934806ebf8725fb9166eb0a7ec72.tar.gz mgarepo-28577e8c743a934806ebf8725fb9166eb0a7ec72.tar.bz2 mgarepo-28577e8c743a934806ebf8725fb9166eb0a7ec72.tar.xz mgarepo-28577e8c743a934806ebf8725fb9166eb0a7ec72.zip |
use a different "submit <target>" section per target in configuration file
Diffstat (limited to 'RepSys/cgiutil.py')
-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 |