+
    üÐjµ  ã                  óÂ  € R t ^ RIHt ^ RIHt  ^ RIHt Rt^ RIH	t	 ^ RI
HtHt ^ RIHt R R	 ltR
P!                  R ]	P"                  ! RR4      P%                  R4       4       4      t]! R4      t]e   ]M]t^ RIHt ^ RIHt ^ RIHtHt ]'       g   Rt]RJ ;'       g    ]R9  tR] ! ]4       2t!]'       g   ^ RIH"t"  ! R R]]4      t#R#   ] d    RtRt Lci ; i)z\
GObject Introspection reactor tests; i.e. `gireactor` module for gio/glib/gtk
integration.
)Úannotations)ÚskipIf)ÚGioT)Úenviron)Úget_required_versionÚrequire_version)Ú	gireactorc               ó    € V ^8„  d   QhRRRR/# )é   ÚsomeVersionÚstrÚreturn© )Úformats   "ÚF/usr/lib/python3/dist-packages/twisted/internet/test/test_gireactor.pyÚ__annotate__r      s   € ÷ ñ  ð ¨ñ ó    c                óf   €  \        R V 4       R#   \         d   p\        T4      u Rp?# Rp?ii ; i)ÚGtkÚ N)r   Ú
ValueErrorr   )r   Úves   & r   ÚrequireEachr      s1   € ð	Ü˜E ;Ô/ñ øô ô 	Ü�r“7�Nûð	ús   ‚ �0›
+¥0«0z, c              #  ó8   "  € T F  p\        V4      x € K  	  R # 5i)N)r   )Ú.0Úversions   & r   Ú	<genexpr>r   "   s   é € ð áTˆGô 	�G×ÐÛTùs   ‚ÚTWISTED_TEST_GTK_VERSIONz4.0,3.0Ú,r   NF)ÚReactorAlreadyRunning)ÚReactorBuilder)ÚSkipTestÚTestCasez0GObject Introspection `gi` module not importablezUnknown GTK version: )r   c                  óª   € ] tR t^:tRtR R ltR R lt]! ]]	4      R R l4       t
]! ]]	4      R R	 l4       tR
 R ltR R ltR R ltR R ltRtR# )ÚGApplicationRegistrationTestsa  
GtkApplication and GApplication are supported by
L{twisted.internet.gtk3reactor} and L{twisted.internet.gireactor}.

We inherit from L{ReactorBuilder} in order to use some of its
reactor-running infrastructure, but don't need its test-creation
functionality.
c               ó$   € V ^8„  d   QhRRRRRR/# )r
   ÚappzGio.ApplicationÚreactorzgireactor.GIReactorr   ÚNoner   )r   s   "r   r   Ú*GApplicationRegistrationTests.__annotate__D   s(   € ÷  ;ñ  ;àð ;ð %ð ;ð 
ñ	 ;r   c                ó0  aaa€ \        VR4      '       g   \        R4      h. oR VV3R lloR VVV3R llpVP                  RV4       VP                  4        SP	                  V4       \
        P                  ! V S4       V P                  SRR	.4       R
# )z€
Register the app, run the reactor, make sure app was activated, and
that reactor was running, and that reactor can be stopped.
Úquitz Version of PyGObject is too old.c               ó   € V ^8„  d   QhRR/# ©r
   r   r(   r   )r   s   "r   r   Ú>GApplicationRegistrationTests.runReactor.<locals>.__annotate__R   s   € ÷ 	ñ 	�dñ 	r   c                 óJ   <€ SP                  R 4       S P                  4        R# )ÚstoppedN)ÚappendÚstop)r'   Úresults   €€r   r2   Ú6GApplicationRegistrationTests.runReactor.<locals>.stopR   s   ø€ Ø�M‰M˜)Ô$Ø�L‰LŽNr   c               ó    € V ^8„  d   QhRRRR/# )r
   ÚwidgetÚobjectr   r(   r   )r   s   "r   r   r.   V   s   € ÷ 	'ñ 	'˜Vð 	'¨ñ 	'r   c                óN   <€ SP                  R 4       SP                  ^ S4       R# )Ú	activatedN)r1   Ú	callLater)r6   r'   r3   r2   s   &€€€r   ÚactivateÚ:GApplicationRegistrationTests.runReactor.<locals>.activateV   s   ø€ Ø�M‰M˜+Ô&Ø×Ñ˜a Ö&r   r;   r9   r0   N)Úhasattrr!   ÚconnectÚholdÚregisterGApplicationr    Ú
runReactorÚassertEqual)Úselfr&   r'   r;   r3   r2   s   &&f @@r   rA   Ú(GApplicationRegistrationTests.runReactorD   s…   ú€ ô �s˜F×#Ò#ÜÐ=Ó>Ð>àˆ÷	ñ 	÷	'ò 	'ð 	�‰�J Ô)ð 	�‰Œ
à×$Ñ$ SÔ)Ü×!Ò! $¨Ô0Ø×Ñ˜ +¨yÐ!9Ö:r   c               ó   € V ^8„  d   QhRR/# r-   r   )r   s   "r   r   r)   f   s   € ÷ &ñ &¨4ñ &r   c                ó¸   € R V n         V P                  4       p\        P                  ! R\        P                  P
                  R7      pV P                  W!4       R# )zB
L{Gio.Application} instances can be registered with a gireactor.
c                 ó0   € \         P                  ! R R7      # ©F)ÚuseGtk©r   Ú	GIReactorr   r   r   Ú<lambda>ÚIGApplicationRegistrationTests.test_gApplicationActivate.<locals>.<lambda>j   ó   € ¤i×&9Ò&9ÀÕ&Gr   ú!com.twistedmatrix.trial.gireactor©Úapplication_idÚflagsN)ÚreactorFactoryÚbuildReactorr   ÚApplicationÚApplicationFlagsÚ
FLAGS_NONErA   ©rC   r'   r&   s   &  r   Útest_gApplicationActivateÚ7GApplicationRegistrationTests.test_gApplicationActivatef   sI   € ñ HˆÔØ×#Ñ#Ó%ˆÜ�oŠoØ>Ü×&Ñ&×1Ñ1ô
ˆð
 	�‰˜Ö%r   c               ó   € V ^8„  d   QhRR/# r-   r   )r   s   "r   r   r)   t   s   € ÷ 
ñ 
 ñ 
r   c                óp  € ^ RI HpHpHp V P	                  V\
        P                  4       V P	                  V\
        P                  4       V P	                  V\
        P                  4       V P                  4       pV P                  \        V4      ^4       V P                  RV^ ,          R,          4       R# )zo
L{twisted.internet.gtk3reactor} is now just a set of compatibility
aliases for L{twisted.internet.GIReactor}.
)ÚGtk3ReactorÚPortableGtk3ReactorÚinstallz+twisted.internet.gtk3reactor was deprecatedÚmessageN)Útwisted.internet.gtk3reactorr]   r^   r_   ÚassertIsr   rK   ÚPortableGIReactorÚflushWarningsrB   ÚlenÚassertIn)rC   r]   r^   r_   Úwarningss   &    r   Útest_gtkAliasesÚ-GApplicationRegistrationTests.test_gtkAliasess   s‡   € ÷	
ñ 	
ð 	�‰�k¤9×#6Ñ#6Ô7Ø�‰Ð)¬9×+FÑ+FÔGØ�‰�gœy×0Ñ0Ô1Ø×%Ñ%Ó'ˆØ×Ñœ˜X›¨Ô*Ø�‰Ø9¸8ÀA½;ÀyÕ;Qö	
r   c               ó   € V ^8„  d   QhRR/# r-   r   )r   s   "r   r   r)   ‰   s   € ÷ 
&ñ 
&¨Tñ 
&r   c                óÒ   € \         P                  V n        V P                  4       p\        P
                  ! R\        P                  P                  R7      pV P                  W!4       R# )zD
L{Gtk.Application} instances can be registered with a gtk3reactor.
z#com.twistedmatrix.trial.gtk3reactorrP   N)
r   rK   rS   rT   r   rU   r   rV   rW   rA   rX   s   &  r   Útest_gtkApplicationActivateÚ9GApplicationRegistrationTests.test_gtkApplicationActivateˆ   sN   € ô
 (×1Ñ1ˆÔØ×#Ñ#Ó%ˆÜ�oŠoØ@Ü×&Ñ&×1Ñ1ô
ˆð 	�‰˜Ö%r   c               ó   € V ^8„  d   QhRR/# r-   r   )r   s   "r   r   r)   •   s   € ÷ Rñ R˜tñ Rr   c                óò   € \         P                  V n        V P                  4       p\        P
                  ! R\        P                  P                  R7      pV P                  \        VP                  V4       R# )zW
L{gireactor.PortableGIReactor} doesn't support application
registration at this time.
rO   rP   N)r   rc   rS   rT   r   rU   rV   rW   ÚassertRaisesÚNotImplementedErrorr@   rX   s   &  r   Útest_portableÚ+GApplicationRegistrationTests.test_portable•   s[   € ô
 (×9Ñ9ˆÔØ×#Ñ#Ó%ˆÜ�oŠoØ>Ü×&Ñ&×1Ñ1ô
ˆð 	×ÑÔ-¨w×/KÑ/KÈSÖQr   c               ó   € V ^8„  d   QhRR/# r-   r   )r   s   "r   r   r)   ¢   s   € ÷ 
Sñ 
S˜Tñ 
Sr   c                óî   € R V n         V P                  4       p\        4       pV P                  \        VP
                  V4      pV P                  VP                  ^ ,          P                  R4      4       R# )zX
Older versions of PyGObject lack C{Application.quit}, and so won't
allow registration.
c                 ó0   € \         P                  ! R R7      # rH   rJ   r   r   r   rL   Ú;GApplicationRegistrationTests.test_noQuit.<locals>.<lambda>§   rN   r   zApplication registration is notN)	rS   rT   r7   rp   ÚRuntimeErrorr@   Ú
assertTrueÚargsÚ
startswith)rC   r'   r&   Úexcs   &   r   Útest_noQuitÚ)GApplicationRegistrationTests.test_noQuit¢   s\   € ñ
 HˆÔØ×#Ñ#Ó%ˆä‹hˆØ×Ñ¤¨g×.JÑ.JÈCÓPˆØ�‰˜Ÿ™ �×.Ñ.Ð/PÓQÖRr   c               ó   € V ^8„  d   QhRR/# r-   r   )r   s   "r   r   r)   ®   s   € ÷ 1ñ 1¨4ñ 1r   c                ó  a aa€ R S n         S P                  4       o\        P                  ! R\        P                  P
                  R7      oR VVV 3R llpSP                  ^ V4       \        P                  ! S S4       R# )zX
It is not possible to register a C{Application} after the reactor has
already started.
c                 ó0   € \         P                  ! R R7      # rH   rJ   r   r   r   rL   ÚIGApplicationRegistrationTests.test_cantRegisterAfterRun.<locals>.<lambda>³   rN   r   rO   rP   c               ó   € V ^8„  d   QhRR/# r-   r   )r   s   "r   r   ÚMGApplicationRegistrationTests.test_cantRegisterAfterRun.<locals>.__annotate__º   s   € ÷ 	ñ 	˜Tñ 	r   c                 ó°   <€ SP                  \        SP                  S4      p SP                  V P                  ^ ,          R4       SP                  4        R# )é    z5Can't register application after reactor was started.N)rp   r   r@   rB   rz   r2   )r|   r&   r'   rC   s    €€€r   ÚtryRegisterÚLGApplicationRegistrationTests.test_cantRegisterAfterRun.<locals>.tryRegisterº   sI   ø€ Ø×#Ñ#Ü% w×'CÑ'CÀSóˆCð ×ÑØ—‘˜•ÐTôð �L‰LŽNr   N)	rS   rT   r   rU   rV   rW   r:   r    rA   )rC   r‡   r&   r'   s   f @@r   Útest_cantRegisterAfterRunÚ7GApplicationRegistrationTests.test_cantRegisterAfterRun®   sh   ú€ ñ
 HˆÔØ×#Ñ#Ó%ˆÜ�oŠoØ>Ü×&Ñ&×1Ñ1ô
ˆ÷
	ò 	ð 	×Ñ˜!˜[Ô)Ü×!Ò! $¨Ö0r   c               ó   € V ^8„  d   QhRR/# r-   r   )r   s   "r   r   r)   Æ   s   € ÷ 
ñ 
¨ñ 
r   c                ó   € R V n         V P                  4       p\        P                  ! R\        P                  P
                  R7      pVP                  V4       \        P                  ! R\        P                  P
                  R7      pV P                  \        VP                  V4      pV P                  VP                  ^ ,          R4       R# )z>
It is not possible to register more than one C{Application}.
c                 ó0   € \         P                  ! R R7      # rH   rJ   r   r   r   rL   ÚFGApplicationRegistrationTests.test_cantRegisterTwice.<locals>.<lambda>Ê   rN   r   rO   rP   z"com.twistedmatrix.trial.gireactor2z2Can't register more than one application instance.N)rS   rT   r   rU   rV   rW   r@   rp   rx   rB   rz   )rC   r'   r&   Úapp2r|   s   &    r   Útest_cantRegisterTwiceÚ4GApplicationRegistrationTests.test_cantRegisterTwiceÆ   s£   € ñ HˆÔØ×#Ñ#Ó%ˆÜ�oŠoØ>Ü×&Ñ&×1Ñ1ô
ˆð 	×$Ñ$ SÔ)Ü�ŠØ?Ü×&Ñ&×1Ñ1ô
ˆð ×Ñ¤¨g×.JÑ.JÈDÓQˆØ×ÑØ�H‰H�Q�KÐMö	
r   )rS   N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__rA   rY   r   Ú	noGtkSkipÚnoGtkMessagerh   rl   rr   r}   r‰   r�   Ú__static_attributes__r   r   r   r$   r$   :   sc   † ñõ ;õD&ñ ˆI�|Ó$ô
ó %ð
ñ( ˆI�|Ó$ô
&ó %ð
&õRõ
Sõ1÷0
ñ 
r   r$   )z3.0z4.0)$r–   Ú
__future__r   Úunittestr   Úgi.repositoryr   Ú
giImportedÚosr   Úgir   r   Útwisted.internetr   r   ÚjoinÚgetÚsplitÚerrorMessageÚactualVersionÚ
gtkVersionÚImportErrorÚtwisted.internet.errorr   Ú#twisted.internet.test.reactormixinsr    Útwisted.trial.unittestr!   r"   Úskipr—   Úreprr˜   r   r$   r   r   r   Ú<module>r­      sí   ðñõ #å ðNÝ!ð
 €Jåç8å*õð —9‘9ñ à—{’{Ð#=¸yÓI×OÑOÐPSÔTóó €Lñ
 )¨Ó/€MØ"/Ò";‘À€Jõ 9Ý >ß 5÷ Ø=€Dà˜4Ð×FÐF Z°~Ñ%E€	Ø&¡t¨JÓ'7Ð&8Ð9€çÝ!ô^
 N°Hö ^
øðY ô Ø€JØ‚Jðús   �C ÃCÃC