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

Source Code for Module Products.ZenEvents.metaconfigure

 1  ########################################################################### 
 2  # 
 3  # This program is part of Zenoss Core, an open source monitoring platform. 
 4  # Copyright (C) 2010, Zenoss Inc. 
 5  # 
 6  # This program is free software; you can redistribute it and/or modify it 
 7  # under the terms of the GNU General Public License version 2 or (at your 
 8  # option) any later version as published by the Free Software Foundation. 
 9  # 
10  # For complete information please visit: http://www.zenoss.com/oss/ 
11  # 
12  ########################################################################### 
13  from zope.component.zcml import utility 
14  from .interfaces import IPreEventPlugin, IPostEventPlugin, IEventIdentifierPlugin 
15   
16 -def _eventPlugin( _context, plugin, pluginInterface, name=None):
17 if name is None: 18 name = '.'.join((plugin.__module__, plugin.__name__)) 19 utility(_context, name=name, factory=plugin, provides=pluginInterface)
20
21 -def preEventPlugin(_context, plugin, name=None):
22 _eventPlugin( _context, plugin, IPreEventPlugin, name )
23
24 -def postEventPlugin(_context, plugin, name=None):
25 _eventPlugin( _context, plugin, IPostEventPlugin, name )
26
27 -def eventIdentifierPlugin( _context, plugin, name=None):
28 if name is None: 29 name = '.'.join((plugin.__module__, plugin.__name__)) 30 utility(_context, name=name, factory=plugin, provides=IEventIdentifierPlugin)
31