Gaudi Framework, version v24r2

Home   Generated: Wed Dec 4 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.TempDir Class Reference

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

Constructor & Destructor Documentation

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

Definition at line 165 of file GaudiTest.py.

166  def __init__(self, keep = False, chdir = False):
167  self.name = tempfile.mkdtemp()
168  self._keep = keep
169  self._origdir = None
170  if chdir:
171  self._origdir = os.getcwd()
172  os.chdir(self.name)
def GaudiTest.TempDir.__del__ (   self)

Definition at line 176 of file GaudiTest.py.

177  def __del__(self):
178  if self._origdir:
179  os.chdir(self._origdir)
180  if self.name and not self._keep:
181  shutil.rmtree(self.name)

Member Function Documentation

def GaudiTest.TempDir.__getattr__ (   self,
  attr 
)

Definition at line 182 of file GaudiTest.py.

183  def __getattr__(self,attr):
184  return getattr(self.name,attr)
def GaudiTest.TempDir.__str__ (   self)

Definition at line 173 of file GaudiTest.py.

174  def __str__(self):
175  return self.name

Member Data Documentation

GaudiTest.TempDir._keep
private

Definition at line 167 of file GaudiTest.py.

GaudiTest.TempDir._origdir
private

Definition at line 168 of file GaudiTest.py.

GaudiTest.TempDir.name

Definition at line 166 of file GaudiTest.py.


The documentation for this class was generated from the following file:
Generated at Wed Dec 4 2013 14:33:23 for Gaudi Framework, version v24r2 by Doxygen version 1.8.2 written by Dimitri van Heesch, © 1997-2004