def uninstall_module(cls,module, hard=False): """ uninstall a module the flag "hard" actually deletes the files of this module in modpath module can be module or module meta """ if module.__class__.__name__ != "Module": nr = cls._get_module_id_from_name(module_meta["name"]) module = cls.get_module(nr) Action.delete_actions_with_module(module) View.delete_mappings_with_module(module) CSSManager().delete_definitions_with_module(module) db = Database() db.remove_tables_for_module(module) Permission.remove_permissions_for_module(module) if hard: modpath = Configuration().get_entry('global.modpath') version = module.get_version() shutil.rmtree(modpath+"/"+module.get_name()+"/v"+version[0]+"_"+version[1]+"_"+version[2]) cls._unregister_module(module) PokeManager.add_activity(ActivityType.MODULE)
def setActionView(self, params): action_id = int(params[0]) view_id = int(params[1]) action = Action.get_action_by_id(action_id) action.set_view_id(view_id) return 0
def delete(self): db = Database() if self._id is None: raise ModuleCoreException(ModuleCoreException.get_msg(2)) Action.delete_actions_with_widget(self) View.delete_mappings_with_widget(self) css_manager = CSSManager() css_manager.delete_definitions_with_widget(self) stmnt = "DELETE FROM WIDGETS WHERE WGT_ID = ? ;" db.query(stmnt,(self._id,),commit=True) PokeManager.add_activity(ActivityType.WIDGET)
def setActionUrl(self, params): action_id = int(params[0]) url = str(params[1]) action = Action.get_action_by_id(action_id) action.set_url(url) return 0
def setActionWidgetSpaceConstellation(self, params): action_id = int(params[0]) widget_id = int(params[1]) space = int(params[2]) action = Action.get_action_by_id(action_id) action.set_widget_space_constellation(widget_id, space) return 0
def moveToBottomActionOrder(self, params): action_id = int(params[0]) action = Action.get_action_by_id(action_id) action.move_to_bottom_order() return 0
def moveToTopActionOrder(self, params): action_id = int(params[0]) action = Action.get_action_by_id(action_id) action.move_to_top_order() return 0
def decreaseActionOrder(self, params): action_id = int(params[0]) action = Action.get_action_by_id(action_id) action.decrease_order() return 0
def deleteAction(self, params): action_id = int(params[0]) action = Action.get_action_by_id(action_id) action.delete() return 0
def addActionToActionList(self, params): action_list_id = int(params[0]) action_list = ActionList.get_action_list_by_id(action_list_id) Action.create_action(action_list, None, "") return 0