Biskit :: ExeConfigCache :: ExeConfigCache :: Class ExeConfigCache
[hide private]
[frames] | no frames]

Class ExeConfigCache

source code

Keep track of previously loaded ExeConfig instances in order to avoid the multiple parsing of one and the same config file. The class contains only static methods -- it is not necessary to create an instance of it.

Usage:
>>> my_config = ExeConfigCache.get( 'my_program' )
Should be thread-save, i.e. multiple threads can simultaniously access the cache (not tested).

Static Methods [hide private]
ExeConfig get(name, reload=0, **kw)
Get the ExeConfig instance for the given program.
  reset()
Empty the cache.
int len()
Number of entries in the cache.

Class Variables [hide private]
  LOCK = threading.Lock()
  CACHE = {}

Method Details [hide private]

get(name, reload=0, **kw)
Static Method

source code 

Get the ExeConfig instance for the given program.
Parameters:
  • name (str) - program name
  • reload (0|1) - force new instance (re-read configuration file) (default: 0)
  • kw (key=value) - options for Biskit.ExeConfig() ; no effect for cached entries unless reload=1
Returns: ExeConfig
ExeConfig object
Decorators:

reset()
Static Method

source code 

Empty the cache.
Decorators:

len()
Static Method

source code 

Number of entries in the cache.
Returns: int
length of cache
Decorators:

Class Variable Details [hide private]

LOCK

Value:
threading.Lock()                                                       
      

CACHE

Value:
{}