| The Gaudi Framework v27r1

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Private Attributes | List of all members
validate_patch.TempDir Class Reference
Inheritance diagram for validate_patch.TempDir:
[legend]
Collaboration diagram for validate_patch.TempDir:
[legend]

## Public Member Functions
def | __init__
def | getName (self)
def | __str__ (self)
def | __del__ (self)

## 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.

113 def __init__(self, suffix="", prefix="tmp", dir=None, keep_var="KEEPTEMPDIR"):
114 """Constructor.
115
116 'keep_var' is used to define which environment variable will prevent the
117 deletion of the directory.
118
119 The other arguments are the same as tempfile.mkdtemp.
120 """
121 self._keep_var = keep_var
122 self._name = mkdtemp(suffix, prefix, dir)
123
validate_patch.TempDir._name
_name
Definition: validate_patch.py:122
validate_patch.TempDir._keep_var
_keep_var
Definition: validate_patch.py:121
validate_patch.TempDir.__init__
def __init__
Definition: validate_patch.py:113

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

    Destructor.

    Remove the temporary directory.

Definition at line 132 of file validate_patch.py.

132 def __del__(self):
133 """Destructor.
134
135 Remove the temporary directory.
136 """
137 if self._name:
138 if self._keep_var in os.environ:
139 logging.info("%s set: I do not remove the temporary directory '%s'",
140 self._keep_var, self._name)
141 return
142 rmtree(self._name)
143
validate_patch.TempDir._name
_name
Definition: validate_patch.py:122
validate_patch.TempDir.__del__
def __del__(self)
Definition: validate_patch.py:132
validate_patch.TempDir._keep_var
_keep_var
Definition: validate_patch.py:121

## Member Function Documentation

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

    Convert to string.

Definition at line 128 of file validate_patch.py.

128 def __str__(self):
129 """Convert to string."""
130 return self.getName()
131
validate_patch.TempDir.__str__
def __str__(self)
Definition: validate_patch.py:128
validate_patch.TempDir.getName
def getName(self)
Definition: validate_patch.py:124

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

    Returns the name of the temporary directory

Definition at line 124 of file validate_patch.py.

124 def getName(self):
125 """Returns the name of the temporary directory"""
126 return self._name
127
validate_patch.TempDir._name
_name
Definition: validate_patch.py:122
validate_patch.TempDir.getName
def getName(self)
Definition: validate_patch.py:124

## Member Data Documentation

validate_patch.TempDir._keep_var
| private

Definition at line 121 of file validate_patch.py.

validate_patch.TempDir._name
| private

Definition at line 122 of file validate_patch.py.

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

- GaudiRelease/cmt/validate_patch.py