C++QED  v2 Milestone 10
a framework for simulating open quantum dynamics
OptionsManager Class Reference

Stores command line options and configuration file keys. More...

+ Inheritance diagram for OptionsManager:
+ Collaboration diagram for OptionsManager:

Public Member Functions

def __init__ (self, options, cp)
 
def get_option (self, name, default=None, required=False, section=None)
 Get configuration file keys in a safe way. More...
 

Public Attributes

 options
 optparse.Values: command line options
 
 cp
 ConfigParser: configuration file keys.
 
 test
 The name of the current test.
 

Detailed Description

Stores command line options and configuration file keys.

Each OptionsManager instance has its own section in the configuration file, named after the current test name (OptionsManager::test). If the current section has the key import=othersection, import all keys from othersection if they are not present already (works recursively). Values which end in _local are never imported.

Command line options this class understands.

Definition at line 100 of file testdriver.py.

Constructor & Destructor Documentation

def __init__ (   self,
  options,
  cp 
)
Parameters
optionsoptparse.Values: object holding all the command line options.
cpConfigParser: ConfigParser instance holding all configuration file keys.

Definition at line 120 of file testdriver.py.

Member Function Documentation

def get_option (   self,
  name,
  default = None,
  required = False,
  section = None 
)

Get configuration file keys in a safe way.

Parameters
nameName of the key.
defaultDefault value to return if key does not exist.
requiredFail if True and key does not exist.
sectionThe section name to look in, defaults to OptionsManager::test if None.
Returns
The value to the key.

This methods looks up the key name in the section name OptionsManager::test.

Definition at line 144 of file testdriver.py.


The documentation for this class was generated from the following file: