| # Gaudi Framework, version v21r6 |

Home |  | Generated: 11 Nov 2009

# GaudiTest::TempDir Class Reference

List of all members.

## 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 156 of file GaudiTest.py.

## Public Member Functions
def | __init__
def | __str__
def | __del__
def | __getattr__
## Public Attributes
| name
## Private Attributes
| _keep
| _origdir

## Member Function Documentation

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

Definition at line 163 of file GaudiTest.py.

    00163                                                    :
    00164         self.name = tempfile.mkdtemp()
    00165         self._keep = keep
    00166         self._origdir = None
    00167         if chdir:
    00168             self._origdir = os.getcwd()
    00169             os.chdir(self.name)
    00170
        def __str__(self):

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

Definition at line 171 of file GaudiTest.py.

    00171                      :
    00172         return self.name
    00173
        def __del__(self):

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

Definition at line 174 of file GaudiTest.py.

    00174                      :
    00175         if self._origdir:
    00176             os.chdir(self._origdir)
    00177         if self.name and not self._keep:
    00178             shutil.rmtree(self.name)
    00179
        def __getattr__(self,attr):

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

Definition at line 180 of file GaudiTest.py.

    00180                               :
    00181         return getattr(self.name,attr)
    00182
    class TempFile:

## Member Data Documentation

GaudiTest::TempDir::name

Definition at line 164 of file GaudiTest.py.

GaudiTest::TempDir::_keep`[private]`

Definition at line 165 of file GaudiTest.py.

GaudiTest::TempDir::_origdir`[private]`

Definition at line 166 of file GaudiTest.py.

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

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