Package duplicity :: Module dup_temp :: Class FileobjHooked
[hide private]
[frames] | no frames]

Class FileobjHooked

source code

Simulate a file, but add hook on close

Instance Methods [hide private]
 
__init__(self, fileobj, tdp=None, dirpath=None, partname=None, permname=None, remname=None)
Initializer.
source code
 
write(self, buf)
Write fileobj, return result of write()
source code
 
flush(self)
Flush fileobj and force sync.
source code
 
to_partial(self)
We have achieved the first checkpoint, make file visible and permanent.
source code
 
to_remote(self)
We have written the last checkpoint, now encrypt or compress and send a copy of it to the remote for final storage.
source code
 
to_final(self)
We are finished, rename to final, gzip if needed.
source code
 
read(self, length=-1)
Read fileobj, return result of read()
source code
 
tell(self)
Returns current location of fileobj
source code
 
seek(self, offset)
Seeks to a location of fileobj
source code
 
close(self)
Close fileobj, running hooks right afterwards
source code
 
addhook(self, hook)
Add hook (function taking no arguments) to run upon closing
source code
 
get_name(self)
Return the name of the file
source code
 
name(self)
Return the name of the file
source code
Method Details [hide private]

__init__(self, fileobj, tdp=None, dirpath=None, partname=None, permname=None, remname=None)
(Constructor)

source code 

Initializer. fileobj is the file object to simulate