# HG changeset patch # User Jeff Hammel # Date 1304457995 25200 # Node ID 47d9472e77549f8d6e39e2e217efb6f01154286e # Parent 6fa6d987b3af7ad69825b844b47010ac3583cf20 add path of file directory when loading files diff -r 6fa6d987b3af -r 47d9472e7754 pyloader/__init__.py --- a/pyloader/__init__.py Tue May 03 08:06:48 2011 -0700 +++ b/pyloader/__init__.py Tue May 03 14:26:35 2011 -0700 @@ -6,6 +6,7 @@ import imp import os +import sys def import_dotted_path(module): path = module.split('.') @@ -22,7 +23,9 @@ path, target = string.split(':', 1) if os.path.isabs(path) and os.path.exists(path): # path to file + sys.path.append(os.path.dirname(path)) module = imp.load_source(path, path) + sys.path.pop() else: module = import_dotted_path(path) obj = module diff -r 6fa6d987b3af -r 47d9472e7754 setup.py --- a/setup.py Tue May 03 08:06:48 2011 -0700 +++ b/setup.py Tue May 03 14:26:35 2011 -0700 @@ -7,7 +7,7 @@ except IOError: description = '' -version = "0.1" +version = "0.1.1" dependencies = [] setup(name='pyloader',