HWRF  trunk@4391
Public Member Functions | List of all members
hwrf.config.Environment Class Reference

returns environment variables, allowing substitutions More...

Detailed Description

returns environment variables, allowing substitutions

This class is used to read (but not write) environment variables and provide default values if an environment variable is unset or blank. It is only meant to be used in string formats, by passing ENV=ENVIRONMENT. There is a global constant in this module, ENVIRONMENT, which is an instance of this class. You should never need to instantiate another one.

Definition at line 33 of file config.py.

Inheritance diagram for hwrf.config.Environment:

Public Member Functions

def __contains__ (self, s)
 Determines if getitem will return something (True) or raise KeyError (False). More...
 
def __getitem__ (self, s)
 Same as os.environ[s] unless s contains "|-". More...
 

Member Function Documentation

def hwrf.config.Environment.__contains__ (   self,
  s 
)

Determines if getitem will return something (True) or raise KeyError (False).

Same as "s in os.environ" unless s contains "|-", in which case, the result is True.

Definition at line 42 of file config.py.

def hwrf.config.Environment.__getitem__ (   self,
  s 
)

Same as os.environ[s] unless s contains "|-".

ENVIRONMENT["VARNAME|-substitute"] will return os.environ[VARNAME] if VARNAME is defined and non-empty in os.environ. Otherwise, it will return "substitute".

Definition at line 47 of file config.py.


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