data.py
changeset 1 2223ade4f259
child 2 e66102ab7048
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/data.py	Thu Apr 02 20:19:18 2009 +0300
@@ -0,0 +1,23 @@
+"""
+    Functions to load data from various sources
+"""
+
+import imp
+
+def load_py (path) :
+    """
+        Load a python file from the given filesystem path, returning the module itself
+    """
+
+    # XXX: what name to use?
+    name = "hosts"
+    
+    # find the module
+    file, pathname, info = imp.find_module(name, [path])
+
+    # load it
+    module = imp.load_module(name, file, pathname, info)
+
+    # ok
+    return module
+