Package svnmailer :: Module stream :: Class SplittingStream

[hide private]

# Class SplittingStream

source code

     object --+
              |
    _BaseStream --+
                  |
                 SplittingStream

Stream wrapper, which provides the ability to split the stream

Instance Methods | [hide private]

__init__(self, tempdir=None) Initialization | source code

write(self, towrite) Writes to the current stream and counts the number of bytes | source code

split(self) Splits the stream | source code

close(self) Closes the stream and removes all tempfiles | source code

`int`

getPartCount(self) Returns the number of splitted parts | source code

`str`

getPart(self, idx) Returns the value of part `idx` | source code

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

Instance Variables | [hide private]

`int` | current The current byte counter
Inherited from `_BaseStream`: `stream`

Properties | [hide private]

Inherited from `object`: `__class__`

Method Details | [hide private]

### __init__(self, tempdir=None)
(Constructor)

source code

Initialization

Parameters:
  - `tempdir` (`str`) - specific temporary directory
Overrides: object.__init__

### write(self, towrite)

source code

Writes to the current stream and counts the number of bytes

Parameters:
  - `towrite` - stuff to write
Overrides: _BaseStream.write

### split(self)

source code

Splits the stream

This dumps the current content into a tempfile clears the old stream.

### close(self)

source code

Closes the stream and removes all tempfiles

Overrides: _BaseStream.close

### getPartCount(self)

source code

Returns the number of splitted parts

Returns: `int`
  The number

### getPart(self, idx)

source code

Returns the value of part `idx`

Parameters:
  - `idx` (`int`) - The part number
Returns: `str`
  The content of the particular part