Jan Borsodi committed 8b675e5

Extensions can now be import as modules from a custom folder. The folder is set in the Python import path.

  • Participants
  • Parent commits c85a371

Comments (0)

Files changed (2)

   separately from the main config file, e.g. to avoid committing personal
+* Extension paths can now point to a directory. The directory will be added to
+  the Python import path and the module will be imported.
+  e.g.::
+    myproject.extension = path/to/myextension
 hob module

File hob/

             path = path.strip()
             g = {}
             l = {}
+            # A directory indicates that a python module should be imported
+            # and not a script
+            if path and os.path.isdir(path):
+                path = os.path.abspath(path)
+                sys.path.append(path)
+                path = None
             if path:
                     execfile(path, g, l)