+
    Dfj                         R 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  ! R R]
4      t ! R R	]P&                  4      tR
 tR.tR#   ] d    ^ RIHtHtH
t
  LIi ; i)aa  
This module provides wxPython event loop support for Twisted.

In order to use this support, simply do the following::

    |  from twisted.internet import wxreactor
    |  wxreactor.install()

Then, when your root wxApp has been created::

    | from twisted.internet import reactor
    | reactor.registerWxApp(yourApp)
    | reactor.run()

Then use twisted.internet APIs as usual. Stop the event loop using
reactor.stop(), not yourApp.ExitMainLoop().

IMPORTANT: tests will fail when run under this reactor. This is
expected and probably does not reflect on the reactor's ability to run
real applications.
)EmptyQueue)	CallAfterPySimpleAppTimer)wxPySimpleAppwxCallAfterwxTimer)_threadedselect)logruntimec                   0   a  ] tR t^*t o RtR tR tRtV tR# )ProcessEventsTimerz
Timer that tells wx to process pending events.

This is necessary on macOS, probably due to a bug in wx, if we want
wxCallAfters to be handled when modal dialogs, menus, etc.  are open.
c                >    \         P                  ! V 4       Wn        R # N)r	   __init__wxappselfr   s   &&</usr/lib/python3/dist-packages/twisted/internet/wxreactor.pyr   ProcessEventsTimer.__init__2   s    
    c                :    V P                   P                  4        R# )z%
Called repeatedly by wx event loop.
N)r   ProcessPendingEventsr   s   &r   NotifyProcessEventsTimer.Notify6   s     	

'')r   r   N)	__name__
__module____qualname____firstlineno____doc__r   r   __static_attributes____classdictcell____classdict__s   @r   r   r   *   s     * *r   r   c                   P   a  ] tR t^=t o RtRtR tR tR tR t	R t
RR ltR	tV tR
# )	WxReactorzO
wxPython reactor.

wxPython drives the event loop, select() runs in a thread.
Fc                    Wn         R# )z+
Register wxApp instance with the reactor.
Nr   r   s   &&r   registerWxAppWxReactor.registerWxAppF   s	     
r   c                     ^ RI pVP                  VP                  VP                  4       T P                  P                  4        R#   \         d     R# i ; i)z?
wx sometimes removes our own signal handlers, so re-add them.
N)signalSIGINTdefault_int_handlerImportError_signalsinstall)r   r-   s   & r   _installSignalHandlersAgain%WxReactor._installSignalHandlersAgainL   sH    	MM&--)C)CD 	  		s   *A AAc                z    V P                   '       d   R# RV n         \        P                  P                  V 4       R# )z
Stop the reactor.
NT)	_stoppingr
   ThreadedSelectReactorstopr   s   &r   r8   WxReactor.stopY   s+     >>>--2248r   c                z    \        V R4      '       d   \        V4       R# V P                  P                  V4       R# )zU
Schedule function to run in main wx/Twisted thread.

Called by the select() thread.
r   N)hasattrr   
_postQueueput)r   fs   &&r   _runInMainThreadWxReactor._runInMainThreadb   s,     4!!N OO"r   c                b    \        V R4      '       d   V P                  P                  4        R# R# )zg
Stop the wx event loop if it hasn't already been stopped.

Called during Twisted event loop shutdown.
r   N)r;   r   ExitMainLoopr   s   &r   _stopWxWxReactor._stopWxn   s&     4!!JJ##% "r   c                  a  \        4       S n        \        S R4      '       g0   \        P                  ! R4       S P                  \        4       4       S P                  S P                  VR7       V'       d   S P                  ^ S P                  4       S P                  RRS P                  4       S P                  RRV 3R l4       \        P                  P                  4       '       d'   \!        S P"                  4      pVP%                  ^4       S P"                  P'                  4        S P"                  pS =S P(                  '       gO   S P+                  4        VP-                  4          S P                  P/                  RR7      pVf   R	#  V! 4        K.  R	#   \0         d    \        P2                  ! 4         KS  i ; i  \4         d     Ke  i ; i)
z
Start the reactor.
r   zMregisterWxApp() was not called on reactor, registering my own wxApp instance.)installSignalHandlersaftershutdownc                  :   < S P                   P                  R 4      # r   )r<   r=   r   s   r   <lambda>WxReactor.run.<locals>.<lambda>   s    )<)<T)Br   g{Gz?)timeoutN)r   r<   r;   r   msgr*   r   
interleaver?   	callLaterr3   addSystemEventTriggerrC   r   platformisMacOSXr   r   StartMainLoopr6   r8   r   getBaseExceptionerrr   )r   rF   tr   r>   s   f&   r   runWxReactor.runw   sw     'tW%%GG5 }/ 	!!9N 	 	
 !NN1d>>? 	""7JE""Z!B	
 $$&&"4::.AGGAJ



J~~~ IIK&&(
"++D+9A y"# $ ) "	"  s$   -G F  F?>F?GG)r<   r6   r   N)T)r   r   r    r!   r"   r6   r*   r3   r8   r?   rC   rY   r#   r$   r%   s   @r   r(   r(   =   s4      I 9
#&7" 7"r   r(   c                 6    \        4       p ^ RIHp V! V 4       V # )zH
Configure the twisted mainloop to be run inside the wxPython mainloop.
)installReactor)r(   twisted.internet.mainr\   )reactorr\   s     r   r2   r2      s     kG47Nr   r2   N)r"   queuer   r   wxr   r   r   r   r   r	   r0   wxPython.wxtwisted.internetr
   twisted.pythonr   r   r   r7   r(   r2   __all__ r   r   <module>rf      sp   , @  - '* *&q"55 q"h +u  @??@s   
A A A 