Skip to content

Commit

Permalink
#58: Added config file dir to path to make it possible to import thin…
Browse files Browse the repository at this point in the history
…gs from the project (in the settings file, if the user wants to).
  • Loading branch information
guilhermechapiewski committed Oct 6, 2009
1 parent e86b1bc commit 3d01fb8
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/config.py
Expand Up @@ -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)
Expand All @@ -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"):
Expand Down

0 comments on commit 3d01fb8

Please sign in to comment.