| # Gaudi Framework, version v21r10p1 |

Home |  | Generated: 29 Jul 2010

# GaudiTest::TempFile Class Reference

List of all members.

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

## Detailed Description

    Small class for temporary files.
    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 184 of file GaudiTest.py.

## Member Function Documentation

def GaudiTest::TempFile::__init__ | ( |  | self,
|  |  | suffix = `''`,
|  |  | prefix = `'tmp'`,
|  |  | dir = `None`,
|  |  | text = `False`,
|  |  | keep = `False` |
| ) |  |  |

Definition at line 191 of file GaudiTest.py.

    00191                                                                                    :
    00192         self.file = None
    00193         self.name = None
    00194         self._keep = keep
    00195
    00196         self._fd, self.name = tempfile.mkstemp(suffix,prefix,dir,text)
    00197         self.file = os.fdopen(self._fd,"r+")
    00198
        def __str__(self):

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

Definition at line 199 of file GaudiTest.py.

    00199                      :
    00200         return self.name
    00201
        def __del__(self):

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

Definition at line 202 of file GaudiTest.py.

    00202                      :
    00203         if self.file:
    00204             self.file.close()
    00205         if self.name and not self._keep:
    00206             os.remove(self.name)
    00207
        def __getattr__(self,attr):

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

Definition at line 208 of file GaudiTest.py.

    00208                               :
    00209         return getattr(self.file,attr)
    00210
    class CMT:

## Member Data Documentation

GaudiTest::TempFile::file

Definition at line 192 of file GaudiTest.py.

GaudiTest::TempFile::name

Definition at line 193 of file GaudiTest.py.

GaudiTest::TempFile::_keep`[private]`

Definition at line 194 of file GaudiTest.py.

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

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