1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178
|
.. wxPython Phoenix documentation
This file was generated by Phoenix's sphinx generator and associated
tools, do not edit by hand.
Copyright: (c) 2011-2018 by Total Control Software
License: wxWindows License
.. include:: headings.inc
.. currentmodule:: wx.lib.pubsub.core.topicargspecimpl
.. highlight:: python
.. _wx.lib.pubsub.core.topicargspecimpl.ArgsInfo:
==========================================================================================================================================
|phoenix_title| **wx.lib.pubsub.core.topicargspecimpl.ArgsInfo**
==========================================================================================================================================
Encode the Message Data Specification (MDS) for a given
topic. ArgsInfos form a tree identical to that of Topics in that
ArgInfos have a reference to their parent and children ArgInfos,
created for the parent and children topics.
The only difference
between an ArgsInfo and an ArgSpecGiven is that the latter is
what "user thinks is ok" whereas former has been validated:
the specification for this topic is a strict superset of the
specification of its parent, and a strict subset of the
specification of each of its children. Also, the instance
can be used to check validity and filter arguments.
The MDS can be created "empty", ie "incomplete", meaning it cannot
yet be used to validate listener subscriptions to topics.
|
|class_hierarchy| Class Hierarchy
=================================
.. raw:: html
<div id="toggleBlock" onclick="return toggleVisibility(this)" class="closed" style="cursor:pointer;">
<img id="toggleBlock-trigger" src="_static/images/closed.png"/>
Inheritance diagram for class <strong>ArgsInfo</strong>:
</div>
<div id="toggleBlock-summary" style="display:block;"></div>
<div id="toggleBlock-content" style="display:none;">
<p class="graphviz">
<center><img src="_static/images/inheritance/wx.lib.pubsub.core.topicargspecimpl.ArgsInfo_inheritance.png" alt="Inheritance diagram of ArgsInfo" usemap="#dummy" class="inheritance"/></center>
</div>
<script type="text/javascript">toggleVisibilityOnLoad(document.getElementById('toggleBlock'))</script>
<map id="dummy" name="dummy"> <area shape="rect" id="node1" href="wx.lib.pubsub.core.topicargspecimpl.ArgsInfo.html" title="wx.lib.pubsub.core.topicargspecimpl.ArgsInfo" alt="" coords="5,5,312,35"/> </map>
</p>
|
|method_summary| Methods Summary
================================
================================================================================ ================================================================================
:meth:`~wx.lib.pubsub.core.topicargspecimpl.ArgsInfo.__init__`
:meth:`~wx.lib.pubsub.core.topicargspecimpl.ArgsInfo.check` Check that the message arguments given satisfy the topic message
:meth:`~wx.lib.pubsub.core.topicargspecimpl.ArgsInfo.filterArgs` Returns a dict which contains only those items of msgKwargs
:meth:`~wx.lib.pubsub.core.topicargspecimpl.ArgsInfo.getArgs`
:meth:`~wx.lib.pubsub.core.topicargspecimpl.ArgsInfo.getArgsDocs`
:meth:`~wx.lib.pubsub.core.topicargspecimpl.ArgsInfo.getCompleteAI` Get the closest arg spec, starting from self and moving to parent,
:meth:`~wx.lib.pubsub.core.topicargspecimpl.ArgsInfo.getOptArgs`
:meth:`~wx.lib.pubsub.core.topicargspecimpl.ArgsInfo.getReqdArgs`
:meth:`~wx.lib.pubsub.core.topicargspecimpl.ArgsInfo.hasParent` return ``True`` if self has argsInfo object as parent
:meth:`~wx.lib.pubsub.core.topicargspecimpl.ArgsInfo.hasSameArgs` Returns true if self has all the message arguments given, no
:meth:`~wx.lib.pubsub.core.topicargspecimpl.ArgsInfo.isComplete`
:meth:`~wx.lib.pubsub.core.topicargspecimpl.ArgsInfo.numArgs`
:meth:`~wx.lib.pubsub.core.topicargspecimpl.ArgsInfo.setArgsDocs` docs is a mapping from arg names to their documentation
:meth:`~wx.lib.pubsub.core.topicargspecimpl.ArgsInfo.updateAllArgsFinal` This can only be called once, if the construction was done
================================================================================ ================================================================================
|
|api| Class API
===============
.. class:: ArgsInfo
Encode the Message Data Specification (MDS) for a given
topic. ArgsInfos form a tree identical to that of Topics in that
ArgInfos have a reference to their parent and children ArgInfos,
created for the parent and children topics.
The only difference
between an ArgsInfo and an ArgSpecGiven is that the latter is
what "user thinks is ok" whereas former has been validated:
the specification for this topic is a strict superset of the
specification of its parent, and a strict subset of the
specification of each of its children. Also, the instance
can be used to check validity and filter arguments.
The MDS can be created "empty", ie "incomplete", meaning it cannot
yet be used to validate listener subscriptions to topics.
.. method:: __init__(self, topicNameTuple, specGiven, parentArgsInfo)
.. method:: check(self, msgKwargs)
Check that the message arguments given satisfy the topic message
data specification (MDS). Raises SenderMissingReqdMsgDataError if some required
args are missing or not known, and raises SenderUnknownMsgDataError if some
optional args are unknown.
.. method:: filterArgs(self, msgKwargs)
Returns a dict which contains only those items of msgKwargs
which are defined for topic. E.g. if msgKwargs is {a:1, b:'b'}
and topic arg spec is ('a',) then return {a:1}. The returned dict
is valid only if check(msgKwargs) was called (or
check(superset of msgKwargs) was called).
.. method:: getArgs(self)
.. method:: getArgsDocs(self)
.. method:: getCompleteAI(self)
Get the closest arg spec, starting from self and moving to parent,
that is complete. So if self.isComplete() is True, then returns self,
otherwise returns parent (if parent.isComplete()), etc.
.. method:: getOptArgs(self)
.. method:: getReqdArgs(self)
.. method:: hasParent(self, argsInfo)
return ``True`` if self has argsInfo object as parent
.. method:: hasSameArgs(self, \*argNames)
Returns true if self has all the message arguments given, no
more and no less. Order does not matter. So if getArgs()
returns ('arg1', 'arg2') then self.hasSameArgs('arg2', 'arg1')
will return true.
.. method:: isComplete(self)
.. method:: numArgs(self)
.. method:: setArgsDocs(self, docs)
docs is a mapping from arg names to their documentation
.. method:: updateAllArgsFinal(self, topicDefn)
This can only be called once, if the construction was done
with ArgSpecGiven.SPEC_GIVEN_NONE
|