data.py
changeset 2 e66102ab7048
parent 1 2223ade4f259
--- a/data.py	Thu Apr 02 20:19:18 2009 +0300
+++ b/data.py	Thu Apr 02 20:54:37 2009 +0300
@@ -4,20 +4,13 @@
 
 import imp
 
-def load_py (path) :
+def load_py (name, path) :
     """
-        Load a python file from the given filesystem path, returning the module itself
+        Load a python file from the given filesystem path, returning the module itself.
+
+        The "name" of the module must be given, it should be something sane and unique...
     """
 
-    # XXX: what name to use?
-    name = "hosts"
+    # just load it and return
+    return imp.load_source(name, path)
     
-    # find the module
-    file, pathname, info = imp.find_module(name, [path])
-
-    # load it
-    module = imp.load_module(name, file, pathname, info)
-
-    # ok
-    return module
-