Gaudi Framework, version v20r4

Generated: 8 Jan 2009

GaudiTest::TempDir Class Reference

List of all members.


Detailed Description

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


Public Member Functions

def __init__
def __str__
def __del__
def __getattr__

Public Attributes

 name

Private Attributes

 _keep
 _origdir

Member Function Documentation

def GaudiTest::TempDir::__init__ (   self,
  keep = False,
  chdir = False 
)

Definition at line 161 of file GaudiTest.py.

00161                                                    :
00162         self.name = tempfile.mkdtemp()
00163         self._keep = keep
00164         self._origdir = None
00165         if chdir:
00166             self._origdir = os.getcwd()
00167             os.chdir(self.name)
00168         
    def __str__(self):

def GaudiTest::TempDir::__str__ (   self  ) 

Definition at line 169 of file GaudiTest.py.

00169                      :
00170         return self.name
00171     
    def __del__(self):

def GaudiTest::TempDir::__del__ (   self  ) 

Definition at line 172 of file GaudiTest.py.

00172                      :
00173         if self._origdir:
00174             os.chdir(self._origdir)
00175         if self.name and not self._keep:
00176             shutil.rmtree(self.name)
00177     
    def __getattr__(self,attr):

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

Definition at line 178 of file GaudiTest.py.

00178                               :
00179         return getattr(self.name,attr)
00180 
class TempFile:


Member Data Documentation

Definition at line 162 of file GaudiTest.py.

Definition at line 163 of file GaudiTest.py.

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