Home | Trees | Indices | Help |
---|
|
object --+ | BufferQueue
BufferQueue([delimiter])
Initialize a new buffer. If the delimiter is provided, it can be used to pop lines off instead of just bytes.
Iterating over a BufferQueue is the same as repeatedly calling .popline() on it, except that the delimiter is included in the string yielded. An empty BufferQueue evaluates to boolean false.
Instance Methods | |||
|
|||
|
|||
|
|||
a new object with type S, a subtype of T |
|
||
|
|||
|
|||
None |
|
||
the next value, or raise StopIteration |
|
||
str |
|
||
str |
|
||
tuple |
|
||
buffer |
|
||
str |
|
||
list |
|
||
None |
|
||
None |
|
||
Inherited from |
Properties | |
delimiter delimiter string |
|
Inherited from |
Method Details |
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
|
|
repr(x)
|
str(x)
|
Pop some bytes out of the buffer. If no argument is provided, pop the entire buffer out. Raises a BufferUnderflow exception if the buffer would underflow.
|
Pop at most some number of bytes from the buffer. The returned string will have a length anywhere between 0 and the length provided.
|
Pop some bytes from the buffer and unpack them using the 'struct' module, returning the resulting tuple. The format string passed is the same as the 'struct' module format.
|
Pop some bytes from the buffer and return it as a python 'buffer' object. If possible, no new strings will be constructed and the buffer returned will just be a view of one of the strings pushed into the buffer.
|
Pop one line of data from the buffer. This scans the buffer for the next occurrence of the provided delimiter, or the buffer's delimiter if none was provided, and then returns everything up to and including the delimiter. If the delimiter was not found or there was no delimiter set, a ValueError is raised. The delimiter is not included in the string returned.
|
Pop as many lines off of the buffer as is possible. This will collect and return a list of all of the lines that were in the buffer. If there was no delimiter set and no delimiter was provided, a ValueError is raised. The delimiter is not included in the strings returned.
|
Home | Trees | Indices | Help |
---|
Generated by Epydoc 3.0.1 on Sat Aug 14 14:34:16 2010 | http://epydoc.sourceforge.net |