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/NvidiaDetector/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/NvidiaDetector/__pycache__/alternatives.cpython-310.pyc
o

��f��@sHddlZddlZddlmZmZmZGdd�de�ZGdd�de�ZdS)�N)�Popen�PIPE�CalledProcessErrorc@s4eZdZdd�Zdd�Zdd�Zdd�Zd	d
�ZdS)�MultiArchUtilscCs`ddd�|_|��|_t|j���tt|j����|j��|_tj	�
d�s.dtj	d<dSdS)N�i386�x86_64)r�amd64�PATH�/sbin:/usr/sbin:/bin:/usr/bin)�_supported_architectures�_get_architecture�
_main_arch�list�values�int�index�_other_arch�os�environ�get��self�r�=/usr/lib/python3/dist-packages/NvidiaDetector/alternatives.py�__init__s
��zMultiArchUtils.__init__cCsFtdd�}tddgt|dd�}|��d}|��|��}|j�|�S)N�	/dev/null�w�dpkgz--print-architectureT��stdout�stderr�universal_newlinesr)�openrr�communicate�close�striprr)r�dev_null�p1�p�architecturerrrr(s

�z MultiArchUtils._get_architecturecCsd|}|S)Nz%s-linux-gnu_gl_confr)rr)�alternativerrr�_get_alternative_name_from_arch1sz.MultiArchUtils._get_alternative_name_from_archcC�|�|j�S�N)r+r
rrrr�get_main_alternative_name5�z(MultiArchUtils.get_main_alternative_namecCr,r-)r+rrrrr�get_other_alternative_name8r/z)MultiArchUtils.get_other_alternative_nameN)�__name__�
__module__�__qualname__rrr+r.r0rrrrrs	rc@s^eZdZdd�Zdd�Zdd�Zddd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�ZdS)�AlternativescCs6d|_d|_d|_||_tj�d�sdtjd<dSdS)Nzmesa/ld.so.confzmesa-egl/ld.so.confzupdate-alternativesr	r
)�_open_drivers_alternative�_open_egl_drivers_alternative�_command�_master_linkrrr)r�master_linkrrrr>s�zAlternatives.__init__cCsjtdd�}g}t|jd|jgt|dd�}|��d}|��|�d�}|D]
}|��o1|�	|���q%|S)z0Get the list of alternatives for the master linkrrz--listTrr�
)
r"rr7r8rr#r$�splitr%�append)rr&�alternativesr'r(�c�linerrr�list_alternativesHs
�
�zAlternatives.list_alternativescCsrtdd�}t|jd|jgt|dd�}|��d}|��|�d�}|D]}|���	d�r6|�
dd	���Sq#d
S)zGet the alternative in userrz--queryTrrr:zValue:�N)r"rr7r8rr#r$r;r%�
startswith�replace)rr&r'r(r>r?rrr�get_current_alternativeVs
�
�z$Alternatives.get_current_alternativeNcCs@|r|�|d�}|��}|D]}|�d�d|kr|SqdS)zuGet the alternative link by providing the driver name

        ignore_pattern allows ignoring a substring in the namerA�/���N)rCr@r;)r�name�ignore_patternr=r*rrr�get_alternative_by_namecs�z$Alternatives.get_alternative_by_namecCr,)z)Get the alternative link for open drivers)rIr5rrrr�get_open_drivers_alternativeq�z)Alternatives.get_open_drivers_alternativecCr,)z2Get the alternative link for open EGL/GLES drivers)rIr6rrrr� get_open_egl_drivers_alternativeurKz-Alternatives.get_open_egl_drivers_alternativec	Cs<zt�gd��t�gd��WdSttfyYdSw)z8Trigger gmenu so that the icons will show up in the menu)zdpkg-triggerz--by-package=fakepackage�
gmenucache)rz--configurez-aN)�
subprocess�
check_call�OSErrorrrrrr�update_gmenuys�zAlternatives.update_gmenucCsDzt�|jd|j|g�|��Wn
tyYdSw|��dS)z?Tries to set an alternative and returns the boolean exit statusz--setFT)rNrOr7r8�ldconfigrrQ)r�pathrrr�set_alternative�s
��zAlternatives.set_alternativecCs(z	t�dg�WdStyYdSw)z
Call ldconfigrRFT)rNrOrrrrrrR�s��zAlternatives.ldconfigcCsjtdd�}tdd|gt|dd�}|��d}|��|�d�}|D]}|���d	�r-d
S|��Sd
S)z0Get the 1st kernel module name matching an aliasrr�modprobez--resolve-aliasTrrr:zUsage:N)r"rrr#r$r;r%rB)r�aliasr&r'r(r>r?rrr�resolve_module_alias�s
�
z!Alternatives.resolve_module_aliasr-)
r1r2r3rr@rDrIrJrLrQrTrRrWrrrrr4<s


	
r4)rrNrrr�objectrr4rrrr�<module>s
!

Spamworldpro Mini