403Webshell
Server IP : 209.205.66.10  /  Your IP : 216.73.216.173
Web Server : Apache/2.4.52 (Ubuntu)
System : Linux ammon 5.15.0-186-generic #196-Ubuntu SMP Sat Jun 20 16:09:34 UTC 2026 x86_64
User :  ( 1006)
PHP Version : 8.5.8
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /lib/python3/dist-packages/xdg/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/xdg/__pycache__/DesktopEntry.cpython-310.pyc
o

�stZ6D�@s`dZddlmZmZddlZddlmZddlm	Z	ddl
ZddlZddl
Z
Gdd�de�ZdS)a/
Complete implementation of the XDG Desktop Entry Specification
http://standards.freedesktop.org/desktop-entry-spec/

Not supported:
- Encoding: Legacy Mixed
- Does not check exec parameters
- Does not check URL's
- Does not completly validate deprecated/kde items
- Does not completly check categories
�)�IniFile�is_asciiN)�ParsingError)�whichc@s�eZdZdZdZdrdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�Zd6d7�Zd8d9�Zd:d;�Z d<d=�Z!d>d?�Z"d@dA�Z#dBdC�Z$dDdE�Z%dFdG�Z&dHdI�Z'dJdK�Z(dLdM�Z)dNdO�Z*dPdQ�Z+dRdS�Z,dTdU�Z-dVdW�Z.dXdY�Z/dZd[�Z0d\d]�Z1d^d_�Z2d`da�Z3dbdc�Z4ddde�Z5dfdg�Z6dhdi�Z7djdk�Z8dldm�Z9dndo�Z:dpdq�Z;dS)s�DesktopEntryz+Class to parse and validate Desktop Entries�
Desktop EntryNcCs<t�|_|rtj�|�r|�|�dS|r|�|�dSdS)z�Create a new DesktopEntry.
        
        If filename exists, it will be parsed as a desktop entry file. If not,
        or if filename is None, a blank DesktopEntry is created.
        N)�dict�content�os�path�exists�parse�new)�self�filename�r�2/usr/lib/python3/dist-packages/xdg/DesktopEntry.py�__init__s�zDesktopEntry.__init__cCs|��S�N)�getName�rrrr�__str__&szDesktopEntry.__str__cCst�||ddg�dS)z�Parse a desktop entry file.
        
        This can raise :class:`~xdg.Exceptions.ParsingError`,
        :class:`~xdg.Exceptions.DuplicateGroupError` or
        :class:`~xdg.Exceptions.DuplicateKeyError`.
        r�KDE Desktop EntryN)rr
)r�filerrrr
)szDesktopEntry.parsecCs|jddd�}t|�S)z�Looks in the PATH for the executable given in the TryExec field.
        
        Returns the full path to the executable if it is found, None if not.
        Raises :class:`~xdg.Exceptions.NoKeyError` if TryExec is not present.
        �TryExecT)�strict)�getr)r�tryexecrrr�findTryExec2szDesktopEntry.findTryExeccC�
|�d�S)N�Type�rrrrr�getType<�
zDesktopEntry.getTypecC�|jddd�S)z)deprecated, use getVersionString instead �Version�numeric��typer!rrrr�
getVersion>szDesktopEntry.getVersioncCr)Nr%r!rrrr�getVersionStringAr#zDesktopEntry.getVersionStringcCr$)N�NameT��localer!rrrrrC�zDesktopEntry.getNamecCr$)N�GenericNameTr,r!rrrr�getGenericNameEr.zDesktopEntry.getGenericNamecCr$)N�	NoDisplay�booleanr'r!rrrr�getNoDisplayGr.zDesktopEntry.getNoDisplaycCr$)N�CommentTr,r!rrrr�
getCommentIr.zDesktopEntry.getCommentcCr$)N�IconTr,r!rrrr�getIconKr.zDesktopEntry.getIconcCr$)N�Hiddenr2r'r!rrrr�	getHiddenMr.zDesktopEntry.getHiddencCr$)N�
OnlyShowInT��listr!rrrr�
getOnlyShowInOr.zDesktopEntry.getOnlyShowIncCr$)N�	NotShowInTr;r!rrrr�getNotShowInQr.zDesktopEntry.getNotShowIncCr)Nrr!rrrr�
getTryExecSr#zDesktopEntry.getTryExeccCr)N�Execr!rrrr�getExecUr#zDesktopEntry.getExeccCr)N�Pathr!rrrr�getPathWr#zDesktopEntry.getPathcCr$)N�Terminalr2r'r!rrrr�getTerminalYr.zDesktopEntry.getTerminalcCs|jdddd�S)z%deprecated, use getMimeTypes instead �MimeTypeT�regex)r<r(r!rrrr�getMimeType[szDesktopEntry.getMimeTypecCr$)NrGTr;r!rrrr�getMimeTypes^r.zDesktopEntry.getMimeTypescCr$)N�
CategoriesTr;r!rrrr�
getCategories`r.zDesktopEntry.getCategoriescCr$)N�
StartupNotifyr2r'r!rrrr�getStartupNotifybr.zDesktopEntry.getStartupNotifycCr)N�StartupWMClassr!rrrr�getStartupWMClassdr#zDesktopEntry.getStartupWMClasscCr)N�URLr!rrrr�getURLfr#zDesktopEntry.getURLcCr$)N�ServiceTypesTr;r!rrrr�getServiceTypeskr.zDesktopEntry.getServiceTypescCr)N�DocPathr!rrrr�
getDocPathmr#zDesktopEntry.getDocPathcCs|jdddd�S)N�KeywordsT)r<r-r!rrrr�getKeywordsoszDesktopEntry.getKeywordscCr)N�InitialPreferencer!rrrr�getInitialPreferenceqr#z!DesktopEntry.getInitialPreferencecCr)N�Devr!rrrr�getDevsr#zDesktopEntry.getDevcCr)N�FSTyper!rrrr�	getFSTypeur#zDesktopEntry.getFSTypecCr)N�
MountPointr!rrrr�
getMountPointwr#zDesktopEntry.getMountPointcCr$)N�ReadOnlyr2r'r!rrrr�getReadonlyyr.zDesktopEntry.getReadonlycCr$)N�UnmountIconTr,r!rrrr�getUnmountIcon{r.zDesktopEntry.getUnmountIconcCr$)N�MiniIconTr,r!rrrr�getMiniIcon�r.zDesktopEntry.getMiniIconcCr)N�TerminalOptionsr!rrrr�getTerminalOptions�r#zDesktopEntry.getTerminalOptionscCr)N�
DefaultAppr!rrrr�
getDefaultApp�r#zDesktopEntry.getDefaultAppcCr$)N�	ProtocolsTr;r!rrrr�getProtocols�r.zDesktopEntry.getProtocolscCr$)N�
ExtensionsTr;r!rrrr�
getExtensions�r.zDesktopEntry.getExtensionscCr)N�
BinaryPatternr!rrrr�getBinaryPattern�r#zDesktopEntry.getBinaryPatterncCr)N�	MapNotifyr!rrrr�getMapNotify�r#zDesktopEntry.getMapNotifycCr)N�Encodingr!rrrr�getEncoding�r#zDesktopEntry.getEncodingcCr$)N�SwallowTitleTr,r!rrrr�getSwallowTitle�r.zDesktopEntry.getSwallowTitlecCr)N�SwallowExecr!rrrr�getSwallowExec�r#zDesktopEntry.getSwallowExeccCr$)N�	SortOrderTr;r!rrrr�getSortOrder�r.zDesktopEntry.getSortOrdercCr$)N�FilePatternrHr'r!rrrr�getFilePattern�r.zDesktopEntry.getFilePatterncCr$)N�ActionsTr;r!rrrr�
getActions�r.zDesktopEntry.getActionscCshtj�|�ddkr
d}ntj�|�ddkrd}ntd|��t�|_|�|j�|�d|�||_	dS)	a$Make this instance into a new, blank desktop entry.
        
        If filename has a .desktop extension, Type is set to Application. If it
        has a .directory extension, Type is Directory. Other extensions will
        cause :class:`~xdg.Exceptions.ParsingError` to be raised.
        ��.desktop�Application�
.directory�	DirectoryzUnknown extensionr N)
r
r�splitextrrr	�addGroup�defaultGroup�setr)rrr(rrrr�s

zDesktopEntry.newcCs�|jdkr|j�d�|jdkr|j�d�n|jdkr'|jdkr'|j�d�z|j|jd|_WntyA|j�d	�Ynwz|j|jd
|_WdSty^|j�d�YdSw)Nrz([KDE Desktop Entry]-Header is deprecatedz.kdelnkz$File extension .kdelnk is deprecatedr�r�zUnknown File extensionr zKey 'Type' is missingr+zKey 'Name' is missing)	r��warnings�append�
fileExtensionr	r(�KeyError�errors�namerrrr�checkExtras�s 

��zDesktopEntry.checkExtrascCsr||jkst�d|�st�d|�rt|�s|j�d|�dSd|j|vr5d|j|vr7|j�d�dSdSdS)Nz^Desktop Action [a-zA-Z0-9-]+$z^X-zInvalid Group name: %sr:r>z;Group may either have OnlyShowIn or NotShowIn, but not both)r��re�matchrr�r�r	)r�grouprrr�
checkGroup�s

�
���zDesktopEntry.checkGroupcCs�|dkr�|dks|dks|dkr|j�d|�n|dkr$|j�d�n|dks8|d	ks8|d
ks8|j�d|�|jdkrJ|d
ksJ|j�d
|�n|jdkrY|d
krY|j�d�|dkrjd|j|vrj|j�d�|d	kr}d|j|vr|j�d�dSdSdS|dkr�|�||�dSt�dtj	j
d|�r�dSt�dtj	j
d|�r�dS|dkr�|j||dd�dSt�dtj	j
d|�r�dSt�dtj	j
d|�r�|�||�dS|dkr�|j||dd�dS|dkr�|j||dd �|�|�dS|d!k�r|j||dd �|�|�dS|d"k�r!|�||�|�|d�dS|dk�r4|�||�|�|d�dS|d#k�rG|�||�|�|d�dS|d$k�r\|j||dd�|�|d�dS|d%k�rq|j||dd �|�|d�dS|dk�r�|j||dd �|�|d�dS|d&k�r�|�||�|�|d�|�
|�dSt�d'tj	j
d|��r�|j||d(dd)�|�|d�dS|d*k�r�|j||dd�|�|d�dS|d+k�r�|�|d�dS|dk�r�|�||�|�|d�dS|d,k�r|j||dd �|j�d-|�dS|d.k�r|�||�|j�d-|�dS|d/k�r4|j||d0d�|j�d-|�dS|d1k�rO|�||�|�|d�|j�d-|�dS|d2k�rj|�||�|�|d�|j�d-|�dS|d3k�r�|�||�|�|d�|j�d-|�dS|d4k�r�|j||dd�|�|d�|j�d-|�dSt�d5tj	j
d|��r�|�||�|�|d�|j�d-|�dS|d6k�r�|�||�|j�d7|�dSt�d8tj	j
d|��r�|�||�|j�d7|�dS|d9k�r|�||�|j�d7|�dS|d:k�r!|�||�|j�d7|�dS|d;k�r8|j||dd �|j�d7|�dS|d<k�rO|j||dd �|j�d7|�dS|d=k�rd|�||�|j�d7|�dS|d>k�ry|�||�|j�d7|�dSt�d?tj	j
d|��r�|j�d7|�dS|d@k�r�|�||�|j�d7|�dS|dAk�r�|j||dBdd)�|j�d7|�dS|dCk�r�|j||dd �|j�d7|�dSt�dD|��r�dS|j�dE|�dS)FNr �ServiceType�Service�FSDevicezType=%s is a KDE extensionrGzType=MimeType is deprecatedr��Linkr�zGValue of key 'Type' must be Application, Link or Directory, but is '%s'r�z.File extension is .directory, but Type is '%s'r�z>Files with Type=Directory should have the extension .directoryrAz!Type=Application needs 'Exec' keyrQzType=Link needs 'URL' keyr%z^Name�$z^GenericNamer1r2r'z^Commentz^Iconr8r:Tr;r>rrCrEr}rKz	^Keywords�localestring)r(r<rMrOrSzKey '%s' is a KDE extensionrUrYr&r[r]r_raz^UnmountIconrszKey '%s' is deprecatedz	^MiniIconrgrirkrmrorqz
^SwallowTitlerwr{rHryz^X-[a-zA-Z0-9-]+zInvalid key: %s)r�r�r�r�r	�
checkValuer�r��xdg�LocalerH�checkOnlyShowIn�	checkType�checkCategories)r�key�valuer�rrr�checkKey�s�



























zDesktopEntry.checkKeycCs(|��|ks|j�d||f�dSdS)Nz Key '%s' only allowed in Type=%s)r"r�r�)rr�r(rrrr��s�zDesktopEntry.checkTypecCsH|�|�}gd�}|D]}||vr!|dd�dkr!|j�d|�qdS)N)
�GNOME�KDE�LXDE�MATE�Razor�ROX�TDE�Unity�XFCE�Oldr��X-z)'%s' is not a registered OnlyShowIn value)�getListr�r�)rr��values�valid�itemrrrr��s
��zDesktopEntry.checkOnlyShowIncst|�|�}gd��t�fdd�|D��s|j�d�gd�}|�}|D]}||vr7|�d�s7|j�d|�q$dS)N)
�
AudioVideo�Audio�Video�Development�	Education�Game�Graphics�Network�Office�Science�Settings�System�Utilityc3s�|]}|�vVqdSrr)�.0r���mainrr�	<genexpr>�s�z/DesktopEntry.checkCategories.<locals>.<genexpr>zMissing main category)~�Building�Debugger�IDE�GUIDesigner�	Profiling�RevisionControl�Translation�Calendar�ContactManagement�Database�
Dictionary�Chart�Email�Finance�	FlowChart�PDA�ProjectManagement�Presentation�Spreadsheet�
WordProcessor�
2DGraphics�VectorGraphics�RasterGraphics�
3DGraphics�Scanning�OCR�Photography�
Publishing�Viewer�	TextTools�DesktopSettings�HardwareSettings�Printing�PackageManager�Dialup�InstantMessaging�Chat�	IRCClient�Feed�FileTransfer�HamRadio�News�P2P�RemoteAccess�	Telephony�TelephonyTools�VideoConference�
WebBrowser�WebDevelopment�Midi�Mixer�	Sequencer�Tuner�TV�AudioVideoEditing�Player�Recorder�DiscBurning�
ActionGame�
AdventureGame�
ArcadeGame�	BoardGame�
BlocksGame�CardGame�KidsGame�	LogicGame�RolePlaying�Shooter�
Simulation�
SportsGame�StrategyGame�Art�Construction�Music�	Languages�ArtificialIntelligence�	Astronomy�Biology�	Chemistry�ComputerScience�DataVisualization�Economy�Electricity�	Geography�Geology�
Geoscience�History�
Humanities�ImageProcessing�
Literature�Maps�Math�NumericalAnalysis�MedicalSoftware�Physics�Robotics�Spirituality�Sports�ParallelComputing�	Amusement�	Archiving�Compression�Electronics�Emulator�Engineering�	FileTools�FileManager�TerminalEmulator�
Filesystem�Monitor�Security�
Accessibility�
Calculator�Clock�
TextEditor�
Documentation�Adult�Corer�r�r��GTK�Qt�Motif�Java�ConsoleOnlyr�z!'%s' is not a registered Category)r��anyr�r��
startswith)rr�r��
additional�
allcategoriesr�rr�rr��s
��zDesktopEntry.checkCategoriescCst�dt�|�|�S)z`Deprecated alias for checkCategories - only exists for backwards
        compatibility.
        z1checkCategorie is deprecated, use checkCategories)r��warn�DeprecationWarningr�)rr�rrr�checkCategorie�s�
zDesktopEntry.checkCategorier)<�__name__�
__module__�__qualname__�__doc__r�rrr
rr"r)r*rr0r3r5r7r9r=r?r@rBrDrFrIrJrLrNrPrRrTrVrXrZr\r^r`rbrdrfrhrjrlrnrprrrtrvrxrzr|r~rr�r�r�r�r�r�rDrrrrrsv
	
=r)rH�xdg.IniFilerr�
xdg.Localer��xdg.Exceptionsr�xdg.utilr�os.pathr
r�r�rrrrr�<module>s

Youez - 2016 - github.com/yon3zu
LinuXploit