Gaudi Framework, version v20r4

Generated: 8 Jan 2009

GaudiTest::TempFile Class Reference

List of all members.


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


Public Member Functions

def __init__
def __str__
def __del__
def __getattr__

Public Attributes

 file
 name

Private Attributes

 _keep

Member Function Documentation

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

Definition at line 188 of file GaudiTest.py.

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

def GaudiTest::TempFile::__str__ (   self  ) 

Definition at line 196 of file GaudiTest.py.

00196                      :
00197         return self.name
00198     
    def __del__(self):

def GaudiTest::TempFile::__del__ (   self  ) 

Definition at line 199 of file GaudiTest.py.

00199                      :
00200         if self.file:
00201             self.file.close()
00202         if self.name and not self._keep:
00203             os.remove(self.name)
00204     
    def __getattr__(self,attr):

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

Definition at line 205 of file GaudiTest.py.

00205                               :
00206         return getattr(self.file,attr)
00207 
class CMT:


Member Data Documentation

Definition at line 189 of file GaudiTest.py.

Definition at line 190 of file GaudiTest.py.

Definition at line 191 of file GaudiTest.py.


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

Generated at Thu Jan 8 17:53:59 2009 for Gaudi Framework, version v20r4 by Doxygen version 1.5.6 written by Dimitri van Heesch, © 1997-2004