![]() |
The Gaudi Framework
v29r3 (fa547fc2)
|
Utility Classes. More...
Public Member Functions | |
| def | __init__ (self, orig=os.environ, keep_same=False) |
| def | __setitem__ (self, key, value) |
| def | __getitem__ (self, key) |
| def | __delitem__ (self, key) |
| def | keys (self) |
| def | items (self) |
| def | __contains__ (self, key) |
| def | restore (self) |
| def | __del__ (self) |
| def | gen_script (self, shell_type) |
Public Attributes | |
| old_values | |
| env | |
Private Attributes | |
| _keep_same | |
Utility Classes.
Class to changes the environment temporarily.
Definition at line 75 of file GaudiTest.py.
| def GaudiTest.TemporaryEnvironment.__init__ | ( | self, | |
orig = os.environ, |
|||
keep_same = False |
|||
| ) |
Create a temporary environment on top of the one specified (it can be another TemporaryEnvironment instance).
Definition at line 80 of file GaudiTest.py.
| def GaudiTest.TemporaryEnvironment.__del__ | ( | self | ) |
| def GaudiTest.TemporaryEnvironment.__contains__ | ( | self, | |
| key | |||
| ) |
Operator 'in'. Needed to provide the same interface as os.environ.
Definition at line 133 of file GaudiTest.py.
| def GaudiTest.TemporaryEnvironment.__delitem__ | ( | self, | |
| key | |||
| ) |
Unset an environment variable. Needed to provide the same interface as os.environ.
Definition at line 109 of file GaudiTest.py.
| def GaudiTest.TemporaryEnvironment.__getitem__ | ( | self, | |
| key | |||
| ) |
Get an environment variable. Needed to provide the same interface as os.environ.
Definition at line 102 of file GaudiTest.py.
| def GaudiTest.TemporaryEnvironment.__setitem__ | ( | self, | |
| key, | |||
| value | |||
| ) |
Set an environment variable recording the previous value.
Definition at line 90 of file GaudiTest.py.
| def GaudiTest.TemporaryEnvironment.gen_script | ( | self, | |
| shell_type | |||
| ) |
Generate a shell script to reproduce the changes in the environment.
Definition at line 158 of file GaudiTest.py.
| def GaudiTest.TemporaryEnvironment.items | ( | self | ) |
Return the list of (name,value) pairs for the defined environment variables. Needed to provide the same interface as os.environ.
Definition at line 126 of file GaudiTest.py.
| def GaudiTest.TemporaryEnvironment.keys | ( | self | ) |
Return the list of defined environment variables. Needed to provide the same interface as os.environ.
Definition at line 119 of file GaudiTest.py.
| def GaudiTest.TemporaryEnvironment.restore | ( | self | ) |
Revert all the changes done to the original environment.
Definition at line 140 of file GaudiTest.py.
|
private |
Definition at line 88 of file GaudiTest.py.
| GaudiTest.TemporaryEnvironment.env |
Definition at line 87 of file GaudiTest.py.
| GaudiTest.TemporaryEnvironment.old_values |
Definition at line 86 of file GaudiTest.py.