This file is indexed.

/usr/share/pyshared/zope/lifecycleevent/interfaces.py is in python-zope.lifecycleevent 4.0.3-0ubuntu1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
##############################################################################
#
# Copyright (c) 2002, 2003 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
"""Event-related interfaces
"""
__docformat__ = 'restructuredtext'

from zope.interface import Interface, Attribute
from zope.interface import interfaces


class IZopeLifecycleEvent(Interface):

    def created(object):
        """Send an IObjectCreatedEvent for `object`."""

    def modified(object, *descriptions):
        """Send an IObjectModifiedEvent for `object`.

        `descriptions` is a sequence of interfaces or fields which were
        updated.

        """

    def copied(object, original):
        """Send an IObjectCopiedEvent for object.

        `original` is the object the copy was created from.

        """

    def moved(object, oldParent, oldName, newParent, newName):
        """Send an IObjectMovedEvent for object.

        `oldParent` is the container `object` was removed from.
        `oldName` was the name used to store `object` in `oldParent`.
        `newParent` is the container `object` was added to.
        `newName` is the name used to store `object` in `newParent`.

        """

    def added(object, newParent=None, newName=None):
        """Send an IObjectAddedEvent for object.

        `newParent` is the container `object` was added to.
        `newName` is the name used to store `object` in the container.
        These will be determined object.__parent__ and object.__name__
        if None.

        """

    def removed(object, oldParent=None, oldName=None):
        """Send an IObjectRemovedEvent for object.

        `oldParent` is the container `object` was removed from.
        `oldName` was the name used to store `object` in `oldParent`.
        These will be determined object.__parent__ and object.__name__
        if None.

        """


class IObjectCreatedEvent(interfaces.IObjectEvent):
    """An object has been created.

    The location will usually be ``None`` for this event."""


class IObjectCopiedEvent(IObjectCreatedEvent):
    """An object has been copied"""

    original = Attribute("The original from which the copy was made")


class IObjectModifiedEvent(interfaces.IObjectEvent):
    """An object has been modified"""


class IModificationDescription(Interface):
    """ Marker interface for descriptions of object modifications.

    Can be used as a parameter of an IObjectModifiedEvent."""


class IAttributes(IModificationDescription):
    """ Describes the attributes of an interface.

    """

    interface = Attribute("The involved interface.")
    attributes = Attribute("A sequence of modified attributes.")


class ISequence(IModificationDescription):
    """ Describes the modified keys of a sequence-like interface.

    """

    interface = Attribute("The involved interface.")
    keys = Attribute("A sequence of modified keys.")


##############################################################################
# Moving Objects

class IObjectMovedEvent(interfaces.IObjectEvent):
    """An object has been moved."""

    oldParent = Attribute("The old location parent for the object.")
    oldName = Attribute("The old location name for the object.")
    newParent = Attribute("The new location parent for the object.")
    newName = Attribute("The new location name for the object.")


##############################################################################
# Adding objects

class IObjectAddedEvent(IObjectMovedEvent):
    """An object has been added to a container."""


##############################################################################
# Removing objects


class IObjectRemovedEvent(IObjectMovedEvent):
    """An object has been removed from a container."""