Package Products :: Package ZenModel :: Module subscribers |
[hide private]
[frames] | no frames]

# Source Code for Module Products.ZenModel.subscribers

     1  ##############################################################################
     2  #
     3  # Copyright (C) Zenoss, Inc. 2007, 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 Products.ZenModel.IpInterface import IpInterface, beforeDeleteIpInterface
    12  from OFS.interfaces import IObjectWillBeAddedEvent
    13  from zope.container.interfaces import IObjectRemovedEvent
    14
    15 -def unindexBeforeDelete(ob, event):
    16      """
    17      Multisubscriber for IIndexed + IObjectWillBeMovedEvent
    18      """
    19      if not IObjectWillBeAddedEvent.providedBy(event):
    20          if isinstance(ob, IpInterface):
    21              beforeDeleteIpInterface(ob, event)
    22          else:
    23              ob.unindex_object()
    24
    25 -def indexAfterAddOrMove(ob, event):
    26      """
    27      Multisubscriber for IIndexed + IObjectMovedEvent.
    28      """
    29      if not IObjectRemovedEvent.providedBy(event):
    30          ob.index_object()
    31