allow addons/modules path so extension authors can develop their own shared modules.
This commit is contained in:
@@ -48,6 +48,10 @@ def _main():
|
|||||||
pydoc.getpager = lambda: pydoc.plainpager
|
pydoc.getpager = lambda: pydoc.plainpager
|
||||||
pydoc.Helper.getline = lambda self, prompt: None
|
pydoc.Helper.getline = lambda self, prompt: None
|
||||||
pydoc.TextDoc.use_bold = lambda self, text: text
|
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 "-d" in sys.argv: # Enable this to measure startup speed
|
||||||
if 0:
|
if 0:
|
||||||
|
|||||||
@@ -203,7 +203,9 @@ def module_names(path, recursive=False):
|
|||||||
modules = []
|
modules = []
|
||||||
|
|
||||||
for filename in sorted(_os.listdir(path)):
|
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)
|
fullpath = join(path, filename)
|
||||||
modules.append((filename[0:-3], fullpath))
|
modules.append((filename[0:-3], fullpath))
|
||||||
elif ("." not in filename):
|
elif ("." not in filename):
|
||||||
|
|||||||
Reference in New Issue
Block a user