%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/automat/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/automat/__pycache__/_discover.cpython-312.pyc

�

�~�b���ddlZddlZddlmZddlmZmZd�Zd�ZGd�de	�Z
Gd�d	e
�ZGd
�de
�Zd�Z
d
�Zy)�N)�MethodicalMachine)�PythonModule�	getModulec���tj|j��}|�y|}t|t�s|j
}t|t�s�|j|jk(S)z�
    Attempt to discover if this appearance of a PythonAttribute
    representing a class refers to the module where that class was
    defined.
    F)�inspect�	getmodule�load�
isinstancer�onObject�name�__name__)�attr�sourceModule�
currentModules   �3/usr/lib/python3/dist-packages/automat/_discover.py�isOriginalLocationrsb���$�$�T�Y�Y�[�1�L�����M����5�%�.�.�
����5�����!6�!6�6�6�c#�xK�tj|g�}t�}|�r|j�}|j	�}t|t�r&||vr"|j|�|j|f��n�tj|�r@t|�r5||vr1|j|�|j|j��nct|t�rS||vrO|j|�|j|j��|j|j��|r��yy�w)a�
    Recursively yield L{MethodicalMachine}s and their FQPNs within a
    L{PythonModule} or a L{twisted.python.modules.PythonAttribute}
    wrapper object.

    Note that L{PythonModule}s may refer to packages, as well.

    The discovery heuristic considers L{MethodicalMachine} instances
    that are module-level attributes or class-level attributes
    accessible from module scope.  Machines inside nested classes will
    be discovered, but those returned from functions or methods will not be.

    @type within: L{PythonModule} or L{twisted.python.modules.PythonAttribute}
    @param within: Where to start the search.

    @return: a generator which yields FQPN, L{MethodicalMachine} pairs.
    N)�collections�deque�set�popr	r
r�addrr�isclassr�
extendleft�iterAttributesr�iterModules)�within�queue�visitedr�values     r�findMachinesViaWrapperr"s�����$
���v�h�'�E��e�G�
��y�y�{���	�	����e�.�/�E��4H��K�K����)�)�U�"�"��o�o�e�$�);�D�)A��7�"��K�K������T�0�0�2�3�
��l�
+��W�0D��K�K������T�0�0�2�3����T�-�-�/�0��s�D4D:�8D:c��eZdZdZy)�InvalidFQPNzH
    The given FQPN was not a dot-separated list of Python objects.
    N�r
�
__module__�__qualname__�__doc__�rrr$r$>���rr$c��eZdZdZy)�NoModulezG
    A prefix of the FQPN was not an importable module or package.
    Nr%r)rrr,r,Dr*rr,c��eZdZdZy)�NoObjectz;
    A suffix of the FQPN was not an accessible object
    Nr%r)rrr.r.Jr*rr.c�L��|std��tj|jd��}d|vrtd|����|j	��	t��}|r)|j	��	|�}|j�|r�)|S#t$rt���wxYw#t$r|j��YnwxYw|}|D]W�	t�fd�|j�D��}�'#t$r&tdj|j����wxYw|S)z�
    Given an FQPN, retrieve the object via the global Python module
    namespace and wrap it with a L{PythonModule} or a
    L{twisted.python.modules.PythonAttribute}.
    zFQPN was empty�.�zMname must be a string giving a '.'-separated list of Python identifiers, not c3�f�K�|](}|jjdd�d�k(r|���*y�w)r0����N)r�rsplit)�.0�child�	components  �r�	<genexpr>zwrapFQPN.<locals>.<genexpr>ys8�����L�u� %�
�
� 1� 1�#�q� 9�"� =�� J�#�L�s�.1z{}.{})r$rr�split�popleftr�KeyErrorr,r	�
appendleft�nextr�
StopIterationr.�formatr)�fqpn�
components�module�	attributer8s    @r�wrapFQPNrEPsQ�����*�+�+��"�"�4�:�:�c�?�3�J�	�Z���%)�
,�-�	-��"�"�$�I�"��9�%��
��&�&�(�	�	��I�&�F�

�K�K�M���
���"��y�!�!�"���	��!�!�)�,��	���I��F�	�	F��L�	�0H�0H�0J�L�L�I���	F��7�>�>�)�.�.�)�D�E�E�	F��	F��s*�B�4B&�B#�&C�C�"C1�1/D c�*�tt|��S)a'
    Recursively yield L{MethodicalMachine}s and their FQPNs in and
    under the a Python object specified by an FQPN.

    The discovery heuristic considers L{MethodicalMachine} instances
    that are module-level attributes or class-level attributes
    accessible from module scope.  Machines inside nested classes will
    be discovered, but those returned from functions or methods will not be.

    @type within: an FQPN
    @param within: Where to start the search.

    @return: a generator which yields FQPN, L{MethodicalMachine} pairs.
    )r"rE)rAs r�findMachinesrG�s��"�(�4�.�1�1r)rr�automatr�twisted.python.modulesrrrr"�	Exceptionr$r,r.rErGr)rr�<module>rKsK����%�:�7�"#1�L�)���{���{��.�b2r

Zerion Mini Shell 1.0