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

Constructor & Destructor Documentation

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

Definition at line 162 of file GaudiTest.py.

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

Definition at line 173 of file GaudiTest.py.

174  def __del__(self):
175  if self._origdir:
176  os.chdir(self._origdir)
177  if self.name and not self._keep:
178  shutil.rmtree(self.name)

Member Function Documentation

def GaudiTest.TempDir.__getattr__ (   self,
  attr 
)

Definition at line 179 of file GaudiTest.py.

180  def __getattr__(self,attr):
181  return getattr(self.name,attr)
def GaudiTest.TempDir.__str__ (   self)

Definition at line 170 of file GaudiTest.py.

171  def __str__(self):
172  return self.name

Member Data Documentation

GaudiTest.TempDir._keep
private

Definition at line 164 of file GaudiTest.py.

GaudiTest.TempDir._origdir
private

Definition at line 165 of file GaudiTest.py.

GaudiTest.TempDir.name

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