Package svnmailer :: Module util :: Class TempFile
[hide private]

Class TempFile

source code

object --+
         |
        TempFile

Tempfile container class

The class contains a destructor that removes the created file. This differs from the stuff in tempfile, which removes the file, when it's closed.

The mode is fixed to w+; a b is added if the text argument is false (see __init__)

Instance Methods [hide private]
 
__init__(self, tempdir=None, text=False)
Initialization
source code
 
__del__(self)
Unlink the file name
source code
 
close(self)
Close the file (but don't delete it)
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
str name = None
None
file like object fp = None
None
callable _unlink = None
None
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, tempdir=None, text=False)
(Constructor)

source code 

Initialization

Parameters:
  • tempdir (str) - The temporary directory
  • text (bool) - want to write text?
Overrides: object.__init__

close(self)

source code 

Close the file (but don't delete it)

Raises:
  • ValueError - The file was already closed