| The Gaudi Framework v28r2-patches (bc4ad17a)

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

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

Public Member Functions | Public Attributes | Private Attributes | List of all members
GaudiTest.TempFile Class Reference

## Public Member Functions
def | __init__ (self, suffix='', prefix='tmp', dir=None, text=False, keep=False)
def | __str__ (self)
def | __del__ (self)
def | __getattr__ (self, attr)

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

## Constructor & Destructor Documentation

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

Definition at line 214 of file GaudiTest.py.

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

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

Definition at line 225 of file GaudiTest.py.

225 def __del__(self):
226 if self.file:
227 self.file.close()
228 if self.name and not self._keep:
229 os.remove(self.name)
230
GaudiTest.TempFile.file
file
Definition: GaudiTest.py:215
GaudiTest.TempFile.name
name
Definition: GaudiTest.py:216
GaudiTest.TempFile._keep
_keep
Definition: GaudiTest.py:217
GaudiTest.TempFile.__del__
def __del__(self)
Definition: GaudiTest.py:225

## Member Function Documentation

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

Definition at line 231 of file GaudiTest.py.

231 def __getattr__(self,attr):
232 return getattr(self.file,attr)
233
GaudiTest.TempFile.file
file
Definition: GaudiTest.py:215
GaudiTest.TempFile.__getattr__
def __getattr__(self, attr)
Definition: GaudiTest.py:231

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

Definition at line 222 of file GaudiTest.py.

222 def __str__(self):
223 return self.name
224
GaudiTest.TempFile.name
name
Definition: GaudiTest.py:216
GaudiTest.TempFile.__str__
def __str__(self)
Definition: GaudiTest.py:222

## Member Data Documentation

GaudiTest.TempFile._keep
| private

Definition at line 217 of file GaudiTest.py.

GaudiTest.TempFile.file

Definition at line 215 of file GaudiTest.py.

GaudiTest.TempFile.name

Definition at line 216 of file GaudiTest.py.

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

- GaudiPolicy/qmtest_classes/GaudiTest.py