diff options
author | Joshua Ismael Haase Hernández <hahj87@gmail.com> | 2011-04-11 01:09:25 -0500 |
---|---|---|
committer | Joshua Ismael Haase Hernández <hahj87@gmail.com> | 2011-04-11 01:09:25 -0500 |
commit | 3fb5f8efef231dd7784be880934cd106603ab6f1 (patch) | |
tree | b3f62a0fb712de3f0c5fea92f7171d6fbf3cd2b2 /config.py | |
parent | 61ee5da8b31b44e80e008619a32ca886d8799646 (diff) |
bash-port ready for testing.
Diffstat (limited to 'config.py')
-rw-r--r-- | config.py | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -1,4 +1,4 @@ -#!/usr/bin/pythonn +#!/usr/bin/python # -*- coding: utf-8 -*- try: from subprocess import check_output @@ -7,22 +7,24 @@ except(ImportError): import os stringvars=("mirror", "mirrorpath", "logname", "tempdir", "docs_dir", - "repodir", "rsync_blacklist") + "repodir", "rsync_blacklist") listvars=("repo_list", "dir_list", "arch_list", "other",) boolvars=("output", "debug",) config=dict() -def exit_if_none: +def exit_if_none(var): if os.environ.get(var) is None: exit("%s is not defined" % var) for var in stringvars: exit_if_none(var) - config[var]=os.environ.get(var) + config[var]=os.environ.get(var) + for var in listvars: exit_if_none(var) config[var]=tuple(os.environ.get(var).split(":")) + for var in boolvars: exit_if_none(var) if os.environ.get(var) == "True": |