+
    Q�iM  ã                  óØ   € ^ RI Ht ^ RIt^ RIt^ RIHtHt ^ RIHtH	t	H
t
 ^ RIHt ^RIHtHtHt R R ltR	 R
 lt ! R R]4      t ! R R]4      t ! R R]4      tR R ltR R ltR# )é    )ÚannotationsN)ÚAnyÚIterator)ÚPythonAttributeÚPythonModuleÚ	getModule)ÚMethodicalMachine)ÚTypeMachineÚInputProtocolÚCorec               ó    € V ^8„  d   QhRRRR/# )é   ÚattrzPythonAttribute | PythonModuleÚreturnÚbool© )Úformats   "Ú3/usr/lib/python3/dist-packages/automat/_discover.pyÚ__annotate__r      s   € ÷ 7ñ 7Ð;ð 7Àñ 7ó    c                óÔ   € \         P                  ! V P                  4       4      pVf   R# T p\        V\        4      '       g   VP
                  pK$  VP                  VP                  8H  # )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__)r   ÚsourceModuleÚcurrentModules   &  r   ÚisOriginalLocationr!      sW   € ô ×$Ò$ T§Y¡Y£[Ó1€LØÒÙà€MÜ˜¬×5Ò5Ø%×.Ñ.Šà×Ñ ×!6Ñ!6Ñ6Ð6r   c               ó    € V ^8„  d   QhRRRR/# )r   ÚwithinúPythonModule | PythonAttributer   úJIterator[tuple[str, MethodicalMachine | TypeMachine[InputProtocol, Core]]]r   )r   s   "r   r   r      s   € ÷ -1ñ -1Ø*ð-1àOñ-1r   c              #  óü  "  € \         P                  ! V .4      p\        4       pV'       EdN   VP                  4       pVP	                  4       p\        V\        4      '       g   \        V\        4      '       d*   WB9  d$   VP                  V4       VP                  V3x € K~  \        P                  ! V4      '       dJ   \        V4      '       d9   WB9  d3   VP                  V4       VP                  VP                  4       4       Kã  \        V\        4      '       g   Kû  WB9  g   EK  VP                  V4       VP                  VP                  4       4       VP                  VP!                  4       4       EKV  R# 5i)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	   r
   Úaddr   r   Úisclassr!   Ú
extendleftÚiterAttributesr   ÚiterModules)r#   ÚqueueÚvisitedr   Úvalues   &    r   ÚfindMachinesViaWrapperr3      s  é € ô( ×Ò˜v˜hÓ'€Eô 	‹ð ÷ ˆ%Ø�y‰y‹{ˆØ—	‘	“ˆä�uÔ/×0Ò0´J¸uÄk×4RÒ4RØÔ"Ø�K‰K˜ÔØ—)‘)˜UÐ"Ô"ä�OŠO˜E×"Ò"Ô'9¸$×'?Ò'?ÀEÔDXà�K‰K˜ÔØ×Ñ˜T×0Ñ0Ó2Ö3Ü˜œl×+Ô+°×0DØ�K‰K˜ÔØ×Ñ˜T×0Ñ0Ó2Ô3Ø×Ñ˜T×-Ñ-Ó/×0ñ! ùs   ‚*E<­BE<Â>AE<ÄE<Ä(AE<c                  ó   € ] tR t^OtRtRtR# )ÚInvalidFQPNz@
The given FQPN was not a dot-separated list of Python objects.
r   N©r   Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__Ú__static_attributes__r   r   r   r5   r5   O   ó   † õr   r5   c                  ó   € ] tR t^UtRtRtR# )ÚNoModulez?
A prefix of the FQPN was not an importable module or package.
r   Nr6   r   r   r   r>   r>   U   r<   r   r>   c                  ó   € ] tR t^[tRtRtR# )ÚNoObjectz3
A suffix of the FQPN was not an accessible object
r   Nr6   r   r   r   r@   r@   [   r<   r   r@   c               ó    € V ^8„  d   QhRRRR/# )r   ÚfqpnÚstrr   r$   r   )r   s   "r   r   r   a   s   € ÷ 2ñ 2�3ð 2Ð9ñ 2r   c                ó†  a€ V '       g   \        R4      h\        P                  ! V P                  R4      4      pRV9   d   \        RV : 24      hVP	                  4       o \        S4      pT'       d-   TP	                  4       o TS,          pTP                  4        K4  T#   \         d    \        S4      hi ; i  \         d    TP                  S4        Mi ; iTpT F[  o \        T3R lTP                  4        4       4      pK)    \         d'    \        RP                  TP                  S4      4      hi ; i	  T# )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}.
zFQPN was emptyÚ.Ú zMname must be a string giving a '.'-separated list of Python identifiers, not c              3  ó|   <"  € T F1  pVP                   P                  R ^4      R,          S8X  g   K-  Vx € K3  	  R# 5i)rE   Néÿÿÿÿ)r   Úrsplit)Ú.0ÚchildÚ	components   & €r   Ú	<genexpr>ÚwrapFQPN.<locals>.<genexpr>‹   s8   øé € ð á7�EØ—:‘:×$Ñ$ S¨!Ó,¨RÕ0°IÑ=÷ ’Û7ùs   ƒ*<²
<z{}.{})r5   r'   r(   ÚsplitÚpopleftr   ÚKeyErrorr>   r   Ú
appendleftÚnextr.   ÚStopIterationr@   r   r   )rB   Ú
componentsÚmoduleÚ	attributerL   s   &   @r   ÚwrapFQPNrX   a   sC  ø€ ÷ ÜÐ*Ó+Ð+ä×"Ò" 4§:¡:¨c£?Ó3€Jà	ˆZÔÝâ%)ð,ó
ð 	
ð
 ×"Ñ"Ó$€Ið"Ü˜9Ó%ˆ÷
 Ø×&Ñ&Ó(ˆ	ð	Ø˜IÕ&ˆFð
 �K‰KŽMàˆøô ô "Ü�yÓ!Ð!ð"ûô ô 	Ø×!Ñ! )Ô,Ùð	úð €IÛˆ	ð	FÜô à&×5Ñ5Ô7óó ŠIøô
 ô 	FÜ˜7Ÿ>™>¨)¯.©.¸)ÓDÓEÐEð	Fúñ  ð Ðs*   Á!B" Â	B< Â"B9Â<CÃCÃ&#DÄ1D<c               ó    € V ^8„  d   QhRRRR/# )r   rB   rC   r   r%   r   )r   s   "r   r   r   –   s   € ÷ 2ñ 2Ø
ð2àOñ2r   c                ó*   € \        \        V 4      4      # )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.

@param fqpn: a fully-qualified Python identifier (i.e. the dotted
    identifier of an object defined at module or class scope, including the
    package and modele names); where to start the search.

@return: a generator which yields (C{FQPN}, L{MethodicalMachine}) pairs.
)r3   rX   )rB   s   &r   ÚfindMachinesr[   –   s   € ô$ "¤(¨4£.Ó1Ð1r   )Ú
__future__r   r'   r   Útypingr   r   Útwisted.python.modulesr   r   r   Úautomatr	   Ú_typedr
   r   r   r!   r3   Ú	Exceptionr5   r>   r@   rX   r[   r   r   r   Ú<module>rb      sZ   ðÝ "ã Û ß  ç KÑ Kå %ç 4Ñ 4õ7õ"-1ô`�)ô ôˆ{ô ôˆ{ô õ2÷j2r   