/usr/share/pyshared/zope/annotation/interfaces.py is in python-zope.annotation 3.6.0-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 | ##############################################################################
#
# Copyright (c) 2001, 2002 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.
#
##############################################################################
"""Annotations store arbitrary application data under package-unique keys.
$Id: interfaces.py 126741 2012-06-11 17:44:56Z tseaver $
"""
__docformat__ = 'restructuredtext'
from zope.interface import Interface
class IAnnotatable(Interface):
"""Marker interface for objects that support storing annotations.
This interface says "There exists an adapter to an IAnnotations
for an object that implements `IAnnotatable`".
Classes should not directly declare that they implement this interface.
Instead they should implement an interface derived from this one, which
details how the annotations are to be stored, such as
`IAttributeAnnotatable`.
"""
class IAnnotations(IAnnotatable):
"""Stores arbitrary application data under package-unique keys.
By "package-unique keys", we mean keys that are are unique by
virtue of including the dotted name of a package as a prefix. A
package name is used to limit the authority for picking names for
a package to the people using that package.
For example, when implementing annotations for storing Zope
Dublin-Core meta-data, we use the key::
"zope.app.dublincore.ZopeDublinCore"
"""
def __nonzero__():
"""Test whether there are any annotations
"""
def __getitem__(key):
"""Return the annotation stored under key.
Raises KeyError if key not found.
"""
def get(key, default=None):
"""Return the annotation stored under key, or default if not found.
"""
def __setitem__(key, value):
"""Store annotation under key.
In order to avoid key collisions, users of this interface must
use their dotted package name as part of the key name.
"""
def __delitem__(key):
"""Removes the annotation stored under key.
Raises a KeyError if the key is not found.
"""
class IAttributeAnnotatable(IAnnotatable):
"""Marker indicating that annotations can be stored on an attribute.
This is a marker interface giving permission for an `IAnnotations`
adapter to store data in an attribute named `__annotations__`.
"""
|