ó
    Ö›‘hµ  ã                  ó´  • S r SSKJr  SSKJr   SSKJr  SrSSKJ	r	  SSK
JrJr  SSKJr  SS	 jrS
R!                  S \	R"                  " SS5      R%                  S5       5       5      r\" S5      r\b  \O\rSSKJr  SSKJr  SSKJrJr  \(       d  Sr\SL =(       d    \S;  rS\ " \5       3r!\(       d  SSKJ"r"   " S S\\5      r#g! \ a    SrSr N^f = f)z\
GObject Introspection reactor tests; i.e. `gireactor` module for gio/glib/gtk
integration.
é    )Úannotations)ÚskipIf)ÚGioT)Úenviron)Úget_required_versionÚrequire_version)Ú	gireactorc                ób   •  [        SU 5        g! [         a  n[        U5      s S nA$ S nAff = f)NÚGtkÚ )r   Ú
ValueErrorÚstr)ÚsomeVersionÚves     ÚhC:\Users\psant\Downloads\Noiseback\school\venv\Lib\site-packages\twisted/internet/test/test_gireactor.pyÚrequireEachr      s1   € ð	Ü˜E ;Ô/ð øô ó 	Ü�r“7�Nûð	ús   ‚ �
.™
)£.©.z, c              #  ó8   #   • U  H  n[        U5      v •  M     g 7f)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 importable)z3.0z4.0zUnknown GTK version: )r   c                  ó¤   • \ rS rSrSr      SS jrSS jr\" \\	5      SS j5       r
\" \\	5      SS j5       rSS jrSS jrSS	 jrSS
 jrSrg)ÚGApplicationRegistrationTestsé:   a  
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                ó(  ^^^• [        US5      (       d  [        S5      e/ mS	UU4S jjmS
UUU4S jjnUR                  SU5        UR                  5         TR	                  U5        [
        R                  " U T5        U R                  TSS/5        g)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                 óH   >• TR                  S5        T R                  5         g )NÚstopped)ÚappendÚstop)ÚreactorÚresults   €€r   r%   Ú6GApplicationRegistrationTests.runReactor.<locals>.stopR   s   ø€ Ø�M‰M˜)Ô$Ø�L‰L�Nó    c                óL   >• TR                  S5        TR                  ST5        g )NÚ	activatedr   )r$   Ú	callLater)Úwidgetr&   r'   r%   s    €€€r   ÚactivateÚ:GApplicationRegistrationTests.runReactor.<locals>.activateV   s   ø€ Ø�M‰M˜+Ô&Ø×Ñ˜a Õ&r)   r.   r+   r#   N©ÚreturnÚNone)r-   Úobjectr1   r2   )Úhasattrr   ÚconnectÚholdÚregisterGApplicationr   Ú
runReactorÚassertEqual)ÚselfÚappr&   r.   r'   r%   s     ` @@r   r8   Ú(GApplicationRegistrationTests.runReactorD   s…   ú€ ô �s˜F×#Ñ#ÜÐ=Ó>Ð>àˆ÷	ð 	÷	'ñ 	'ð 	�‰�J Ô)ð 	�‰Œ
à×$Ñ$ SÔ)Ü×!Ò! $¨Ô0Ø×Ñ˜ +¨yÐ!9Õ:r)   c                ó°   • S U l         U R                  5       n[        R                  " S[        R                  R
                  S9nU R                  X!5        g)zB
L{Gio.Application} instances can be registered with a gireactor.
c                 ó*   • [         R                  " SS9$ ©NF)ÚuseGtk©r	   Ú	GIReactor© 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_NONEr8   ©r:   r&   r;   s      r   Útest_gApplicationActivateÚ7GApplicationRegistrationTests.test_gApplicationActivatef   sI   € ñ HˆÔØ×#Ñ#Ó%ˆÜ�oŠoØ>Ü×&Ñ&×1Ñ1ñ
ˆð
 	�‰˜Õ%r)   c                ó^  • SSK JnJnJn  U R	                  U[
        R                  5        U R	                  U[
        R                  5        U R	                  U[
        R                  5        U R                  5       nU R                  [        U5      S5        U R                  SUS   S   5        g)zo
L{twisted.internet.gtk3reactor} is now just a set of compatibility
aliases for L{twisted.internet.GIReactor}.
r   )ÚGtk3ReactorÚPortableGtk3ReactorÚinstallé   z+twisted.internet.gtk3reactor was deprecatedÚmessageN)Útwisted.internet.gtk3reactorrT   rU   rV   ÚassertIsr	   rB   ÚPortableGIReactorÚflushWarningsr9   ÚlenÚassertIn)r:   rT   rU   rV   Ú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                óÊ   • [         R                  U l        U R                  5       n[        R
                  " S[        R                  R                  S9nU R                  X!5        g)zD
L{Gtk.Application} instances can be registered with a gtk3reactor.
z#com.twistedmatrix.trial.gtk3reactorrH   N)
r	   rB   rK   rL   r   rM   r   rN   rO   r8   rP   s      r   Útest_gtkApplicationActivateÚ9GApplicationRegistrationTests.test_gtkApplicationActivateˆ   sN   € ô
 (×1Ñ1ˆÔØ×#Ñ#Ó%ˆÜ�oŠoØ@Ü×&Ñ&×1Ñ1ñ
ˆð 	�‰˜Õ%r)   c                óê   • [         R                  U l        U R                  5       n[        R
                  " S[        R                  R                  S9nU R                  [        UR                  U5        g)zW
L{gireactor.PortableGIReactor} doesn't support application
registration at this time.
rG   rH   N)r	   r[   rK   rL   r   rM   rN   rO   ÚassertRaisesÚNotImplementedErrorr7   rP   s      r   Útest_portableÚ+GApplicationRegistrationTests.test_portable•   s[   € ô
 (×9Ñ9ˆÔØ×#Ñ#Ó%ˆÜ�oŠoØ>Ü×&Ñ&×1Ñ1ñ
ˆð 	×ÑÔ-¨w×/KÑ/KÈSÕQr)   c                óä   • S U l         U R                  5       n[        5       nU R                  [        UR
                  U5      nU R                  UR                  S   R                  S5      5        g)zX
Older versions of PyGObject lack C{Application.quit}, and so won't
allow registration.
c                 ó*   • [         R                  " SS9$ r?   rA   rC   r)   r   rD   Ú;GApplicationRegistrationTests.test_noQuit.<locals>.<lambda>§   rF   r)   r   zApplication registration is notN)	rK   rL   r3   rf   ÚRuntimeErrorr7   Ú
assertTrueÚargsÚ
startswith)r:   r&   r;   Úexcs       r   Útest_noQuitÚ)GApplicationRegistrationTests.test_noQuit¢   s\   € ñ
 HˆÔØ×#Ñ#Ó%ˆä‹hˆØ×Ñ¤¨g×.JÑ.JÈCÓPˆØ�‰˜Ÿ™ ™×.Ñ.Ð/PÓQÕRr)   c                óú   ^ ^^• S T l         T R                  5       m[        R                  " S[        R                  R
                  S9mSUUU 4S jjnTR                  SU5        [        R                  " T T5        g)zX
It is not possible to register a C{Application} after the reactor has
already started.
c                 ó*   • [         R                  " SS9$ r?   rA   rC   r)   r   rD   ÚIGApplicationRegistrationTests.test_cantRegisterAfterRun.<locals>.<lambda>³   rF   r)   rG   rH   c                 ó¦   >• TR                  [        TR                  T5      n TR                  U R                  S   S5        TR                  5         g )Nr   z5Can't register application after reactor was started.)rf   r   r7   r9   ro   r%   )rq   r;   r&   r:   s    €€€r   ÚtryRegisterÚLGApplicationRegistrationTests.test_cantRegisterAfterRun.<locals>.tryRegisterº   sI   ø€ Ø×#Ñ#Ü% w×'CÑ'CÀSóˆCð ×ÑØ—‘˜‘ÐTôð �L‰L�Nr)   r   Nr0   )	rK   rL   r   rM   rN   rO   r,   r   r8   )r:   rx   r;   r&   s   ` @@r   Útest_cantRegisterAfterRunÚ7GApplicationRegistrationTests.test_cantRegisterAfterRun®   sh   ú€ ñ
 HˆÔØ×#Ñ#Ó%ˆÜ�oŠoØ>Ü×&Ñ&×1Ñ1ñ
ˆ÷
	ñ 	ð 	×Ñ˜!˜[Ô)Ü×!Ò! $¨Õ0r)   c                óŠ  • S U l         U R                  5       n[        R                  " S[        R                  R
                  S9nUR                  U5        [        R                  " S[        R                  R
                  S9nU R                  [        UR                  U5      nU R                  UR                  S   S5        g)z>
It is not possible to register more than one C{Application}.
c                 ó*   • [         R                  " SS9$ r?   rA   rC   r)   r   rD   ÚFGApplicationRegistrationTests.test_cantRegisterTwice.<locals>.<lambda>Ê   rF   r)   rG   rH   z"com.twistedmatrix.trial.gireactor2r   z2Can't register more than one application instance.N)rK   rL   r   rM   rN   rO   r7   rf   rm   r9   ro   )r:   r&   r;   Úapp2rq   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)   )rK   N)r;   zGio.Applicationr&   zgireactor.GIReactorr1   r2   r0   )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r8   rQ   r   Ú	noGtkSkipÚnoGtkMessager`   rc   rh   rr   rz   r€   Ú__static_attributes__rC   r)   r   r   r   :   sz   † ñð ;àð ;ð %ð ;ð 
ô	 ;ôD&ñ ˆI�|Ó$ó
ó %ð
ñ( ˆI�|Ó$ó
&ó %ð
&ôRô
Sô1÷0
r)   r   )r   r   r1   r   )$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   rC   r)   r   Ú<module>r�      sê   ðñõ #å ðNÝ!ð
 €Jåç8å*ôð —9‘9ñ à—{’{Ð#=¸yÓI×OÑOÐPSÔTóó €Lñ
 )¨Ó/€MØ"/Ñ";‘À€Jõ 9Ý >ß 5ö Ø=€Dà˜4Ð×F Z°~Ñ%E€	Ø&¡t¨JÓ'7Ð&8Ð9€æÝ!ô^
 N°Hõ ^
øðY ó Ø€JØ‚Jðús   �C
 Ã

CÃC