Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2013-02-13 18:11:04 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-02-13 18:11:04 +0400
commit5016ea5cb296ebaaf5c89cab02fa9001e4031ae9 (patch)
tree8efdc49e3b5783ccedbe29449b5895d44566eb1f /source/tests/bl_load_py_modules.py
parent43f4f807d986f0c50a336d73b10ebcb243b142a8 (diff)
update python module loading test.
Diffstat (limited to 'source/tests/bl_load_py_modules.py')
-rw-r--r--source/tests/bl_load_py_modules.py22
1 files changed, 17 insertions, 5 deletions
diff --git a/source/tests/bl_load_py_modules.py b/source/tests/bl_load_py_modules.py
index d65b9605d36..9677397e01d 100644
--- a/source/tests/bl_load_py_modules.py
+++ b/source/tests/bl_load_py_modules.py
@@ -26,6 +26,12 @@ import addon_utils
import sys
import os
+BLACKLIST = {
+ "bl_i18n_utils",
+ "cycles",
+ "io_export_dxf", # TODO, check on why this fails
+ }
+
def source_list(path, filename_check=None):
from os.path import join
@@ -73,20 +79,26 @@ def load_modules():
for script_path in paths:
for mod_dir in sys.path:
if mod_dir.startswith(script_path):
- module_paths.append(mod_dir)
+ if mod_dir not in module_paths:
+ if os.path.exists(mod_dir):
+ module_paths.append(mod_dir)
#
# collect modules from our paths.
- module_names = set()
+ module_names = {}
for mod_dir in module_paths:
# print("mod_dir", mod_dir)
for mod, mod_full in bpy.path.module_names(mod_dir):
+ if mod in BLACKLIST:
+ continue
if mod in module_names:
- raise Exception("Module found twice %r" % mod)
+ mod_dir_prev, mod_full_prev = module_names[mod]
+ raise Exception("Module found twice %r.\n (%r -> %r, %r -> %r)" %
+ (mod, mod_dir, mod_full, mod_dir_prev, mod_full_prev))
modules.append(__import__(mod))
- module_names.add(mod)
+ module_names[mod] = mod_dir, mod_full
del module_names
#
@@ -128,7 +140,7 @@ def load_modules():
ignore_paths = [
os.sep + "presets" + os.sep,
os.sep + "templates" + os.sep,
- ]
+ ] + [(os.sep + f + os.sep) for f in BLACKLIST]
for f in source_files:
ok = False