From dce768017afe0b53667ad783cc85a26691db1ec3 Mon Sep 17 00:00:00 2001 From: James Lu Date: Tue, 21 Jun 2016 11:31:39 -0700 Subject: [PATCH] [WIP] conf: re-add 'fname' variable (used by REHASH) --- conf.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/conf.py b/conf.py index b85bbe3..1a2ee5a 100644 --- a/conf.py +++ b/conf.py @@ -31,16 +31,17 @@ def validateConf(conf): return conf -def loadConf(fname, errors_fatal=True): +def loadConf(filename, errors_fatal=True): """Loads a PyLink configuration file from the filename given.""" - global confname, conf - confname = fname.split('.', 1)[0] - with open(fname, 'r') as f: + global confname, conf, fname + fname = filename + confname = filename.split('.', 1)[0] + with open(filename, 'r') as f: try: conf = yaml.load(f) conf = validateConf(conf) except Exception as e: - print('ERROR: Failed to load config from %r: %s: %s' % (fname, type(e).__name__, e)) + print('ERROR: Failed to load config from %r: %s: %s' % (filename, type(e).__name__, e)) if errors_fatal: sys.exit(4) raise