def unloadPlugin(self, name): try: extras.delete_module(name) self.activePlugins.pop(self.activePlugins.index(name)) return True except: if DEBUG: extras.output_exc() return False
def getDetails(self, plugin, url): if plugin in self.activePlugins: try: return self.pluginObj[plugin].fileData(url) except: if DEBUG: extras.output_exc() return None else: return None
def loadPlugin(self, name): if name in self.plugins: try: module = __import__(name) self.pluginObj[name] = module.Plugin() self.activePlugins.append(name) return True except: if DEBUG: extras.output_exc() return False
def search(self, query, plugin=None): results = {} if not plugin: for x in self.activePlugins: try: results[x] = self.pluginObj[x].search(query) except: if DEBUG: extras.output_exc() return None else: try: results[plugin] = self.pluginObj[plugin].search(query) except: if DEBUG: extras.output_exc() return None return results
def getPluginInfo(self, name): if name in self.activePlugins: try: pluginName = self.pluginObj[name].pluginName pluginVersion = self.pluginObj[name].version pluginAuthor = self.pluginObj[name].author pluginHomepage = self.pluginObj[name].homepage pluginUpdate = self.pluginObj[name].update data = {'name': pluginName, 'version': pluginVersion, 'author': pluginAuthor, 'homepage': pluginHomepage, 'update': pluginUpdate} return data except: if DEBUG: extras.output_exc() return False else: return False