Spamworldpro Mini Shell
Spamworldpro


Server : Apache/2.4.52 (Ubuntu)
System : Linux webserver 6.8.0-49-generic #49~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Wed Nov 6 17:42:15 UTC 2 x86_64
User : www-data ( 33)
PHP Version : 8.1.2-1ubuntu2.21
Disable Function : NONE
Directory :  /lib/python3/dist-packages/xkit/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/xkit/__pycache__/xutils.cpython-310.pyc
o

p��O��@s<ddlmZddlmZddlTddlZGdd�de�ZdS)�)�print_function)�unicode_literals�)�*NcsdeZdZdZd�fdd�	Zdd�Zdd�Zd	d
�Zddd�Zd
d�Z	dd�Z
dd�Zdd�Z�Z
S)�XUtilsz[Subclass with higher-level methods
    
    See xorgparser.Parser for the low-level methodsNcstt|��|�dS�N)�superr�__init__)�self�source��	__class__��-/usr/lib/python3/dist-packages/xkit/xutils.pyr	szXUtils.__init__cCs2|��}|D]}||D]	}|j||d�qqdS)z.Fix broken references to non-existent sections)�
identifierN)�get_broken_references�make_section)r
�broken_references�section�	referencerrr�fix_broken_references s��zXUtils.fix_broken_referencescCsd}|�|||�S)z�Get the driver in use in a section

        If no driver is found it will return False.

        For further information see get_value()�Driver)�	get_value)r
r�position�optionrrr�
get_driver'szXUtils.get_drivercCsd}|j||||d�dS)z"Set the driver in use in a sectionr)rN)�
add_option)r
r�driverrrrrr�
set_driver0szXUtils.set_driverc	CsZ|dkr
t|jd���}|D]}z|�d|�|krWdSWqty*YdSwdS)z�Look for a driver in the Device sections

        Return True if the driver is found in each of the specified
        sections, otherwise return False.

        if sections_list == None check all the Device sectionsN�DeviceFT)�list�
globaldict�keysr�OptionException)r
r�
sections_listrrrr�section_has_driver5s��zXUtils.section_has_driverc		Cs�g}|�d|dg�}t|d�dkrP|dD]9}z|�d|�}Wn	ty)Yqwz|�d|dg�}|dD]
}|�d|�}|�|�q7WqtyOYqw|S)z�Return a list of references to the Device sections in ServerLayout
        
        This method looks for references to Device sections in the Screen
        sections referred to in the ServerLayout[position] section.�ServerLayout�Screenrr)�get_references�len�get_position�IdentifierException�appendr#)	r
r�devices_to_check�
referencesr�screen_position�device_references�device�device_positionrrr�get_devices_in_serverlayoutHs*����z"XUtils.get_devices_in_serverlayoutc	Cs�g}d}|jd}|jd}t|�}t|�}|dkrS|dkrN|dkrA|��}t|�dkr4|�|d�}n|D]	}||�|�7}q6n|D]	}||�|�7}qCn|�d�}t|�dkrbt|jd���}|S)a�Return the Device sections in use

        If no Device sections are referenced in ServerLayout then all of
        the available Device sections are returned.

        This method supports old Xinerama setups and therefore looks for
        references to Device sections in the ServerLayout section(s) and
        checks only the default ServerLayout section provided than one is
        set in the ServerFlags section.Fr&�ServerFlagsrrr)r!r)�get_default_serverlayoutr3r r")	r
r-�driver_enabled�serverlayout�serverflags�serverlayout_length�serverflags_length�default�layoutrrr�get_devices_in_useds6


	�����
zXUtils.get_devices_in_usecCs|��}|j||d�}|S)a�See if a driver is enabled in the Device sections

        When possible, this method checks only the Device sections in use,
        otherwise it checks any available Device section.

        This method supports old Xinerama setups and therefore looks for
        references to Device sections in the ServerLayout section(s) and
        checks only the default ServerLayout section provided than one is
        set in the ServerFlags section.)r$)r=r%)r
rr-r6rrr�is_driver_enabled�s

�zXUtils.is_driver_enabledcCsli}d}|jdD]*}|jd|dgd�}|dd}|�d|�}|�|�i||<|||d<|d7}q	|S)z>See which Screen sections are related to which Device sectionsrr'r)�reflistr)r!r(r*�
setdefault)r
�
relationships�it�screenr.r1rrr�get_screen_device_relationships�s

z&XUtils.get_screen_device_relationshipsr)�__name__�
__module__�__qualname__�__doc__r	rrrr%r3r=r>rD�
__classcell__rrrrrs	
3r)�
__future__rr�
xorgparser�sys�Parserrrrrr�<module>s


Spamworldpro Mini