Merged in jmchilton/galaxy-central-configuration-directory (pull request #44)

This commit is contained in:
Nate Coraor
2012-08-15 10:57:14 -04:00
2 changed files with 30 additions and 0 deletions
+4
View File
@@ -36,6 +36,10 @@ for sample in $SAMPLES; do
fi
done
if [ -n "$GALAXY_UNIVERSE_CONFIG_DIR" ]; then
python ./scripts/build_universe_config.py "$GALAXY_UNIVERSE_CONFIG_DIR"
fi
# explicitly attempt to fetch eggs before running
FETCH_EGGS=1
for arg in "$@"; do
+26
View File
@@ -0,0 +1,26 @@
from ConfigParser import ConfigParser
from os import listdir
from os.path import join
from re import match
from sys import argv
def merge():
"Merges all .ini files in a specified directory into ./universe.ini"
if len(argv) < 2:
message = "%s: Must specify directory to merge configuration files from." % argv[0]
raise Exception(message)
conf_directory = argv[1]
conf_files = [f for f in listdir(conf_directory) if match(r'.*\.ini', f)]
conf_files.sort()
parser = ConfigParser()
for conf_file in conf_files:
parser.read([join(conf_directory, conf_file)])
## TODO: Expand enviroment variables here, that would
## also make Galaxy much easier to configure.
parser.write(open("universe_wsgi.ini", 'w'))
if __name__ == '__main__':
merge()