Package pallavi :: Module PluginManager :: Class PluginManager
[hide private]
[frames] | no frames]

Class PluginManager

source code


Instance Methods [hide private]
 
__init__(self, pallavi)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
LoadPlugin(self, pluginName)
Load a Python plugin.
source code
 
LoadPlugins(self, pluginList)
Load a list of plugins.
source code
 
LoadDefaultPlugins(self, pluginList)
Load a list of plugins.
source code
 
ExecString(self, string)
Execute an arbitrary string.
source code
 
__MyImport(self, name)
Borrowed from python tutorial, does basic importing, I believe
source code

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, pallavi)
(Constructor)

source code 
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
Overrides: object.__init__
(inherited documentation)

LoadPlugin(self, pluginName)

source code 
Load a Python plugin. It needs to be on the path (ie: in the plugins dir) A plugin is simply a module with a setup function. Variables are set in the module for the view, config, eventBus, actions list and pluginManager before setup is called

LoadPlugins(self, pluginList)

source code 
Load a list of plugins. The list should be of names of python modules in the path (normally the plugins dir).

LoadDefaultPlugins(self, pluginList)

source code 
Load a list of plugins. The list should be names of python modules in the pallavi.plugins directory. For example, to load the plugin pallavi.plugins.Default_Keybinding, the list should contain 'Default_Keybinding'; the prefix will be prepended automatically.

ExecString(self, string)

source code 

Execute an arbitrary string. These variables will be defined:

pallavi config pluginManager eventBus actions

Note: This method is extremely unsafe. It allows arbitrary Python code to be executed, including possibly malicious code. However, Python has no sandbox or safeguards, the restricted environment is broken, and there is no way around this. IMHO, its better to provide the macro functionality and accept the risks. I suppose we could add a config option to disable macros if necessary. Or this simple functionality could actually be moved into a plugin itself.