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

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/rigify
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2010-11-17 10:35:01 +0300
committerCampbell Barton <ideasman42@gmail.com>2010-11-17 10:35:01 +0300
commit2839bcf9ee36b329d2080f95e8fd872fde6d6ddb (patch)
treecea7e03842a008e75643d2f23ced5c28fdceea88 /rigify
parente501ab49f8e772e037d7ed40bb39ea2df2d97ddd (diff)
minor edits from my last patch, possible win32 fix and warn if '.' in dir names.
Diffstat (limited to 'rigify')
-rw-r--r--rigify/__init__.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/rigify/__init__.py b/rigify/__init__.py
index 1cbad51a..98a807bd 100644
--- a/rigify/__init__.py
+++ b/rigify/__init__.py
@@ -47,17 +47,21 @@ def get_rig_list(path):
MODULE_DIR = os.path.dirname(__file__)
RIG_DIR_ABS = os.path.join(MODULE_DIR, utils.RIG_DIR)
SEARCH_DIR_ABS = os.path.join(RIG_DIR_ABS, path)
- path_strip = path.strip(os.sep)
files = os.listdir(SEARCH_DIR_ABS)
files.sort()
for f in files:
- if not f.startswith("_") and not f.startswith("."):
+ if f[0] in (".", "_"):
+ pass
+ elif "." in f:
+ print("Warning: %r, filename contains a '.', skipping" % os.path.join(SEARCH_DIR_ABS, f))
+ else:
f_abs = os.path.join(SEARCH_DIR_ABS, f)
if os.path.isdir(f_abs):
# Check directories
+ module_name = os.path.join(path, f).replace(os.sep, ".")
try:
- rig = utils.get_rig_type(os.path.join(path_strip, f).replace(os.sep, "."))
+ rig = utils.get_rig_type(module_name)
except ImportError as e:
print("Rigify: " + str(e))
else:
@@ -72,8 +76,9 @@ def get_rig_list(path):
elif f.endswith(".py"):
# Check straight-up python files
t = f[:-3]
+ module_name = os.path.join(path, t).replace(os.sep, ".")
try:
- utils.get_rig_type((path + t).replace("/", ".")).Rig
+ utils.get_rig_type(module_name).Rig
except (ImportError, AttributeError):
pass
else: