AnonSec Shell
Server IP : 209.38.156.173  /  Your IP : 216.73.216.122   [ Reverse IP ]
Web Server : Apache/2.4.52 (Ubuntu)
System : Linux lakekumayuhotel 5.15.0-136-generic #147-Ubuntu SMP Sat Mar 15 15:53:30 UTC 2025 x86_64
User : root ( 0)
PHP Version : 8.1.2-1ubuntu2.22
Disable Function : NONE
Domains : 2 Domains
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/lib/python3/dist-packages/twisted/internet/test/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     [ BACKUP SHELL ]     [ JUMPING ]     [ MASS DEFACE ]     [ SCAN ROOT ]     [ SYMLINK ]     

Current File : /usr/lib/python3/dist-packages/twisted/internet/test/__pycache__/test_gireactor.cpython-310.pyc
o

�bt�@s�dZddlZddlmZzddlmZddlmZWn
e	y'dZdZ
YnweZzddlm
ZWne	y=dZ
Yn	weZ
ddlmZddl
mZdd	lmZdd
lmZmZedur`dZGdd
�d
ee�ZGdd�de�ZdS)z
GI/GTK3 reactor tests.
�N)�skipIf)�Gio)�	gireactor)�gtk3reactor)�Gtk)�ReactorAlreadyRunning)�ReactorBuilder)�SkipTest�TestCasezgtk3/gi not importablec@sVeZdZdZdd�Zdd�Zeedud�dd	��Zd
d�Z	dd
�Z
dd�Zdd�ZdS)�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.
    csrt|d�s	td��g���fdd�����fdd�}|�d|�|����|�t�|��|��dd	g�d
S)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.cs��d����dS)N�stopped)�append�stop�)�reactor�resultr�F/usr/lib/python3/dist-packages/twisted/internet/test/test_gireactor.pyr<s
z6GApplicationRegistrationTests.runReactor.<locals>.stopcs��d���d��dS)N�	activatedr)r�	callLater)�widget�rrrrr�activate@s
z:GApplicationRegistrationTests.runReactor.<locals>.activaterrr
N)�hasattrr	�connect�hold�registerGApplicationr�
runReactor�assertEqual)�self�apprrrrrr2s

z(GApplicationRegistrationTests.runReactorcCs<tjdd�}|�|j|�tjdtjjd�}|�||�dS)zR
        L{Gio.Application} instances can be registered with a gireactor.
        F��useGtk�!com.twistedmatrix.trial.gireactor��application_id�flagsN)	r�	GIReactor�
addCleanup�unbuildReactorr�Application�ApplicationFlags�
FLAGS_NONEr�rrr rrr�test_gApplicationActivatePs�z7GApplicationRegistrationTests.test_gApplicationActivateNz>Gtk unavailable (may require running with X11 DISPLAY env set)cCs8t��}|�|j|�tjdtjjd�}|�	||�dS)zT
        L{Gtk.Application} instances can be registered with a gtk3reactor.
        z#com.twistedmatrix.trial.gtk3reactorr$N)
r�Gtk3Reactorr(r)rr*rr+r,rr-rrr�test_gtkApplicationActivate]s�z9GApplicationRegistrationTests.test_gtkApplicationActivatecCs<t��}|�|j|�tjdtjjd�}|�t	|j
|�dS)zo
        L{gireactor.PortableGIReactor} doesn't support application
        registration at this time.
        r#r$N)r�PortableGIReactorr(r)rr*r+r,�assertRaises�NotImplementedErrorrr-rrr�
test_portablens�z+GApplicationRegistrationTests.test_portablecCsJtjdd�}|�|j|�t�}|�t|j|�}|�|j	d�
d��dS)zp
        Older versions of PyGObject lack C{Application.quit}, and so won't
        allow registration.
        Fr!rzApplication registration is notN)rr'r(r)�objectr2�RuntimeErrorr�
assertTrue�args�
startswith)rrr �excrrr�test_noQuit{s
z)GApplicationRegistrationTests.test_noQuitcsXtjdd�����j��tjdtjjd�����fdd�}��d|�t	�
���dS)	zp
        It is not possible to register a C{Application} after the reactor has
        already started.
        Fr!r#r$cs.��t�j��}��|jdd����dS)Nrz5Can't register application after reactor was started.)r2rrrr8r)r:�r rrrr�tryRegister�s�
�zLGApplicationRegistrationTests.test_cantRegisterAfterRun.<locals>.tryRegisterrN)rr'r(r)rr*r+r,rrr)rr=rr<r�test_cantRegisterAfterRun�s�	z7GApplicationRegistrationTests.test_cantRegisterAfterRuncCsntjdd�}|�|j|�tjdtjjd�}|�|�tjdtjjd�}|�	t
|j|�}|�|jdd�dS)	zN
        It is not possible to register more than one C{Application}.
        Fr!r#r$z"com.twistedmatrix.trial.gireactor2rz2Can't register more than one application instance.N)
rr'r(r)rr*r+r,rr2r6rr8)rrr �app2r:rrr�test_cantRegisterTwice�s�
�
�z4GApplicationRegistrationTests.test_cantRegisterTwice)
�__name__�
__module__�__qualname__�__doc__rr.rrr0r4r;r>r@rrrrr(s	
�


rc@seZdZdZdd�ZdS)�PygtkCompatibilityTestsz_
    pygtk imports are either prevented, or a compatibility layer is used if
    possible.
    cCs0dtjvr	td��ddl}|�|j�d��dS)zo
        If compatibility layer is present, importing gobject uses
        the gi compatibility layer.
        zgi.pygtkcompatz/This version of gi doesn't include pygtkcompat.rNzgi.)�sys�modulesr	�gobjectr7rAr9)rrHrrr�test_compatibilityLayer�s
z/PygtkCompatibilityTests.test_compatibilityLayerN)rArBrCrDrIrrrrrE�srE)rDrF�unittestr�
gi.repositoryr�twisted.internetr�
_gireactor�ImportErrorr�_gtk3reactorr�twisted.internet.errorr�#twisted.internet.test.reactormixinsr�twisted.trial.unittestr	r
�skiprrErrrr�<module>s4��

Anon7 - 2022
AnonSec Team