Module prototypes :: Class BaseProtogenClass
[hide private]
[frames] | no frames]

Class BaseProtogenClass

source code

object --+
         |
        BaseProtogenClass
Known Subclasses:

All types are derived from this

Instance Methods [hide private]
 
__init__(self, *args, **kwargs)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
packetsize(self)
Returns size in bytes that we occupy
source code
 
writetobuffer(self, buf)
Scribble ourselves to the buf
source code
 
readfrombuffer(self, buf)
Get our value from the buffer
source code
 
getvalue(self)
Returns our underlying value if sensible (eg an integer, string or list) else returns self
source code
 
packetspan(self)
Returns tuple of begining,end offsets from last packet we were read or written from.
source code
 
_consumekw(self, dict, consumelist)
A helper function for easily setting internal values from the dict
source code
 
_complainaboutunusedargs(self, klass, dict)
A helper function that will raise an exception if there are unused keyword arguments.
source code
 
_ismostderived(self, klass) source code
 
_update(self, args, kwargs) source code
 
iscontainer(self)
Do we contain fields?
source code
 
update(self, *args, **kwargs) source code
 
autologwrite(self, buf, logtitle='<written data>') source code
 
autologread(self, buf, logtitle='<read data>') source code

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, *args, **kwargs)
(Constructor)

source code 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Overrides: object.__init__
(inherited documentation)

packetspan(self)

source code 

Returns tuple of begining,end offsets from last packet we were read or written from.

Note that in normal Python style, end is one beyond the last byte we actually own

_consumekw(self, dict, consumelist)

source code 

A helper function for easily setting internal values from the dict

For each name in consumelist, we look for it in the dict and set self._name to the value from dict. The key is then deleted from the dict.

_complainaboutunusedargs(self, klass, dict)

source code 

A helper function that will raise an exception if there are unused keyword arguments.

Parameters:
  • klass - This should be the class you are calling this function from
  • dict - The keyword arguments still in play

Note: that we only complain if in the most derived class, so it is safe to always call this helper as the last line of your constructor.