def __init__( self, *args, **kwargs ): self.pluginMgr = PluginMgr() self.parameters = self.pluginMgr.parse_params() xbmc.log("Parameters %s"%self.parameters, xbmc.LOGDEBUG) self.select()
class Addons4xboxInstallerPlugin: """ Main plugin class """ def __init__( self, *args, **kwargs ): self.pluginMgr = PluginMgr() self.parameters = self.pluginMgr.parse_params() xbmc.log("Parameters %s"%self.parameters, xbmc.LOGDEBUG) self.select() def select( self ): """ Decides what to do based on the plugin URL """ try: # # Create root list # if len(self.parameters) < 1: import resources.libs.Addons4Xbox_list_root as plugin # # Install from remote repository # elif PARAM_INSTALL_FROM_REPO in self.parameters.keys(): import resources.libs.Addons4Xbox_install_remote as plugin # # Install from zip # elif PARAM_INSTALL_FROM_ZIP in self.parameters.keys(): import resources.libs.Addons4Xbox_install_zip as plugin # # List of available Add-ons repositories installed # elif PARAM_LISTTYPE in self.parameters.keys() and VALUE_LIST_LOCAL_REPOS == self.parameters[PARAM_LISTTYPE]: import resources.libs.Addons4Xbox_list_local_repo as plugin # # List of available repositories on XBMC wiki page # elif PARAM_LISTTYPE in self.parameters.keys() and VALUE_LIST_WIKI_REPOS == self.parameters[PARAM_LISTTYPE]: import resources.libs.Addons4Xbox_list_wiki_repo as plugin # # List of Add-ons categories for a repository # elif PARAM_LISTTYPE in self.parameters.keys() and VALUE_LIST_CATEGORY == self.parameters[PARAM_LISTTYPE]: import resources.libs.Addons4Xbox_list_repo_cat as plugin # # List of Add-ons of a categories for a specific repository # elif PARAM_LISTTYPE in self.parameters.keys() and VALUE_LIST_ADDONS == self.parameters[PARAM_LISTTYPE]: import resources.libs.Addons4Xbox_list_addons as plugin # # List of options for managing installed Add-ons # elif PARAM_LISTTYPE in self.parameters.keys() and VALUE_LIST_MANAGE_ADDONS == self.parameters[PARAM_LISTTYPE]: import resources.libs.Addons4Xbox_list_manage_addons as plugin # # List of missing modules (usually not found during the installed of an addon) # elif PARAM_LISTTYPE in self.parameters.keys() and VALUE_LIST_MISSING_MODULES == self.parameters[PARAM_LISTTYPE]: import resources.libs.Addons4Xbox_list_missing_libs as plugin # # Display addon info Window # elif PARAM_ACTION in self.parameters.keys() and VALUE_DISPLAY_INFO == self.parameters[PARAM_ACTION]: import resources.libs.DialogRepoInfo as plugin # Run plugin.Main() except: print_exc() self.pluginMgr.end_of_directory( False )