All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Public Attributes | Private Attributes | List of all members
galleryUtils.TemporaryFile Class Reference

Public Member Functions

def __init__
 
def __del__
 
def file_
 
def __str__
 

Public Attributes

 name
 

Private Attributes

 _file
 

Detailed Description

Definition at line 308 of file sbndcode/sbndcode/gallery/python/galleryUtils.py.

Constructor & Destructor Documentation

def galleryUtils.TemporaryFile.__init__ (   self,
  data = None 
)

Definition at line 309 of file sbndcode/sbndcode/gallery/python/galleryUtils.py.

310  def __init__(self, data = None):
311  with warnings.catch_warnings():
312  # os.tempnam() is a potential security risk: ACK
313  warnings.filterwarnings("ignore", ".*tempnam .*", RuntimeWarning)
314  self._file = open(str(uuid.uuid4()), "w+")
315  self.name = self._file.name
316  if data is not None:
317  self._file.write(str(data))
318  self._file.flush() # we are not going to close this file...
#
open(RACETRACK) or die("Could not open file $RACETRACK for writing")
def galleryUtils.TemporaryFile.__del__ (   self)

Definition at line 320 of file sbndcode/sbndcode/gallery/python/galleryUtils.py.

321  def __del__(self):
322  if not self._file: return
323  del self._file
os.remove(self.name)

Member Function Documentation

def galleryUtils.TemporaryFile.__str__ (   self)

Definition at line 326 of file sbndcode/sbndcode/gallery/python/galleryUtils.py.

327  def __str__(self): return self.name
328 # class TemporaryFile
329 
def galleryUtils.TemporaryFile.file_ (   self)

Definition at line 325 of file sbndcode/sbndcode/gallery/python/galleryUtils.py.

def file_(self): return self._file

Member Data Documentation

galleryUtils.TemporaryFile._file
private

Definition at line 313 of file sbndcode/sbndcode/gallery/python/galleryUtils.py.

galleryUtils.TemporaryFile.name

Definition at line 314 of file sbndcode/sbndcode/gallery/python/galleryUtils.py.


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