Gaudi Framework, version v21r9

Home   Generated: 3 May 2010

GaudiTest::TempDir Class Reference

List of all members.

Public Member Functions

def __init__
def __str__
def __del__
def __getattr__

Public Attributes

 name

Private Attributes

 _keep
 _origdir


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


Member Function Documentation

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

Definition at line 164 of file GaudiTest.py.

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

def GaudiTest::TempDir::__str__ (   self  ) 

Definition at line 172 of file GaudiTest.py.

00172                      :
00173         return self.name
00174     
    def __del__(self):

def GaudiTest::TempDir::__del__ (   self  ) 

Definition at line 175 of file GaudiTest.py.

00175                      :
00176         if self._origdir:
00177             os.chdir(self._origdir)
00178         if self.name and not self._keep:
00179             shutil.rmtree(self.name)
00180     
    def __getattr__(self,attr):

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

Definition at line 181 of file GaudiTest.py.

00181                               :
00182         return getattr(self.name,attr)
00183 
class TempFile:


Member Data Documentation

Definition at line 165 of file GaudiTest.py.

Definition at line 166 of file GaudiTest.py.

Definition at line 167 of file GaudiTest.py.


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

Generated at Mon May 3 12:29:04 2010 for Gaudi Framework, version v21r9 by Doxygen version 1.5.6 written by Dimitri van Heesch, © 1997-2004