B
    lßU\}  ã               @   s*   d Z ddlZdZdd„ ZG dd„ dƒZdS )zæ
Provides useful functions and classes. Most useful are probably
printTreeDocs and printTreeSpec.

:copyright: Copyright since 2006 by Oliver Schoenborn, all rights reserved.
:license: BSD, see LICENSE_BSD_Simple.txt for details.
é    N)ÚprintImportedÚCallbackc              C   s.   dd„ t j ¡ D ƒ} |  ¡  td | ¡ƒ dS )z/Output a list of pubsub modules imported so farc             S   s   g | ]}|  d ¡dkr|‘qS )Zpubsubr   )Úfind)Ú.0Úmod© r   ú0lib/python3.7/site-packages/pubsub/utils/misc.pyú
<listcomp>   s    z!printImported.<locals>.<listcomp>Ú
N)ÚsysÚmodulesÚkeysÚsortÚprintÚjoin)Zllr   r   r   r      s    r   c               @   s    e Zd ZdZdd„ Zdd„ ZdS )r   aÆ  
    This can be used to wrap functions that are referenced by class
    data if the data should be called as a function. E.g. given
    >>> def func(): pass
    >>> class A:
    ....def __init__(self): self.a = func
    then doing
    >>> boo=A(); boo.a()
    will fail since Python will try to call a() as a method of boo,
    whereas a() is a free function. But if you have instead
    "self.a = Callback(func)", then "boo.a()" works as expected.
    c             C   s
   || _ d S )N)Ú_Callback__callable)ÚselfZcallable_objr   r   r   Ú__init__#   s    zCallback.__init__c             O   s   | j ||ŽS )N)r   )r   ÚargsÚkwargsr   r   r   Ú__call__&   s    zCallback.__call__N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   r   r   r      s   r   )r   r   Ú__all__r   r   r   r   r   r   Ú<module>   s   