Package pype32 :: Module utils |
[hide private]
[frames] | no frames]

# Module utils

source code

Auxiliary classes and functions.

Classes | [hide private]
Read/Write data stream objects
| WriteData Return a WriteData-like stream object for writing.
| ReadData Returns a ReadData-like stream object.

Functions | [hide private]
bool |
powerOfTwo(value) Tries to determine if a given value is a power of two. | source code
bool |
allZero(buffer) Tries to determine if a buffer is empty. | source code

Variables | [hide private]
| __revision__ = ``'``$Id$``'``
| __package__ = ``'``pype32``'``

Function Details | [hide private]

### powerOfTwo(value) | source code
Tries to determine if a given value is a power of two. Parameters: `value` (int) - Value to test if it is power of two. Returns: bool `True` if the value is power of two, `False` if it doesn't.

### allZero(buffer) | source code
Tries to determine if a buffer is empty. Parameters: `buffer` (str) - Buffer to test if it is empty. Returns: bool `True` if the given buffer is empty, i.e. full of zeros, `False` if it doesn't.