Back to index

plone3  3.1.7
Classes | Functions
kss.core.pluginregistry.plugin Namespace Reference

Classes

class  KSSPluginError
class  KSSPlugin

Functions

def registerPlugin

Class Documentation

class kss::core::pluginregistry::plugin::KSSPluginError

Definition at line 22 of file plugin.py.


Function Documentation

def kss.core.pluginregistry.plugin.registerPlugin (   cls,
  interface,
  name,
  arg,
  kw 
)

Definition at line 25 of file plugin.py.

00025 
00026 def registerPlugin(cls, interface, name, *arg, **kw):
00027     'Convenience method to help registration'
00028     plugin = cls(name, *arg, **kw)
00029     # check if it's registered: do not allow registration for the second name
00030     try:
00031         capi.getUtility(interface, name=name)
00032     except capi.ComponentLookupError:
00033         pass
00034     else:
00035         raise KSSPluginError, 'Duplicate registration attempt for plugin "%s" of type %s' % (plugin.name, interface)
00036     # provide the utility.
00037     capi.provideUtility(plugin, interface, name=name)

Here is the caller graph for this function: