This file is indexed.

/usr/lib/python3/dist-packages/PyTango/exception.py is in python3-pytango 8.1.1-1build3.

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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
# ------------------------------------------------------------------------------
# This file is part of PyTango (http://www.tinyurl.com/PyTango)
#
# Copyright 2006-2012 CELLS / ALBA Synchrotron, Bellaterra, Spain
# Copyright 2013-2014 European Synchrotron Radiation Facility, Grenoble, France
#
# Distributed under the terms of the GNU Lesser General Public License,
# either version 3 of the License, or (at your option) any later version.
# See LICENSE.txt for more info.
# ------------------------------------------------------------------------------

"""
This is an internal PyTango module.
"""

__all__ = ["exception_init"]

__docformat__ = "restructuredtext"

from .utils import document_static_method as __document_static_method
from ._PyTango import Except, DevError, ErrSeverity

def __to_dev_failed(exc_type=None, exc_value=None, traceback=None):
    """to_dev_failed(exc_type, exc_value, traceback) -> PyTango.DevFailed

            Generate a TANGO DevFailed exception.
            The exception is created with a single :class:`~PyTango.DevError`
            object. A default value *PyTango.ErrSeverity.ERR* is defined for
            the :class:`~PyTango.DevError` severity field.
            
            The parameters are the same as the ones generates by a call to
            :func:`sys.exc_info`.
            
        Parameters :
            - type : (class)  the exception type of the exception being handled
            - value : (object) exception parameter (its associated value or the
                      second argument to raise, which is always a class instance
                      if the exception type is a class object)
            - traceback : (traceback) traceback object
        
        Return     : (PyTango.DevFailed) a tango exception object
        
        New in PyTango 7.2.1"""
    try:
        Except.throw_python_exception(exc_type, exc_value, traceback)
    except Exception as e:
        return e

# -~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
# DevError pickle
# -~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~

def __DevError__getinitargs__(self):
    return ()

def __DevError__getstate__(self):
    return self.reason, self.desc, self.origin, int(self.severity)

def __DevError__setstate__(self, state):
    self.reason = state[0]
    self.desc = state[1]
    self.origin = state[2]
    self.severity = ErrSeverity(state[3])

def __init_DevError():
    DevError.__getinitargs__ = __DevError__getinitargs__
    DevError.__getstate__ = __DevError__getstate__
    DevError.__setstate__ = __DevError__setstate__

def __init_Except():
    Except.to_dev_failed = staticmethod(__to_dev_failed)

def __doc_Except():
    def document_static_method(method_name, desc, append=True):
        return __document_static_method(Except, method_name, desc, append)
    
    Except.__doc__ = """
    A containner for the static methods:
    
        - throw_exception
        - re_throw_exception
        - print_exception
        - compare_exception"""
    
    document_static_method("throw_exception", """
    throw_exception(reason, desc, origin, sever=PyTango.ErrSeverity.ERR) -> None

            Generate and throw a TANGO DevFailed exception.
            The exception is created with a single :class:`~PyTango.DevError` 
            object. A default value *PyTango.ErrSeverity.ERR* is defined for 
            the :class:`~PyTango.DevError` severity field.
        
        Parameters :
            - reason : (str) The exception :class:`~PyTango.DevError` object reason field
            - desc   : (str) The exception :class:`~PyTango.DevError` object desc field
            - origin : (str) The exception :class:`~PyTango.DevError` object origin field
            - sever  : (PyTango.ErrSeverity) The exception DevError object severity field

        Throws     : DevFailed
    """ )

    document_static_method("re_throw_exception", """
    re_throw_exception(ex, reason, desc, origin, sever=PyTango.ErrSeverity.ERR) -> None

            Re-throw a TANGO :class:`~PyTango.DevFailed` exception with one more error.
            The exception is re-thrown with one more :class:`~PyTango.DevError` object.
            A default value *PyTango.ErrSeverity.ERR* is defined for the new
            :class:`~PyTango.DevError` severity field.
        
        Parameters :
            - ex     : (PyTango.DevFailed) The :class:`~PyTango.DevFailed` exception
            - reason : (str) The exception :class:`~PyTango.DevError` object reason field
            - desc   : (str) The exception :class:`~PyTango.DevError` object desc field
            - origin : (str) The exception :class:`~PyTango.DevError` object origin field
            - sever  : (PyTango.ErrSeverity) The exception DevError object severity field

        Throws     : DevFailed
    """ )
    
    document_static_method("print_error_stack", """
    print_error_stack(ex) -> None

            Print all the details of a TANGO error stack.
        
        Parameters :
            - ex     : (PyTango.DevErrorList) The error stack reference
    """ )

    document_static_method("print_exception", """
    print_exception(ex) -> None

            Print all the details of a TANGO exception.
        
        Parameters :
            - ex     : (PyTango.DevFailed) The :class:`~PyTango.DevFailed` exception
    """ )
    
    document_static_method("throw_python_exception", """
    throw_python_exception(type, value, traceback) -> None

            Generate and throw a TANGO DevFailed exception.
            The exception is created with a single :class:`~PyTango.DevError`
            object. A default value *PyTango.ErrSeverity.ERR* is defined for
            the :class:`~PyTango.DevError` severity field.
            
            The parameters are the same as the ones generates by a call to
            :func:`sys.exc_info`.
            
        Parameters :
            - type : (class)  the exception type of the exception being handled
            - value : (object) exception parameter (its associated value or the
                      second argument to raise, which is always a class instance
                      if the exception type is a class object)
            - traceback : (traceback) traceback object

        Throws     : DevFailed
        
        New in PyTango 7.2.1
    """ )
    
def __doc_DevError():
    DevError.__doc__ = """
    Structure describing any error resulting from a command execution,
    or an attribute query, with following members:
    
        - reason : (str) reason
        - severity : (ErrSeverity) error severty (WARN, ERR, PANIC)
        - desc : (str) error description
        - origin : (str) Tango server method in which the error happened"""

  
def exception_init(doc=True):
    __init_Except()
    __init_DevError()
    if doc:
        __doc_Except()
        __doc_DevError()