Package svnmailer :: Module util :: Class TempFile
[show private | hide private]
[frames | no frames]

Class TempFile

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__)


Method Summary
  __init__(self, tempdir, text)
Initialization
  __del__(self)
Unlink the file name
  close(self)
Close the file (but don't delete it)
    Inherited from object
  __delattr__(...)
x.__delattr__('name') <==> del x.name...
  __getattribute__(...)
x.__getattribute__('name') <==> x.name...
  __hash__(x)
x.__hash__() <==> hash(x)...
  __reduce__(...)
helper for pickle...
  __reduce_ex__(...)
helper for pickle...
  __repr__(x)
x.__repr__() <==> repr(x)...
  __setattr__(...)
x.__setattr__('name', value) <==> x.name = value...
  __str__(x)
x.__str__() <==> str(x)...
    Inherited from type
  __new__(T, S, ...)
T.__new__(S, ...) -> a new object with type S, a subtype of T...

Instance Variable Summary
file fp: The file descriptor
str name: The full name of the file
callable _unlink: os.unlink

Method Details

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

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

__del__(self)
(Destructor)

Unlink the file name

close(self)

Close the file (but don't delete it)
Raises:
ValueError - The file was already closed

Instance Variable Details

fp

The file descriptor
Type:
file
Value:
None                                                                  

name

The full name of the file
Type:
str
Value:
None                                                                  

_unlink

os.unlink
Type:
callable
Value:
None                                                                  

Generated by Epydoc 2.0 on Sun Sep 25 20:49:16 2005 http://epydoc.sf.net