* Some more fixes for recent move operator commit.
This commit is contained in:
@@ -34,6 +34,11 @@ import bpy as _bpy
|
||||
error_duplicates = False
|
||||
error_encoding = False
|
||||
|
||||
_addons_fake_modules = {}
|
||||
|
||||
def module_get(mod_name):
|
||||
return _addons_fake_modules[mod_name]
|
||||
|
||||
|
||||
def paths():
|
||||
# RELEASE SCRIPTS: official scripts distributed in Blender releases
|
||||
|
||||
@@ -1725,7 +1725,7 @@ class WM_OT_addon_install(Operator):
|
||||
del pyfile_dir
|
||||
# done checking for exceptional case
|
||||
|
||||
addons_old = {mod.__name__ for mod in addon_utils.modules(USERPREF_PT_addons._addons_fake_modules)}
|
||||
addons_old = {mod.__name__ for mod in addon_utils.modules(addon_utils._addons_fake_modules)}
|
||||
|
||||
#check to see if the file is in compressed format (.zip)
|
||||
if zipfile.is_zipfile(pyfile):
|
||||
@@ -1774,7 +1774,7 @@ class WM_OT_addon_install(Operator):
|
||||
traceback.print_exc()
|
||||
return {'CANCELLED'}
|
||||
|
||||
addons_new = {mod.__name__ for mod in addon_utils.modules(USERPREF_PT_addons._addons_fake_modules)} - addons_old
|
||||
addons_new = {mod.__name__ for mod in addon_utils.modules(addon_utils._addons_fake_modules)} - addons_old
|
||||
addons_new.discard("modules")
|
||||
|
||||
# disable any addons we may have enabled previously and removed.
|
||||
@@ -1784,7 +1784,7 @@ class WM_OT_addon_install(Operator):
|
||||
|
||||
# possible the zip contains multiple addons, we could disallow this
|
||||
# but for now just use the first
|
||||
for mod in addon_utils.modules(USERPREF_PT_addons._addons_fake_modules):
|
||||
for mod in addon_utils.modules(addon_utils._addons_fake_modules):
|
||||
if mod.__name__ in addons_new:
|
||||
info = addon_utils.module_bl_info(mod)
|
||||
|
||||
@@ -1818,7 +1818,7 @@ class WM_OT_addon_remove(Operator):
|
||||
|
||||
@staticmethod
|
||||
def path_from_addon(module):
|
||||
for mod in addon_utils.modules(USERPREF_PT_addons._addons_fake_modules):
|
||||
for mod in addon_utils.modules(addon_utils._addons_fake_modules):
|
||||
if mod.__name__ == module:
|
||||
filepath = mod.__file__
|
||||
if os.path.exists(filepath):
|
||||
@@ -1873,7 +1873,7 @@ class WM_OT_addon_expand(Operator):
|
||||
# unlikely to fail, module should have already been imported
|
||||
try:
|
||||
# mod = __import__(module_name)
|
||||
mod = USERPREF_PT_addons.module_get(module_name)
|
||||
mod = addon_utils.module_get(module_name)
|
||||
except:
|
||||
import traceback
|
||||
traceback.print_exc()
|
||||
|
||||
@@ -77,6 +77,7 @@ del _namespace
|
||||
|
||||
|
||||
import bpy
|
||||
import addon_utils
|
||||
|
||||
|
||||
def register():
|
||||
@@ -96,7 +97,7 @@ def register():
|
||||
|
||||
items_unique = set()
|
||||
|
||||
for mod in addon_utils.modules(space_userpref.USERPREF_PT_addons._addons_fake_modules):
|
||||
for mod in addon_utils.modules(addon_utils._addons_fake_modules):
|
||||
info = addon_utils.module_bl_info(mod)
|
||||
items_unique.add(info["category"])
|
||||
|
||||
|
||||
@@ -891,17 +891,11 @@ class USERPREF_PT_addons(Panel):
|
||||
bl_region_type = 'WINDOW'
|
||||
bl_options = {'HIDE_HEADER'}
|
||||
|
||||
_addons_fake_modules = {}
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
userpref = context.user_preferences
|
||||
return (userpref.active_section == 'ADDONS')
|
||||
|
||||
@staticmethod
|
||||
def module_get(mod_name):
|
||||
return USERPREF_PT_addons._addons_fake_modules[mod_name]
|
||||
|
||||
@staticmethod
|
||||
def is_user_addon(mod, user_addon_paths):
|
||||
if not user_addon_paths:
|
||||
@@ -932,7 +926,7 @@ class USERPREF_PT_addons(Panel):
|
||||
used_ext = {ext.module for ext in userpref.addons}
|
||||
|
||||
# collect the categories that can be filtered on
|
||||
addons = [(mod, addon_utils.module_bl_info(mod)) for mod in addon_utils.modules(USERPREF_PT_addons._addons_fake_modules)]
|
||||
addons = [(mod, addon_utils.module_bl_info(mod)) for mod in addon_utils.modules(addon_utils._addons_fake_modules)]
|
||||
|
||||
split = layout.split(percentage=0.2)
|
||||
col = split.column()
|
||||
|
||||
Reference in New Issue
Block a user