The Gaudi Framework
master (9f3f8895)
Toggle main menu visibility
Loading...
Searching...
No Matches
DataHandle.py
Go to the documentation of this file.
1
11
__doc__ =
"""The python module holding python bindings to DataHandle"""
12
13
14
class
DataHandle
:
15
__slots__ = (
"Path"
,
"Mode"
,
"Type"
,
"IsCondition"
)
16
17
__hash__ =
None
# Make class non-hashable for Python2 (default in Python3)
18
19
def
__init__
(self, path, mode="R", _type="unknown_t", isCond=False):
20
object.__init__(self)
21
self.
Path
= path
22
self.
Mode
= mode
23
self.
Type
= _type
24
self.
IsCondition
= isCond
25
26
def
__getstate__
(self):
27
return
{s: getattr(self, s)
for
s
in
self.
__slots__
}
28
29
def
__setstate__
(self, state):
30
for
s
in
state:
31
setattr(self, s, state[s])
32
33
def
__eq__
(self, other):
34
"""
35
Need especially Configurable.isPropertySet when checked against default.
36
"""
37
if
isinstance(other, DataHandle):
38
return
self.
__getstate__
() == other.__getstate__()
39
if
isinstance(other, str):
40
return
self.
Path
== other
41
if
other
is
None
:
42
return
False
43
raise
ValueError(
44
f
"Unknown equality check: type={type(other)!r}, repr={other!r}"
45
)
46
47
def
__ne__
(self, other):
48
"""
49
This is mandatory if __eq__ is defined.
50
"""
51
return
not
self == other
52
53
def
__str__
(self):
54
return
self.
Path
55
56
def
__repr__
(self):
57
args = f
"'{self.Path}','{self.Mode}','{self.Type}'"
58
if
self.
IsCondition
:
59
args += f
",{self.IsCondition}"
60
return
f
"{self.__class__.__name__}({args})"
61
62
def
toStringProperty
(self):
63
return
self.
__str__
()
64
65
def
path
(self):
66
return
self.
Path
67
68
def
mode
(self):
69
return
self.
Mode
70
71
def
type
(self):
72
return
self.
Type
73
74
def
isCondition
(self):
75
return
self.
IsCondition
76
77
def
__opt_value__
(self):
78
return
repr(str(self))
79
80
81
class
DataHandleVector
:
82
__slots__ = (
"Paths"
,
"Mode"
,
"Type"
,
"IsCondition"
)
83
84
__hash__ =
None
85
86
def
__init__
(self, paths, mode="R", _type="unknown_t", isCond=False):
87
object.__init__(self)
88
self.
Paths
= list(paths)
89
self.
Mode
= mode
90
self.
Type
= _type
91
self.
IsCondition
= isCond
92
93
def
__getstate__
(self):
94
return
{s: getattr(self, s)
for
s
in
self.
__slots__
}
95
96
def
__setstate__
(self, state):
97
for
s
in
state:
98
setattr(self, s, state[s])
99
100
def
__eq__
(self, other):
101
if
isinstance(other, DataHandleVector):
102
return
self.
__getstate__
() == other.__getstate__()
103
if
isinstance(other, (list, tuple)):
104
return
self.
Paths
== list(other)
105
if
other
is
None
:
106
return
False
107
raise
ValueError(
108
f
"Unknown equality check: type={type(other)!r}, repr={other!r}"
109
)
110
111
def
__ne__
(self, other):
112
return
not
self == other
113
114
def
__iter__
(self):
115
return
iter(self.
Paths
)
116
117
def
__len__
(self):
118
return
len(self.
Paths
)
119
120
def
__getitem__
(self, index):
121
return
self.
Paths
[index]
122
123
def
__str__
(self):
124
return
str(self.
Paths
)
125
126
def
__repr__
(self):
127
args = f
"{self.Paths!r},'{self.Mode}','{self.Type}'"
128
if
self.
IsCondition
:
129
args += f
",{self.IsCondition}"
130
return
f
"{self.__class__.__name__}({args})"
131
132
def
toStringProperty
(self):
133
return
self.
Paths
134
135
def
paths
(self):
136
return
self.
Paths
137
138
def
mode
(self):
139
return
self.
Mode
140
141
def
type
(self):
142
return
self.
Type
143
144
def
isCondition
(self):
145
return
self.
IsCondition
146
147
def
__opt_value__
(self):
148
return
repr([str(path)
for
path
in
self.
Paths
])
GaudiKernel.DataHandle.DataHandle
Definition
DataHandle.py:14
GaudiKernel.DataHandle.DataHandle.Path
Path
Definition
DataHandle.py:21
GaudiKernel.DataHandle.DataHandle.__slots__
tuple __slots__
Definition
DataHandle.py:15
GaudiKernel.DataHandle.DataHandle.path
path(self)
Definition
DataHandle.py:65
GaudiKernel.DataHandle.DataHandle.__getstate__
__getstate__(self)
Definition
DataHandle.py:26
GaudiKernel.DataHandle.DataHandle.__setstate__
__setstate__(self, state)
Definition
DataHandle.py:29
GaudiKernel.DataHandle.DataHandle.__ne__
__ne__(self, other)
Definition
DataHandle.py:47
GaudiKernel.DataHandle.DataHandle.isCondition
isCondition(self)
Definition
DataHandle.py:74
GaudiKernel.DataHandle.DataHandle.__init__
__init__(self, path, mode="R", _type="unknown_t", isCond=False)
Definition
DataHandle.py:19
GaudiKernel.DataHandle.DataHandle.Type
Type
Definition
DataHandle.py:23
GaudiKernel.DataHandle.DataHandle.__str__
__str__(self)
Definition
DataHandle.py:53
GaudiKernel.DataHandle.DataHandle.toStringProperty
toStringProperty(self)
Definition
DataHandle.py:62
GaudiKernel.DataHandle.DataHandle.__eq__
__eq__(self, other)
Definition
DataHandle.py:33
GaudiKernel.DataHandle.DataHandle.Mode
Mode
Definition
DataHandle.py:22
GaudiKernel.DataHandle.DataHandle.mode
mode(self)
Definition
DataHandle.py:68
GaudiKernel.DataHandle.DataHandle.IsCondition
IsCondition
Definition
DataHandle.py:24
GaudiKernel.DataHandle.DataHandle.type
type(self)
Definition
DataHandle.py:71
GaudiKernel.DataHandle.DataHandle.__repr__
__repr__(self)
Definition
DataHandle.py:56
GaudiKernel.DataHandle.DataHandle.__opt_value__
__opt_value__(self)
Definition
DataHandle.py:77
GaudiKernel.DataHandle.DataHandleVector
Definition
DataHandle.py:81
GaudiKernel.DataHandle.DataHandleVector.mode
mode(self)
Definition
DataHandle.py:138
GaudiKernel.DataHandle.DataHandleVector.Type
Type
Definition
DataHandle.py:90
GaudiKernel.DataHandle.DataHandleVector.__getstate__
__getstate__(self)
Definition
DataHandle.py:93
GaudiKernel.DataHandle.DataHandleVector.IsCondition
IsCondition
Definition
DataHandle.py:91
GaudiKernel.DataHandle.DataHandleVector.Mode
Mode
Definition
DataHandle.py:89
GaudiKernel.DataHandle.DataHandleVector.Paths
Paths
Definition
DataHandle.py:88
GaudiKernel.DataHandle.DataHandleVector.__iter__
__iter__(self)
Definition
DataHandle.py:114
GaudiKernel.DataHandle.DataHandleVector.__opt_value__
__opt_value__(self)
Definition
DataHandle.py:147
GaudiKernel.DataHandle.DataHandleVector.__slots__
tuple __slots__
Definition
DataHandle.py:82
GaudiKernel.DataHandle.DataHandleVector.__init__
__init__(self, paths, mode="R", _type="unknown_t", isCond=False)
Definition
DataHandle.py:86
GaudiKernel.DataHandle.DataHandleVector.paths
paths(self)
Definition
DataHandle.py:135
GaudiKernel.DataHandle.DataHandleVector.__repr__
__repr__(self)
Definition
DataHandle.py:126
GaudiKernel.DataHandle.DataHandleVector.__setstate__
__setstate__(self, state)
Definition
DataHandle.py:96
GaudiKernel.DataHandle.DataHandleVector.__eq__
__eq__(self, other)
Definition
DataHandle.py:100
GaudiKernel.DataHandle.DataHandleVector.type
type(self)
Definition
DataHandle.py:141
GaudiKernel.DataHandle.DataHandleVector.__len__
__len__(self)
Definition
DataHandle.py:117
GaudiKernel.DataHandle.DataHandleVector.__getitem__
__getitem__(self, index)
Definition
DataHandle.py:120
GaudiKernel.DataHandle.DataHandleVector.isCondition
isCondition(self)
Definition
DataHandle.py:144
GaudiKernel.DataHandle.DataHandleVector.__str__
__str__(self)
Definition
DataHandle.py:123
GaudiKernel.DataHandle.DataHandleVector.toStringProperty
toStringProperty(self)
Definition
DataHandle.py:132
GaudiKernel.DataHandle.DataHandleVector.__ne__
__ne__(self, other)
Definition
DataHandle.py:111
GaudiKernel
python
GaudiKernel
DataHandle.py
Generated on
for The Gaudi Framework by
1.17.0