| # Gaudi Framework, version v22r2 |

Home |  | Generated: Tue May 10 2011

Public Member Functions | Private Attributes

# validate_patch::TempDir Class Reference

List of all members.

## Public Member Functions
def | __init__
def | getName
def | __str__
def | __del__
## Private Attributes
| _keep_var
| _name

## Detailed Description

    Class to create a temporary directory.

Definition at line 111 of file validate_patch.py.

## Constructor & Destructor Documentation

def validate_patch::TempDir::__init__ | ( |  | self,
|  |  | suffix = `""`,
|  |  | prefix = `"tmp"`,
|  |  | dir = `None`,
|  |  | keep_var = `"KEEPTEMPDIR"`
| ) |  |

    Constructor.

    'keep_var' is used to define which environment variable will prevent the
    deletion of the directory.

    The other arguments are the same as tempfile.mkdtemp.

Definition at line 113 of file validate_patch.py.

    00114                                                                                  :
    00115         """Constructor.
    00116
    00117         'keep_var' is used to define which environment variable will prevent the
    00118         deletion of the directory.
    00119
    00120         The other arguments are the same as tempfile.mkdtemp.
    00121         """
    00122         self._keep_var = keep_var
    00123         self._name = mkdtemp(suffix, prefix, dir)

def validate_patch::TempDir::__del__ | ( |  | self ) |

    Destructor.

    Remove the temporary directory.

Definition at line 132 of file validate_patch.py.

    00133                      :
    00134         """Destructor.
    00135
    00136         Remove the temporary directory.
    00137         """
    00138         if self._name:
    00139             if self._keep_var in os.environ:
    00140                 logging.info("%s set: I do not remove the temporary directory '%s'",
    00141                              self._keep_var, self._name)
    00142                 return
    00143             rmtree(self._name)

## Member Function Documentation

def validate_patch::TempDir::__str__ | ( |  | self ) |

    Convert to string.

Definition at line 128 of file validate_patch.py.

    00129                      :
    00130         """Convert to string."""
    00131         return self.getName()

def validate_patch::TempDir::getName | ( |  | self ) |

    Returns the name of the temporary directory

Definition at line 124 of file validate_patch.py.

    00125                      :
    00126         """Returns the name of the temporary directory"""
    00127         return self._name

## Member Data Documentation

validate_patch::TempDir::_keep_var`[private]`

Definition at line 119 of file validate_patch.py.

validate_patch::TempDir::_name`[private]`

Definition at line 119 of file validate_patch.py.

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

- validate_patch.py

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines