Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import logging
- #enables the logging used by yapsy
- logging.basicConfig(level=logging.DEBUG)
- from yapsy.PluginManager import PluginManager
- var = PluginManager()
- #location where your plugin resides in
- var.setPluginPlaces(['C:/Users/wouter/Documents/workspace/mysite/src/mysite/fingerprinting/plugins/osplugins'])
- var.locatePlugins()
- var.loadPlugins()
- #category is determined by the object your plugins it inherit from
- #Default means that everything from yapsy.IPlugin.IPlugin is accepted
- #can be changed by adding parameter to the declaration of the pluginmanager
- #http://yapsy.sourceforge.net/yapsy.PluginManager.PluginManager-class.html#__init__
- #the list contains Plugininfo objects
- #http://yapsy.sourceforge.net/yapsy.PluginManager.PluginInfo-class.html
- list = var.getPluginsOfCategory("Default")
- print list
- for item in list:
- print "item:"
- print item
- #the pluginobject itself can be retrieved from PluginInfo
- #with .plugin_object
- pluginobject = item.plugin_object
- #now you can call the methods from your plugin
- pluginobject.test()
- #get the plugin by name this returns the plugin (not the info)
- #for the PluginInfo object -->getPluginByName("yournamehere")
- plugin = var.activatePluginByName("WindowsScanner")
- #again methods can be called
- plugin.test()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement