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'}
Exemplo n.º 2
0
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)
Exemplo n.º 3
0
    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'}
Exemplo n.º 4
0
    def execute(self, _context):
        import addon_utils

        addon_utils.modules_refresh()

        return {'FINISHED'}
Exemplo n.º 5
0
 def RefreshAddons(self, _):
     addon_utils.modules_refresh()
     return True
Exemplo n.º 6
0
    def execute(self, _context):
        import addon_utils

        addon_utils.modules_refresh()

        return {'FINISHED'}