本文整理汇总了Python中Plugin.Plugin类的典型用法代码示例。如果您正苦于以下问题:Python Plugin类的具体用法?Python Plugin怎么用?Python Plugin使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Plugin类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
def __init__( self ):
Plugin.__init__( self, "W9Replay", "http://www.w9replay.fr/", 1 )
self.listeEmissionsCourantes = {}
if os.path.exists( self.fichierCache ):
self.listeFichiers = self.chargerCache()
示例2: __init__
def __init__(self, station, connector):
Plugin.__init__(self)
self._station = station
self._connector = connector['icq']
self.report = None
示例3: __init__
def __init__( self ):
Plugin.__init__( self, "M6Replay", "www.m6replay.fr/", 1 )
self.listeFichiers = {} # Clefs = nomChaine, Valeurs = { nomEmission, [ [ Episode 1, Date1, URL1 ], ... ] }
if os.path.exists( self.fichierCache ):
self.listeFichiers = self.chargerCache()
示例4: __init__
def __init__( self):
Plugin.__init__( self, "Pluzz", "http://www.pluzz.fr/")
cache = self.chargerCache()
if cache:
self.listeChaines = cache
else:
self.listeChaines = {}
示例5: __init__
def __init__( self):
Plugin.__init__( self, "Europe1", "http://www.europe1.fr", 1 )
# On instancie la classe qui permet de charger les pages web
self.listeEmissions = {} # Clef = nom emission ; Valeur = lien fichier XML qui contient la liste des emissions
if os.path.exists( self.fichierCache ):
self.listeEmissions = self.chargerCache()
示例6: analyseBundle
def analyseBundle(bundleId):
bundle = config.bundleTable.find_one({"bundleId": bundleId})
if bundle == None:
logging.error("No matching bundle has been found")
abort(make_response("No matching bundle has been found", 400))
if bundle["archivePath"] == None:
logging.error("The bundle as no directory path")
abort(make_response("The bundle as no directory path", 400))
headers = {'content-type': 'application/gzip'}
analyseReturn = requests.post(
config.uriAnalyser+"/bundle/"+str(bundleId),
data=open(bundle["archivePath"], 'r').read(),
headers=headers).json()
# logging.error("analyzeBundle analyseReturn: " + str(analyseReturn))
pluginIdOffset = config.pluginTable.count()
while 1:
analyseReturn = requests.get(config.uriAnalyser+"/bundle/"+str(bundleId)).json()
if analyseReturn['status'] == "done":
bundleData = analyseReturn['datas']
break
sleep(1)
for index, plugin in enumerate(bundleData['plugins']) :
pluginId = pluginIdOffset + index
currentPlugin = Plugin(pluginId, bundleId)
currentPlugin.clips = plugin['clips']
currentPlugin.parameters = plugin['parameters']
currentPlugin.properties = plugin['properties']
currentPlugin.rawIdentifier = plugin['rawIdentifier']
currentPlugin.version = plugin['version']
# Gets Label/ShortLabel and ensures a non-empty value.
currentPlugin.label = currentPlugin.getPropValueFromKeys(
('OfxPropLabel', 'OfxPropShortLabel', 'OfxPropLongLabel'),
currentPlugin.rawIdentifier)
currentPlugin.shortLabel = currentPlugin.getPropValueFromKeys(
('OfxPropShortLabel', 'OfxPropLongLabel'),
currentPlugin.label)
bundle['plugins'].append(pluginId)
config.pluginTable.insert(currentPlugin.__dict__)
return mongodoc_jsonify(bundle)
示例7: __init__
def __init__(self, controller, msn):
Plugin.__init__(self, controller, msn)
self.msn = msn
self.enabled = False
self.winkCacheDir = os.path.join(self.msn.cacheDir,'winks')
if not os.path.exists(self.winkCacheDir):
os.mkdir(self.winkCacheDir)
self.autoplay = False
self.checkIfHasGnash()
self.config = controller.config
self.config.readPluginConfig(self.name)
示例8: __init__
def __init__(self, opt):
if "plugin" not in opt:
raise ValueError("no plugin selected")
self.botId = self._pickAName()
self.params = opt
self.logger = Plugin().load("plugins/Logger_" + opt["plugin"] + ".py")
self.logger.constructor(self.params)
示例9: Backend
class Backend(object):
def __init__(self, opt):
if 'plugin' not in opt:
raise ValueError("no plugin selected")
self.params = opt;
self.backend = Plugin().load("plugins/Backend_"+opt['plugin']+".py")
self.backend.constructor(self.params)
def alreadyExist(self, key):
res = self.backend.alreadyExist(key);
if not isinstance(res, bool):
raise TypeError('issues with the plugin: '+self.params['plugin']);
else:
return res;
def put(self, key, obj):
self.backend.put(key, obj);
示例10: instancierPlugins
def instancierPlugins( self ):
for plugin in Plugin.__subclasses__(): # Pour tous les plugins
try:
# Instance du plugin
inst = plugin()
except Exception as exc:
logger.error( "impossible d'instancier le plugin %s: %s" %( plugin, exc.message) )
traceback.print_exc()
continue
# Nom du plugin
# nom = inst.nom#FIXME Utiliser le nom de la classe
# Ajout du plugin
# self.listeInstances[ nom ] = inst
self.ajouterPlugin(inst)
示例11: __init__
def __init__(self):
Plugin.__init__(self, "videarn.com", "videarn.png")
示例12: __init__
def __init__(self):
Plugin.__init__(self)
self.requiredInput = ['MXRecord']
self.category = 'SMTP'
示例13: __init__
def __init__( self ):
Plugin.__init__( self, "France Inter", "http://sites.radiofrance.fr/franceinter/accueil/", 30 )
if os.path.exists( self.fichierCache ):
self.listeEmissions = self.chargerCache()
示例14: run
#!/usr/bin/python
from Plugin import Plugin
def run(bot, serv, ev) :
pass
REGEX = '.'
REGEXES_RUN = { REGEX : run }
plugin = Plugin(REGEXES_RUN)
if __name__ == '__main__' :
plugin.test('test', None)
示例15: __init__
def __init__( self ):
Plugin.__init__( self, "La Chaine Parlementaire", "http://www.lcp.fr/", 7 )
if( os.path.exists( self.fichierCache ) ):
self.listeEmissions = self.chargerCache()