| # 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.TempFile Class Reference

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

## Constructor & Destructor Documentation

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

Definition at line 212 of file GaudiTest.py.

212
213 def __init__(self, suffix='', prefix='tmp', dir=None, text=False, keep = False):
214 self.file = None
215 self.name = None
216 self._keep = keep
217
218 self._fd, self.name = tempfile.mkstemp(suffix,prefix,dir,text)
219 self.file = os.fdopen(self._fd,"r+")

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

Definition at line 223 of file GaudiTest.py.

223
224 def __del__(self):
225 if self.file:
226 self.file.close()
227 if self.name and not self._keep:
228 os.remove(self.name)

## Member Function Documentation

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

Definition at line 229 of file GaudiTest.py.

229
230 def __getattr__(self,attr):
231 return getattr(self.file,attr)

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

Definition at line 220 of file GaudiTest.py.

220
221 def __str__(self):
222 return self.name

## Member Data Documentation

GaudiTest.TempFile._keep
| private

Definition at line 215 of file GaudiTest.py.

GaudiTest.TempFile.file

Definition at line 213 of file GaudiTest.py.

GaudiTest.TempFile.name

Definition at line 214 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