|
The representation of an active diversion. Diversions act as
(writable) file objects, and then can be recalled either as pure
strings or (readable) file objects.
|
Methods
|
|
__init__
asFile
asString
close
flush
preferFile
spool
write
writelines
|
|
|
__init__
|
__init__ ( self )
|
|
|
asFile
|
asFile ( self )
Return the diversion as a file.
|
|
|
asString
|
asString ( self )
Return the diversion as a string.
|
|
|
close
|
close ( self )
|
|
|
flush
|
flush ( self )
|
|
|
preferFile
|
preferFile ( self )
Would this particular diversion prefer to be treated as a
file (true) or a string (false)? This allows future
optimization of diversions into streams if they get overly
large.
|
|
|
spool
|
spool (
self,
output,
chunkSize=Configuration.defaultChunkSize,
)
Spool the diversion to the given output file.
|
|
|
write
|
write ( self, data )
|
|
|
writelines
|
writelines ( self, lines )
|
|