ATLAS Offline Software
Public Member Functions | Private Attributes | Static Private Attributes | List of all members
python.ConfigurationShelve.ConfigurationShelve Class Reference

representation of job databases ========================================== More...

Inheritance diagram for python.ConfigurationShelve.ConfigurationShelve:
Collaboration diagram for python.ConfigurationShelve.ConfigurationShelve:

Public Member Functions

def __init__ (self, name)
 
def __getitem__ (self, key, refresh=True)
 
def __setitem__ (self, key, value)
 
def store (self, jar)
 
def retrieve (self, jarname, refresh=True)
 

Private Attributes

 _shelve
 

Static Private Attributes

dictionary __openShelves = {}
 

Detailed Description

representation of job databases ==========================================

Definition at line 37 of file ConfigurationShelve.py.

Constructor & Destructor Documentation

◆ __init__()

def python.ConfigurationShelve.ConfigurationShelve.__init__ (   self,
  name 
)

Definition at line 40 of file ConfigurationShelve.py.

40  def __init__( self, name ):
41  try:
42  self._shelve = self.__openShelves[ name ]
43  except KeyError:
44  self._shelve = shelve.open( name, protocol = pickle.HIGHEST_PROTOCOL )
45 

Member Function Documentation

◆ __getitem__()

def python.ConfigurationShelve.ConfigurationShelve.__getitem__ (   self,
  key,
  refresh = True 
)

Definition at line 46 of file ConfigurationShelve.py.

46  def __getitem__( self, key, refresh = True ):
47  if refresh:
48  # remove current configuration first, as much as possible, to prevent
49  # hysteresis; note that if the user keeps configurables around in the
50  # main (or any other) space, a merge will occur
51  from AthenaCommon.AlgSequence import AlgSequence
52 
53  topSeq = AlgSequence()
54  topSeq.removeAll()
55 
56  from AthenaCommon.AppMgr import theApp, ServiceMgr, ToolSvc, theAuditorSvc
57 
58  theApp._streams.removeAll()
59  ServiceMgr.removeAll()
60  ToolSvc.removeAll()
61  theAuditorSvc.removeAll()
62 
63  del topSeq, theApp, ServiceMgr, ToolSvc, theAuditorSvc
64 
65  return self._shelve[ key ]
66 

◆ __setitem__()

def python.ConfigurationShelve.ConfigurationShelve.__setitem__ (   self,
  key,
  value 
)

Definition at line 67 of file ConfigurationShelve.py.

67  def __setitem__( self, key, value ):
68  self._shelve[ key ] = value
69 

◆ retrieve()

def python.ConfigurationShelve.ConfigurationShelve.retrieve (   self,
  jarname,
  refresh = True 
)

Definition at line 73 of file ConfigurationShelve.py.

73  def retrieve( self, jarname, refresh = True ):
74  return self.__getitem__( jarname, refresh )
75 
76 

◆ store()

def python.ConfigurationShelve.ConfigurationShelve.store (   self,
  jar 
)

Definition at line 70 of file ConfigurationShelve.py.

70  def store( self, jar ):
71  return self.__setitem__( jar.getName(), jar )
72 

Member Data Documentation

◆ __openShelves

dictionary python.ConfigurationShelve.ConfigurationShelve.__openShelves = {}
staticprivate

Definition at line 38 of file ConfigurationShelve.py.

◆ _shelve

python.ConfigurationShelve.ConfigurationShelve._shelve
private

Definition at line 42 of file ConfigurationShelve.py.


The documentation for this class was generated from the following file:
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
store
StoreGateSvc * store
Definition: fbtTestBasics.cxx:71
python.AlgSequence.AlgSequence
AlgSequence
Definition: PhysicsAnalysis/D3PDTools/AnaAlgorithm/python/AlgSequence.py:7
python.processes.powheg.ZZ.ZZ.__init__
def __init__(self, base_directory, **kwargs)
Constructor: all process options are set here.
Definition: ZZ.py:18
python.Bindings.__setitem__
__setitem__
Definition: Control/AthenaPython/python/Bindings.py:771
python.Bindings.__getitem__
__getitem__
Definition: Control/AthenaPython/python/Bindings.py:779