Personal wiki notebook (not under development)

Invoke.py 283B

12345678910
  1. import imp
  2. import plugins
  3. def invoke( plugin_type, plugin_name, *args, **kwargs ):
  4. plugin_name = u"%s_%s" % ( plugin_type, plugin_name )
  5. plugin_module = getattr( plugins, plugin_name )
  6. function = getattr( plugin_module, plugin_type )
  7. return apply( function, args, kwargs )