.. wxPython Phoenix documentation

   This file was generated by Phoenix's sphinx generator and associated
   tools, do not edit by hand.

   Copyright: (c) 2011-2017 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


