def execute(self, context): addon_utils.modules_refresh() bpy.context.user_preferences.active_section = 'ADDONS' bpy.data.window_managers["WinMan"].addon_search = bl_info['name'] #bpy.ops.wm.addon_expand(module=PKG) mod = addon_utils.addons_fake_modules.get(PKG) mod.bl_info['show_expanded'] = True bpy.ops.screen.userpref_show('INVOKE_DEFAULT') return {'FINISHED'}
def checkAddon(addon_name): '''Check is an addon is installed and enable it if needed''' addon_utils.modules_refresh() if addon_name not in addon_utils.addons_fake_modules: raise ImportError("%s addon not installed." % addon_name) else: default, enable = addon_utils.check(addon_name) #>>Warning: addon-module 'geoscene' found module but without __addon_enabled__ field, possible name collision if not enable: addon_utils.enable(addon_name, default_set=True, persistent=False)
def execute(self, context): import addon_utils import os path, isdir = PREFERENCES_OT_addon_remove.path_from_addon(self.module) if path is None: self.report({'WARNING'}, "Add-on path %r could not be found" % path) return {'CANCELLED'} # in case its enabled addon_utils.disable(self.module, default_set=True) import shutil if isdir and (not os.path.islink(path)): shutil.rmtree(path) else: os.remove(path) addon_utils.modules_refresh() context.area.tag_redraw() return {'FINISHED'}
def execute(self, _context): import addon_utils addon_utils.modules_refresh() return {'FINISHED'}
def RefreshAddons(self, _): addon_utils.modules_refresh() return True