[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [33597] trunk/blender/release/scripts/ modules/bpy: allow addons/ modules path so extension authors can develop their own shared modules.

Campbell Barton ideasman42 at gmail.com
Sat Dec 11 12:52:29 CET 2010


Revision: 33597
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=33597
Author:   campbellbarton
Date:     2010-12-11 12:52:28 +0100 (Sat, 11 Dec 2010)

Log Message:
-----------
allow addons/modules path so extension authors can develop their own shared modules.

Modified Paths:
--------------
    trunk/blender/release/scripts/modules/bpy/__init__.py
    trunk/blender/release/scripts/modules/bpy/path.py

Modified: trunk/blender/release/scripts/modules/bpy/__init__.py
===================================================================
--- trunk/blender/release/scripts/modules/bpy/__init__.py	2010-12-11 11:14:30 UTC (rev 33596)
+++ trunk/blender/release/scripts/modules/bpy/__init__.py	2010-12-11 11:52:28 UTC (rev 33597)
@@ -48,6 +48,10 @@
     pydoc.getpager = lambda: pydoc.plainpager
     pydoc.Helper.getline = lambda self, prompt: None
     pydoc.TextDoc.use_bold = lambda self, text: text
+    
+    # Possibly temp. addons path
+    from os.path import join, dirname, normpath
+    _sys.path.append(normpath(join(dirname(__file__), "..", "..", "addons", "modules")))
 
     # if "-d" in sys.argv: # Enable this to measure startup speed
     if 0:

Modified: trunk/blender/release/scripts/modules/bpy/path.py
===================================================================
--- trunk/blender/release/scripts/modules/bpy/path.py	2010-12-11 11:14:30 UTC (rev 33596)
+++ trunk/blender/release/scripts/modules/bpy/path.py	2010-12-11 11:52:28 UTC (rev 33597)
@@ -203,7 +203,9 @@
     modules = []
 
     for filename in sorted(_os.listdir(path)):
-        if filename.endswith(".py") and filename != "__init__.py":
+        if filename == "modules":
+            pass # XXX, hard coded exception.
+        elif filename.endswith(".py") and filename != "__init__.py":
             fullpath = join(path, filename)
             modules.append((filename[0:-3], fullpath))
         elif ("." not in filename):





More information about the Bf-blender-cvs mailing list