Package Products :: Package ZenEvents :: Module metaconfigure
[hide private]
[frames] | no frames]

Source Code for Module Products.ZenEvents.metaconfigure

 1  ############################################################################## 
 2  #  
 3  # Copyright (C) Zenoss, Inc. 2010, all rights reserved. 
 4  #  
 5  # This content is made available according to terms specified in 
 6  # License.zenoss under the directory where your Zenoss product is installed. 
 7  #  
 8  ############################################################################## 
 9   
10   
11  from zope.component.zcml import utility 
12  from .interfaces import IPreEventPlugin, IPostEventPlugin, IEventIdentifierPlugin 
13   
14 -def _eventPlugin( _context, plugin, pluginInterface, name=None):
15 if name is None: 16 name = '.'.join((plugin.__module__, plugin.__name__)) 17 utility(_context, name=name, factory=plugin, provides=pluginInterface)
18
19 -def preEventPlugin(_context, plugin, name=None):
20 _eventPlugin( _context, plugin, IPreEventPlugin, name )
21
22 -def postEventPlugin(_context, plugin, name=None):
23 _eventPlugin( _context, plugin, IPostEventPlugin, name )
24
25 -def eventIdentifierPlugin( _context, plugin, name=None):
26 if name is None: 27 name = '.'.join((plugin.__module__, plugin.__name__)) 28 utility(_context, name=name, factory=plugin, provides=IEventIdentifierPlugin)
29