Exemplo n.º 1
0
 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
Exemplo n.º 2
0
 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
Exemplo n.º 3
0
 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
Exemplo n.º 4
0
 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
Exemplo n.º 5
0
 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