This file is indexed.

/usr/lib/python2.7/dist-packages/zope/exceptions/interfaces.py is in python-zope.exceptions 4.0.8-1.

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
##############################################################################
#
# 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.
#
##############################################################################
"""ITracebackSupplement interface definition.

When zope.exceptionformatter generates a traceback, it looks for local
variables named __traceback_info__ or __traceback_supplement__.  It
includes the information provided by those local variables in the
traceback.

__traceback_info__ is for arbitrary information.
repr(__traceback_info__) gets dumped to the traceback.

__traceback_supplement__ is more structured.  It should be a tuple.
The first item of the tuple is a callable that produces an object that
implements ITracebackSupplement, and the rest of the tuple contains
arguments to pass to the factory.  The traceback formatter makes an
effort to clearly present the information provided by the
ITracebackSupplement.
"""
from zope.interface import Interface
from zope.interface import Attribute
from zope.interface import implementer


class IDuplicationError(Interface):
    pass


@implementer(IDuplicationError)
class DuplicationError(Exception):
    """A duplicate registration was attempted"""


class IUserError(Interface):
    """User error exceptions
    """


@implementer(IUserError)
class UserError(Exception):
    """User errors

    These exceptions should generally be displayed to users unless
    they are handled.
    """


class ITracebackSupplement(Interface):
    """Provides valuable information to supplement an exception traceback.

    The interface is geared toward providing meaningful feedback when
    exceptions occur in user code written in mini-languages like
    Zope page templates and restricted Python scripts.
    """

    source_url = Attribute(
        'source_url',
        """Optional.  Set to URL of the script where the exception occurred.

        Normally this generates a URL in the traceback that the user
        can visit to manage the object.  Set to None if unknown or
        not available.
        """)

    line = Attribute(
        'line',
        """Optional.  Set to the line number (>=1) where the exception
        occurred.

        Set to 0 or None if the line number is unknown.
        """)

    column = Attribute(
        'column',
        """Optional.  Set to the column offset (>=0) where the exception
        occurred.

        Set to None if the column number is unknown.
        """)

    expression = Attribute(
        'expression',
        """Optional.  Set to the expression that was being evaluated.

        Set to None if not available or not applicable.
        """)

    warnings = Attribute(
        'warnings',
        """Optional.  Set to a sequence of warning messages.

        Set to None if not available, not applicable, or if the exception
        itself provides enough information.
        """)

    def getInfo():
        """Optional.  Returns a string containing any other useful info.
        """