![]() |
netmsgs
1.2.2
RoadNarrows Robotics Network Messaging Package
|
NetMsgs Base Data Module. More...
Classes | |
| class | NetMsgsError |
Functions | |
| def | StrError (ecode) |
| def | IsIdentifier (token) |
| def | PrettyPrintCols (fp, cursor, args, kwargs) |
| def | PrintBuf (buf, count=None, preface='', nlfreq=None, indent=0, col=0, fp=sys.stderr) |
| def | PrintBits (val, msbit, count=None, preface='', fp=sys.stderr) |
| def | PrettyPrintAssignExpr (name, val, col=0, indent=0, fp=sys.stderr) |
| def | PrettyPrintVal (val, col=0, indent=0, fp=sys.stderr) |
| def | PrettyPrintDict (d, col=0, indent=0, fp=sys.stderr) |
| def | PrettyPrintList (l, col=0, indent=0, fp=sys.stderr) |
Variables | |
| list | NMEncoding = ['flat', 'itv'] |
| Message Encoding Type Enumeration. | |
| list | NMEndian = ['big', 'little', 'native'] |
| Message Byte Ordering Type Enumeration. | |
| dictionary | NMBuiltInFieldTypes |
| Built-In message field types, keyed by XML field type name. More... | |
| NMFCode = lambdaxmlftype:NMBuiltInFieldTypes[xmlftype]['code'] | |
| Get NetMsgs field type code given the XML field type. More... | |
| dictionary | NMAliasMap |
| The full set of XML ftype values. More... | |
| string | NMKeyOrder = '>' |
| Special DB dictionary order key. | |
| string | NMKeyPad = '#' |
| Special DB pad field key. | |
| string | NMVectorSuffix = '[]' |
| XML ftype attribute vector suffix string. | |
| list | NMFTypeSimple |
| List of simple field types by XML ftype. More... | |
| list | NMFTypeCodeSimple |
| List of simple field types by field type code. More... | |
| list | NMFTypeCompound = [ 'string', 'struct', 'vector' ] |
| List of compound field types by XML ftype. | |
| list | NMFTypeCodeCompound = [NMFCode('string'), NMFCode('struct'), NMFCode('vector')] |
| List of compound field types by field type code. | |
| list | NMFTypeNumber |
| List of number field types by XML ftype. More... | |
| dictionary | NMFTypeCode2Xml |
| Field type code to XML file type map. More... | |
| dictionary | NMFHdrLen |
| Field Header Lengths keyed by message encoding. More... | |
| NMFIdNone = NMFID_NONE | |
| No field id value. | |
| int | NMPadDftCount = 1 |
| Default pad count. | |
| NMPadFVal = NMFTypePadTr | |
| Pad field value. | |
| NMStringMaxCount = NMFVAL_LEN_MAX_STRING | |
| Maximum and default string maximum length. | |
| NMVectorMaxCount = NMFVAL_LEN_MAX_VECTOR | |
| Maximum and default vector maximum item count. | |
| string | space = lambdaindent:"%*s" |
| space quickie | |
NetMsgs Base Data Module.
| def NetMsgs.NetMsgsBase.IsIdentifier | ( | token | ) |
Returns True if token is a valid identifier, else False.
Parameters:
token - Parsed token.
Definition at line 364 of file NetMsgsBase.py.
| def NetMsgs.NetMsgsBase.PrettyPrintAssignExpr | ( | name, | |
| val, | |||
col = 0, |
|||
indent = 0, |
|||
fp = sys.stderr |
|||
| ) |
Pretty print name = value.
Parameters:
nam - Variable name
val - Variable value.
col - Current column position.
indent - Indentation.
fp - Opened file pointer.
Definition at line 496 of file NetMsgsBase.py.
References NetMsgs.NetMsgsBase.PrettyPrintVal(), and NetMsgs.NetMsgsBase.space.
| def NetMsgs.NetMsgsBase.PrettyPrintCols | ( | fp, | |
| cursor, | |||
| args, | |||
| kwargs | |||
| ) |
Pretty print argument strings aligned to column.
Parameters:
cursor - Current column cursor position.
args - List of argument (pos, s) 2-tuples.
kwargs - Print control keywords.
Definition at line 382 of file NetMsgsBase.py.
References NetMsgs.NetMsgsBase.PrintBuf(), and NetMsgs.NetMsgsBase.space.
| def NetMsgs.NetMsgsBase.PrettyPrintDict | ( | d, | |
col = 0, |
|||
indent = 0, |
|||
fp = sys.stderr |
|||
| ) |
Pretty print dictionary in sorted, indented clarity.
Parameters:
d - The dictionary.
col - Current column position.
indent - Indentation.
fp - Opened file pointer.
Return:
New column position
Definition at line 538 of file NetMsgsBase.py.
References NetMsgs.NetMsgsBase.PrettyPrintVal(), and NetMsgs.NetMsgsBase.space.
Referenced by NetMsgs.NetMsgsBase.PrettyPrintVal().
| def NetMsgs.NetMsgsBase.PrettyPrintList | ( | l, | |
col = 0, |
|||
indent = 0, |
|||
fp = sys.stderr |
|||
| ) |
Pretty print list.
Parameters:
l - The list.
col - Current column position.
indent - Indentation.
fp - Opened file pointer.
Return:
New column position
Definition at line 584 of file NetMsgsBase.py.
References NetMsgs.NetMsgsBase.PrettyPrintVal(), and NetMsgs.NetMsgsBase.space.
Referenced by NetMsgs.NetMsgsBase.PrettyPrintVal().
| def NetMsgs.NetMsgsBase.PrettyPrintVal | ( | val, | |
col = 0, |
|||
indent = 0, |
|||
fp = sys.stderr |
|||
| ) |
Pretty print value.
Parameters:
val - Variable value.
col - Current column position.
indent - Indentation.
fp - Opened file pointer.
Return:
New column position
Definition at line 514 of file NetMsgsBase.py.
References NetMsgs.NetMsgsBase.PrettyPrintDict(), NetMsgs.NetMsgsBase.PrettyPrintList(), and NetMsgs.NetMsgsBase.space.
Referenced by NetMsgs.NetMsgsBase.PrettyPrintAssignExpr(), NetMsgs.NetMsgsBase.PrettyPrintDict(), and NetMsgs.NetMsgsBase.PrettyPrintList().
| def NetMsgs.NetMsgsBase.PrintBits | ( | val, | |
| msbit, | |||
count = None, |
|||
preface = '', |
|||
fp = sys.stderr |
|||
| ) |
Pretty print bits in value to opened file stream.
Parameters:
val - Bits to print.
msbit - Starting most significant bit, zero based.
count - Number of bits to print (None = msbit+1).
preface - Optional buffer preface string.
fp - Output file pointer.
Definition at line 446 of file NetMsgsBase.py.
| def NetMsgs.NetMsgsBase.PrintBuf | ( | buf, | |
count = None, |
|||
preface = '', |
|||
nlfreq = None, |
|||
indent = 0, |
|||
col = 0, |
|||
fp = sys.stderr |
|||
| ) |
Pretty print binary buffer to opened file stream.
Parameters:
buf - Buffer to print.
count - Number of bytes to print.
preface - Optional buffer preface string.
nlfreq - Newline frequency (None for no newlines).
ident - Indentation column alignment.
col - Current column position.
fp - Output file pointer.
Definition at line 413 of file NetMsgsBase.py.
References NetMsgs.NetMsgsBase.space.
Referenced by NetMsgs.NetMsgsBase.PrettyPrintCols().
| def NetMsgs.NetMsgsBase.StrError | ( | ecode | ) |
Get the error string describing the NetMsgs error code.
The absolute value of the error code is taken prior retrieving the
string. An unknown or out-of-range error code will be mapped to
NM_ECODE_BADEC.
Parameters:
ecode - NetMsgs error code.
Return:
The appropriate error code string.
Definition at line 323 of file NetMsgsBase.py.
| dictionary NetMsgs.NetMsgsBase.NMAliasMap |
The full set of XML ftype values.
Definition at line 246 of file NetMsgsBase.py.
| dictionary NetMsgs.NetMsgsBase.NMBuiltInFieldTypes |
Built-In message field types, keyed by XML field type name.
code - message field type byte code desc - short description flen - packed message field length (bytes) comp - complexity. one of: simple compound na T - C/C++ type specifier pre - member name prefix (quasi-Hungarian)
Definition at line 78 of file NetMsgsBase.py.
| NetMsgs.NetMsgsBase.NMFCode = lambdaxmlftype:NMBuiltInFieldTypes[xmlftype]['code'] |
Get NetMsgs field type code given the XML field type.
Definition at line 243 of file NetMsgsBase.py.
| dictionary NetMsgs.NetMsgsBase.NMFHdrLen |
Field Header Lengths keyed by message encoding.
Definition at line 297 of file NetMsgsBase.py.
| dictionary NetMsgs.NetMsgsBase.NMFTypeCode2Xml |
Field type code to XML file type map.
Definition at line 284 of file NetMsgsBase.py.
| list NetMsgs.NetMsgsBase.NMFTypeCodeSimple |
List of simple field types by field type code.
Definition at line 267 of file NetMsgsBase.py.
| list NetMsgs.NetMsgsBase.NMFTypeNumber |
List of number field types by XML ftype.
Definition at line 280 of file NetMsgsBase.py.
| list NetMsgs.NetMsgsBase.NMFTypeSimple |
List of simple field types by XML ftype.
Definition at line 262 of file NetMsgsBase.py.