| # Gaudi Framework, version v25r0 |

Home |  | Generated: Mon Feb 17 2014

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Member Functions | Public Attributes | Private Attributes | List of all members
GaudiTest.TempDir Class Reference

## Public Member Functions
def | __init__
def | __str__
def | __del__
def | __getattr__

## Public Attributes
| name

## Private Attributes
| _keep
| _origdir

## Detailed Description

    Small class for temporary directories.
    When instantiated, it creates a temporary directory and the instance
    behaves as the string containing the directory name.
    When the instance goes out of scope, it removes all the content of
    the temporary directory (automatic clean-up).

Definition at line 178 of file GaudiTest.py.

## Constructor & Destructor Documentation

def GaudiTest.TempDir.__init__ | ( |  | self,
|  |  | keep = `False`,
|  |  | chdir = `False`
| ) |  |

Definition at line 185 of file GaudiTest.py.

185
186 def __init__(self, keep = False, chdir = False):
187 self.name = tempfile.mkdtemp()
188 self._keep = keep
189 self._origdir = None
190 if chdir:
191 self._origdir = os.getcwd()
192 os.chdir(self.name)

def GaudiTest.TempDir.__del__ | ( |  | self | ) |

Definition at line 196 of file GaudiTest.py.

196
197 def __del__(self):
198 if self._origdir:
199 os.chdir(self._origdir)
200 if self.name and not self._keep:
201 shutil.rmtree(self.name)

## Member Function Documentation

def GaudiTest.TempDir.__getattr__ | ( |  | self,
|  |  | attr
| ) |  |

Definition at line 202 of file GaudiTest.py.

202
203 def __getattr__(self,attr):
204 return getattr(self.name,attr)

def GaudiTest.TempDir.__str__ | ( |  | self | ) |

Definition at line 193 of file GaudiTest.py.

193
194 def __str__(self):
195 return self.name

## Member Data Documentation

GaudiTest.TempDir._keep
| private

Definition at line 187 of file GaudiTest.py.

GaudiTest.TempDir._origdir
| private

Definition at line 188 of file GaudiTest.py.

GaudiTest.TempDir.name

Definition at line 186 of file GaudiTest.py.

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

- /afs/cern.ch/sw/Gaudi/releases/GAUDI/GAUDI_v25r0/GaudiPolicy/qmtest_classes/GaudiTest.py