[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [41952] trunk/blender/release/scripts: addons in contrib now have their own 'Testing' category which is off by default.

Campbell Barton ideasman42 at gmail.com
Thu Nov 17 21:11:22 CET 2011


Revision: 41952
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=41952
Author:   campbellbarton
Date:     2011-11-17 20:11:20 +0000 (Thu, 17 Nov 2011)
Log Message:
-----------
addons in contrib now have their own 'Testing' category which is off by default.

Modified Paths:
--------------
    trunk/blender/release/scripts/modules/addon_utils.py
    trunk/blender/release/scripts/startup/bl_ui/__init__.py
    trunk/blender/release/scripts/startup/bl_ui/space_userpref.py

Modified: trunk/blender/release/scripts/modules/addon_utils.py
===================================================================
--- trunk/blender/release/scripts/modules/addon_utils.py	2011-11-17 19:43:59 UTC (rev 41951)
+++ trunk/blender/release/scripts/modules/addon_utils.py	2011-11-17 20:11:20 UTC (rev 41952)
@@ -62,7 +62,7 @@
     path_list = paths()
 
     # fake module importing
-    def fake_module(mod_name, mod_path, speedy=True):
+    def fake_module(mod_name, mod_path, speedy=True, force_support=None):
         global error_encoding
 
         if _bpy.app.debug:
@@ -134,6 +134,9 @@
                 traceback.print_exc()
                 raise
 
+            if force_support is not None:
+                mod.bl_info["support"] = force_support
+
             return mod
         else:
             return None
@@ -141,6 +144,10 @@
     modules_stale = set(module_cache.keys())
 
     for path in path_list:
+
+        # force all contrib addons to be 'TESTING'
+        force_support = 'TESTING' if path.endswith("addons_contrib") else None
+
         for mod_name, mod_path in _bpy.path.module_names(path):
             modules_stale -= {mod_name}
             mod = module_cache.get(mod_name)
@@ -161,7 +168,7 @@
                     mod = None
 
             if mod is None:
-                mod = fake_module(mod_name, mod_path)
+                mod = fake_module(mod_name, mod_path, force_support=force_support)
                 if mod:
                     module_cache[mod_name] = mod
 

Modified: trunk/blender/release/scripts/startup/bl_ui/__init__.py
===================================================================
--- trunk/blender/release/scripts/startup/bl_ui/__init__.py	2011-11-17 19:43:59 UTC (rev 41951)
+++ trunk/blender/release/scripts/startup/bl_ui/__init__.py	2011-11-17 20:11:20 UTC (rev 41952)
@@ -116,11 +116,15 @@
             )
 
     WindowManager.addon_support = EnumProperty(
-            items=[('OFFICIAL', "Official", ""),
-                   ('COMMUNITY', 'Community', ""),
+            items=[('OFFICIAL', "Official", "Officially supported"),
+                   ('COMMUNITY', "Community", "Maintained by community developers"),
+                   ('TESTING', "Testing", "Newly contributed scripts (excluded from release builds)"),
                   ],
             name="Support",
-            description="Display support level", default={'OFFICIAL', 'COMMUNITY'}, options={'ENUM_FLAG'})
+            description="Display support level",
+            default={'OFFICIAL', 'COMMUNITY'},
+            options={'ENUM_FLAG'},
+            )
     # done...
 
 

Modified: trunk/blender/release/scripts/startup/bl_ui/space_userpref.py
===================================================================
--- trunk/blender/release/scripts/startup/bl_ui/space_userpref.py	2011-11-17 19:43:59 UTC (rev 41951)
+++ trunk/blender/release/scripts/startup/bl_ui/space_userpref.py	2011-11-17 20:11:20 UTC (rev 41952)
@@ -891,6 +891,12 @@
     bl_region_type = 'WINDOW'
     bl_options = {'HIDE_HEADER'}
 
+    _support_icon_mapping = {
+        'OFFICIAL': 'FILE_BLEND',
+        'COMMUNITY': 'POSE_DATA',
+        'TESTING': 'MOD_EXPLODE',
+        }
+
     @classmethod
     def poll(cls, context):
         userpref = context.user_preferences
@@ -931,12 +937,13 @@
         split = layout.split(percentage=0.2)
         col = split.column()
         col.prop(context.window_manager, "addon_search", text="", icon='VIEWZOOM')
-        col.label(text="Categories")
-        col.prop(context.window_manager, "addon_filter", expand=True)
 
         col.label(text="Supported Level")
         col.prop(context.window_manager, "addon_support", expand=True)
 
+        col.label(text="Categories")
+        col.prop(context.window_manager, "addon_filter", expand=True)
+
         col = split.column()
 
         # set in addon_utils.modules(...)
@@ -995,12 +1002,7 @@
                     rowsub.label(icon='ERROR')
 
                 # icon showing support level.
-                if info["support"] == 'OFFICIAL':
-                    rowsub.label(icon='FILE_BLEND')
-                elif info["support"] == 'COMMUNITY':
-                    rowsub.label(icon='POSE_DATA')
-                else:
-                    rowsub.label(icon='QUESTION')
+                rowsub.label(icon=self._support_icon_mapping.get(info["support"], 'QUESTION'))
 
                 if is_enabled:
                     row.operator("wm.addon_disable", icon='CHECKBOX_HLT', text="", emboss=False).module = module_name




More information about the Bf-blender-cvs mailing list