Package svnmailer :: Module stream :: Class TruncatingStream
[show private | hide private]
[frames | no frames]

Class TruncatingStream

 object --+    
          |    
_BaseStream --+
              |
             TruncatingStream

Known Subclasses:
TruncatingFileStream

stream wrapper, which truncates after a limit
Method Summary
  __init__(self, stream, maxsize, add_note)
Initialization
int getTruncatedLineCount(self)
Returns the number of truncated lines
  getvalue(self)
Returns the content
  seek(self, position, mode)
Sets the file position
  write(self, towrite)
Writes a string up to the limit
  writeWithoutTruncation(self, towrite)
Writes without truncation
    Inherited from _BaseStream
  __getattr__(self, name)
Delegates all undefined attributes to the stream
  close(self)
Closes the stream
  writelines(self, lines)
Write a list of strings
    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
int current: The number of bytes received
str lastchar: The last character written
int maxsize: The maximum size in bytes
int trunced: The number of lines truncated (maybe actual-1)
    Inherited from _BaseStream
file stream: The wrapped stream

Method Details

__init__(self, stream, maxsize, add_note=False)
(Constructor)

Initialization
Parameters:
stream - The stream to wrap
           (type=file)
maxsize - The maximum size in bytes
           (type=int)
Overrides:
svnmailer.stream._BaseStream.__init__

getTruncatedLineCount(self)

Returns the number of truncated lines
Returns:
The line count
           (type=int)

getvalue(self)

Returns the content

seek(self, position, mode=0)

Sets the file position

write(self, towrite)

Writes a string up to the limit
Overrides:
svnmailer.stream._BaseStream.write

writeWithoutTruncation(self, towrite)

Writes without truncation
Parameters:
towrite - The data to write
           (type=str)

Instance Variable Details

current

The number of bytes received
Type:
int

lastchar

The last character written
Type:
str

maxsize

The maximum size in bytes
Type:
int

trunced

The number of lines truncated (maybe actual-1)
Type:
int

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