.. 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

.. module:: wx.lib.pubsub.core.callables

.. currentmodule:: wx.lib.pubsub.core.callables

.. highlight:: python



.. _wx.lib.pubsub.core.callables:

==========================================================================================================================================
|phoenix_title|  **wx.lib.pubsub.core.callables**
==========================================================================================================================================

Low level functions and classes related to callables.

The AUTO_TOPIC
is the "marker" to use in callables to indicate that when a message
is sent to those callables, the topic object for that message should be
added to the data sent via the call arguments. See the docs in
CallArgsInfo regarding its autoTopicArgName data member.

:copyright: Copyright since 2006 by Oliver Schoenborn, all rights reserved.
:license: BSD, see LICENSE_BSD_Simple.txt for details.


|function_summary| Functions Summary
====================================

================================================================================ ================================================================================
:func:`~wx.lib.pubsub.core.callables.getArgs`                                    Returns an instance of CallArgsInfo for the given callable_.
:func:`~wx.lib.pubsub.core.callables.getID`                                      Get name and module name for a callable, ie function, bound
:func:`~wx.lib.pubsub.core.callables.getModule`                                  Get the module in which an object was defined. Returns '__main__'
:func:`~wx.lib.pubsub.core.callables.getRawFunction`                             Given a callable, return (offset, func) where func is the
================================================================================ ================================================================================


|


|class_summary| Classes Summary
===============================

================================================================================ ================================================================================
:ref:`~wx.lib.pubsub.core.callables.CallArgsInfo`                                Represent the "signature" or protocol of a listener in the context of
:ref:`~wx.lib.pubsub.core.callables.ListenerMismatchError`                       Raised when an attempt is made to subscribe a listener to
================================================================================ ================================================================================


|


.. toctree::
   :maxdepth: 1
   :hidden:

   wx.lib.pubsub.core.callables.CallArgsInfo
   wx.lib.pubsub.core.callables.ListenerMismatchError





Functions
------------

.. function:: getArgs(callable_)

   Returns an instance of CallArgsInfo for the given callable_.
   Raises ListenerMismatchError if callable_ is not a callable.


.. function:: getID(callable_)

   Get name and module name for a callable, ie function, bound
   method or callable instance, by inspecting the callable. E.g.
   getID(Foo.bar) returns ('Foo.bar', 'a.b') if Foo.bar was
   defined in module a.b. 


.. function:: getModule(obj)

   Get the module in which an object was defined. Returns '__main__'
   if no module defined (which usually indicates either a builtin, or
   a definition within main script). 


.. function:: getRawFunction(callable_)

   Given a callable, return (offset, func) where func is the
   function corresponding to callable, and offset is 0 or 1 to
   indicate whether the function's first argument is 'self' (1)
   or not (0). Raises ValueError if callable_ is not of a
   recognized type (function, method or has __call__ method).


