Vega strike Python Modules doc  0.5.1
Documentation of the " Modules " folder of Vega strike
 All Data Structures Namespaces Files Functions Variables
TemporaryFileWrapper Class Reference

Public Member Functions

def __init__
 
def close
 
def __del__
 
def __getattr__
 

Data Fields

 file
 
 path
 
 close_called
 

Static Public Attributes

 unlink = os.unlink
 

Detailed Description

Temporary file wrapper

This class provides a wrapper around files opened for temporary use.
In particular, it seeks to automatically remove the file when it is
no longer needed.

Definition at line 148 of file tempfile.py.

Constructor & Destructor Documentation

def __init__ (   self,
  file,
  path 
)

Definition at line 162 of file tempfile.py.

163  def __init__(self, file, path):
164  self.file = file
165  self.path = path
166  self.close_called = 0
def __del__ (   self)

Member Function Documentation

def __getattr__ (   self,
  name 
)

Definition at line 176 of file tempfile.py.

177  def __getattr__(self, name):
178  file = self.__dict__['file']
179  a = getattr(file, name)
180  if type(a) != type(0):
181  setattr(self, name, a)
182  return a
183 
def close (   self)

Definition at line 167 of file tempfile.py.

References TemporaryFileWrapper.close_called, RobotFileParser.path, MH.path, RuleLine.path, TemporaryFileWrapper.path, and TemporaryFileWrapper.unlink.

168  def close(self):
169  if not self.close_called:
170  self.close_called = 1
171  self.file.close()
172  self.unlink(self.path)

Field Documentation

close_called

Definition at line 165 of file tempfile.py.

file

Definition at line 163 of file tempfile.py.

path

Definition at line 164 of file tempfile.py.

unlink = os.unlink
static

Definition at line 160 of file tempfile.py.


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