Gaudi Framework, version v23r9

Home   Generated: Thu Jul 18 2013
 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 182 of file GaudiTest.py.

Constructor & Destructor Documentation

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

Definition at line 189 of file GaudiTest.py.

190  def __init__(self, suffix='', prefix='tmp', dir=None, text=False, keep = False):
191  self.file = None
192  self.name = None
193  self._keep = keep
194 
195  self._fd, self.name = tempfile.mkstemp(suffix,prefix,dir,text)
196  self.file = os.fdopen(self._fd,"r+")
def GaudiTest.TempFile.__del__ (   self)

Definition at line 200 of file GaudiTest.py.

201  def __del__(self):
202  if self.file:
203  self.file.close()
204  if self.name and not self._keep:
205  os.remove(self.name)

Member Function Documentation

def GaudiTest.TempFile.__getattr__ (   self,
  attr 
)

Definition at line 206 of file GaudiTest.py.

207  def __getattr__(self,attr):
208  return getattr(self.file,attr)
def GaudiTest.TempFile.__str__ (   self)

Definition at line 197 of file GaudiTest.py.

198  def __str__(self):
199  return self.name

Member Data Documentation

GaudiTest.TempFile._keep
private

Definition at line 192 of file GaudiTest.py.

GaudiTest.TempFile.file

Definition at line 190 of file GaudiTest.py.

GaudiTest.TempFile.name

Definition at line 191 of file GaudiTest.py.


The documentation for this class was generated from the following file:
Generated at Thu Jul 18 2013 12:18:15 for Gaudi Framework, version v23r9 by Doxygen version 1.8.2 written by Dimitri van Heesch, © 1997-2004