2015-05-31 21:20:09 +02:00
|
|
|
import yaml
|
2015-08-04 04:27:19 +02:00
|
|
|
import sys
|
2015-05-31 21:20:09 +02:00
|
|
|
|
2015-08-04 04:27:19 +02:00
|
|
|
global confname
|
|
|
|
try:
|
|
|
|
# Get the config name from the command line, falling back to config.yml
|
|
|
|
# if not given.
|
|
|
|
fname = sys.argv[1]
|
|
|
|
confname = fname.split('.', 1)[0]
|
|
|
|
except IndexError:
|
|
|
|
# confname is used for logging and PID writing, so that each
|
|
|
|
# instance uses its own files. fname is the actual name of the file
|
|
|
|
# we load.
|
|
|
|
confname = 'pylink'
|
|
|
|
fname = 'config.yml'
|
|
|
|
|
|
|
|
with open(fname, 'r') as f:
|
2015-05-31 21:20:09 +02:00
|
|
|
global conf
|
|
|
|
conf = yaml.load(f)
|