code cleanup: minor edits on recent commit.
authorCampbell Barton <ideasman42@gmail.com>
Sat, 13 Oct 2012 11:23:04 +0000 (11:23 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sat, 13 Oct 2012 11:23:04 +0000 (11:23 +0000)
release/scripts/modules/addon_utils.py
release/scripts/startup/bl_ui/space_userpref.py

index 2aaef769c0b394c33e2f54ba2e0a65d3066af3be..7e604c5de4c121f33106da743a8af02ca416eff3 100644 (file)
@@ -323,9 +323,8 @@ def disable(module_name, default_set=True):
             import traceback
             traceback.print_exc()
     else:
-        if mod: state = "enabled"
-        else:   state = "loaded"
-        print("addon_utils.disable: %s not %s." % (module_name, state))
+        print("addon_utils.disable: %s not %s." %
+              (module_name, "disabled" if mod is None else "loaded"))
 
     # could be in more then once, unlikely but better do this just in case.
     addons = _bpy.context.user_preferences.addons
index 87d8a13e85673bdd7ed45605ff4d604c9eef2be2..d5dd07610b60768532d07c7b283e7963a102913e 100644 (file)
@@ -1040,7 +1040,7 @@ class USERPREF_PT_addons(Panel):
         userpref = context.user_preferences
         used_ext = {ext.module for ext in userpref.addons}
 
-        userpref_addons_folder = os.path.join(bpy.context.user_preferences.filepaths.script_directory,"addons")
+        userpref_addons_folder = os.path.join(userpref.filepaths.script_directory, "addons")
         scripts_addons_folder  = bpy.utils.user_resource('SCRIPTS', "addons")
         
         # collect the categories that can be filtered on
@@ -1092,9 +1092,7 @@ class USERPREF_PT_addons(Panel):
                     (filter == info["category"]) or
                     (filter == "Enabled" and is_enabled) or
                     (filter == "Disabled" and not is_enabled) or
-                    (filter == "User" and 
-                                ( mod.__file__.startswith(userpref_addons_folder) or
-                                  mod.__file__.startswith(scripts_addons_folder)))
+                    (filter == "User" and (mod.__file__.startswith(scripts_addons_folder, userpref_addons_folder)))
                    ):
 
                 if search and search not in info["name"].lower():