| The Gaudi Framework v32r1 (f65d50dc)

DataObjectHandleBase.py
Go to the documentation of this file.
1 __doc__ = """The python module holding python bindings to DataObjectHandle"""
2
3 # s = "/Path/to/Address"
4
5
6 class DataObjectHandleBase(object):
7
8 __slots__ = ('Path', 'Mode')
9
10 # define accessTypes
11
12 def __init__(self, path, mode='R'):
13 object.__init__(self)
14 self.Path = path
15 self.Mode = mode
16
17 def __eq__(self, other):
18 """
19 Need especially Configurable.isPropertySet when checked against default.
20 """
21 if isinstance(other, DataObjectHandleBase):
22 return self.Path == other.Path
23 if isinstance(other, basestring):
24 return self.Path == other
25 if other is None:
26 return False
27 raise ValueError(
28 'Unknown equality check: type=%r, repr=%r' % (type(other), other))
29
30 def __ne__(self, other):
31 """
32 This is mandatory if __eq__ is defined.
33 """
34 return not self == other
35
36 def __str__(self):
37 return self.Path
38
39 def __repr__(self):
40 return "%s(\"%s\")" % (self.__class__.__name__, self.__str__())
41
42 def toStringProperty(self):
43 return self.__str__()
44
45 def __add__(self, other):
46 path = ':'.join(i + other for i in self.Path.split(':'))
47 return DataObjectHandleBase(path, self.Mode)
48
49 def __radd__(self, other):
50 path = ':'.join(other + i for i in self.Path.split(':'))
51 return DataObjectHandleBase(path, self.Mode)
52
53 def __iadd__(self, other):
54 self.Path = ':'.join(i + other for i in self.Path.split(':'))
55 return self
56
57 def mode(self):
58 return self.Mode
GaudiKernel.DataObjectHandleBase.DataObjectHandleBase
Definition: DataObjectHandleBase.py:6
GaudiKernel.DataObjectHandleBase.DataObjectHandleBase.toStringProperty
def toStringProperty(self)
Definition: DataObjectHandleBase.py:42
GaudiKernel.DataObjectHandleBase.DataObjectHandleBase.__eq__
def __eq__(self, other)
Definition: DataObjectHandleBase.py:17
GaudiKernel.DataObjectHandleBase.DataObjectHandleBase.__str__
def __str__(self)
Definition: DataObjectHandleBase.py:36
GaudiKernel.DataObjectHandleBase.DataObjectHandleBase.__radd__
def __radd__(self, other)
Definition: DataObjectHandleBase.py:49
GaudiKernel.DataObjectHandleBase.DataObjectHandleBase.__repr__
def __repr__(self)
Definition: DataObjectHandleBase.py:39
GaudiKernel.DataObjectHandleBase.DataObjectHandleBase.__ne__
def __ne__(self, other)
Definition: DataObjectHandleBase.py:30
gaudirun.type
type
Definition: gaudirun.py:142
GaudiKernel.DataObjectHandleBase.DataObjectHandleBase.__iadd__
def __iadd__(self, other)
Definition: DataObjectHandleBase.py:53
GaudiKernel.DataObjectHandleBase.DataObjectHandleBase.Path
Path
Definition: DataObjectHandleBase.py:14
GaudiKernel.DataObjectHandleBase.DataObjectHandleBase.__init__
def __init__(self, path, mode='R')
Definition: DataObjectHandleBase.py:12
GaudiKernel.DataObjectHandleBase.DataObjectHandleBase.mode
def mode(self)
Definition: DataObjectHandleBase.py:57
GaudiKernel.DataObjectHandleBase.DataObjectHandleBase.__add__
def __add__(self, other)
Definition: DataObjectHandleBase.py:45
GaudiKernel.DataObjectHandleBase.DataObjectHandleBase.Mode
Mode
Definition: DataObjectHandleBase.py:15