From 3d01fb88897c50233360c1b8c78eb37db9d50a60 Mon Sep 17 00:00:00 2001 From: Guilherme Chapiewski Date: Tue, 6 Oct 2009 16:05:05 -0300 Subject: [PATCH] #58: Added config file dir to path to make it possible to import things from the project (in the settings file, if the user wants to). --- src/config.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/config.py b/src/config.py index 552ea2b..7b485ad 100644 --- a/src/config.py +++ b/src/config.py @@ -40,6 +40,9 @@ class SettingsFile(object): def import_file(full_filename): path, filename = os.path.split(full_filename) + # add settings dir from path + sys.path.insert(0, path) + # read config file try: execfile(full_filename) @@ -48,6 +51,9 @@ def import_file(full_filename): except Exception, e: raise Exception("error interpreting config file '%s': %s" % (filename, str(e))) + # remove settings dir from path + sys.path.remove(path) + return locals() def __init__(self, config_file="simple-db-migrate.conf"):