403Webshell
Server IP : 3.96.16.70  /  Your IP : 216.73.216.15
Web Server : Apache
System : Linux ip-172-31-26-103.ca-central-1.compute.internal 6.1.163-186.299.amzn2023.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Feb 24 16:35:42 UTC 2026 x86_64
User : ec2-user ( 1000)
PHP Version : 8.4.18
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /lib/python3.9/site-packages/dnf/cli/commands/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3.9/site-packages/dnf/cli/commands/__pycache__/shell.cpython-39.opt-1.pyc
a

�!cl&�@s�ddlmZddlmZmZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZe	�d�Z
Gdd�de�ZGdd�dejej�ZdS)	�)�commands)�_�ucdN�dnfc@seZdZdZdZdZdZdS)�ShellDemandSheetTN)�__name__�
__module__�__qualname__Zavailable_reposZ	resolvingZ	root_userZsack_activation�r
r
�:/usr/lib/python3.9/site-packages/dnf/cli/commands/shell.pyr%src@s�eZdZdZed�jejjd�Z	ddddddddd	d
d�
Z
dd
�Zedd��Z
dd�Zdd�Zdd�Zdd�Zd)dd�Zd*dd�Zd+dd�Zd,dd �Zd!d"�Zd-d#d$�Zd.d%d&�Zd/d'd(�ZdS)0�ShellCommand)�shell�shzrun an interactive {prog} shell��prog�repo�quitZts_run�transaction�config�resolve�help)
r�
repository�exitr�run�tsrr�
resolvedeprcCs$tj�||�tj�|�d|_dS)Nz> )r�Command�__init__�cmd�Cmd�prompt)�self�clir
r
rr=szShellCommand.__init__cCs*|jddtd�td�jtjjd�d�dS)N�script�?ZSCRIPTzScript to run in {prog} shellr)�nargs�metavarr)�add_argumentr�formatr�util�MAIN_PROG_UPPER)�parserr
r
r�
set_argparserBs
��zShellCommand.set_argparserc
Csl|jj}t�|j_t|�D]L}|�d�r*qzt|jj|�Wqtydt|jj|t||��Yq0qdS)N�__)r"�demandsr�dir�
startswith�getattr�AttributeError�setattr)r!Zdefault_demands�attrr
r
r�	configureHs

zShellCommand.configurecCs$|jjr|�|jj�n|��dS�N)�optsr#�_run_scriptZcmdloop�r!r
r
rrUszShellCommand.runcCs |j��d|j_|j��dSr6)�baseZ_finalize_base�_transaction�	fill_sackr9r
r
r�_clean[s
zShellCommand._cleanc
Csh|r|dkrdS|dkrd}zt�|�}Wn|��YdS0|jjjdd�|jj�|�}|jdkrndS|j|jvr�t	|d|j|j�|dd��n�|jj
�|j�}|du�r\||j�}z|jj�||�}Wnt
y�YdS0z&t�|jj�|j_|��|��WnFtjj�yX}z(t�td	�d
t|��WYd}~dSd}~00n|��dS)N�
ZEOFrF)Zreset_usager
r��Error:� )�shlex�split�_helpr"�	optparserrZparse_main_argsZcommand�MAPPINGr1Zcli_commands�getZparse_command_args�
SystemExit�copyZdeepcopyr.r5rr�
exceptions�Error�logger�errorrr)r!�lineZs_liner7Zcmd_clsr�er
r
r�onecmd`s<
$

zShellCommand.onecmdNc	Cs�dd�}|rt|�dkr&|�d�dS|d}t|�dkrB|dnd}|�d�}|dkr�|d|�}||dd�}|jj�|�}|D]}||||�q�|s�t�td	�|�n||||jj	�dS)
NcSsP|rt|||�n:ztd�|t|t|����Wnt�td��Yn0dS)Nz{}: {}zUnsupported key value.)r3�printr(r1�strrL�warningr)�key�val�confr
r
r�print_or_set�sz*ShellCommand._config.<locals>.print_or_set�rrr?�.���zCould not find repository: %s)
�lenrD�findr:�repos�get_matchingrLrSrrV)	r!�argsrWrTrUZperiodZ	repo_namer]rr
r
r�_config�s$	


�zShellCommand._configcCs�t|t�rt|�dkr|dn|}d}|r�|dkrBtd��|�}n�|dkrZtd��|�}nv|dvrrtd��|�}n^|d	kr�td
��|�}nF|dvr�td��|�}n.|d
kr�td��|�}n|dvr�td��|�}|s�|jj��td�}td|�dS)z�Output help information.

        :param args: the command to output help information about. If
           *args* is an empty, general help will be output.
        rNrz�{} arg [value]
  arg: debuglevel, errorlevel, obsoletes, gpgcheck, assumeyes, exclude,
        repo_id.gpgcheck, repo_id.exclude
    If no value is given it prints the current value.
    If value is given it sets that value.rz{} [command]
    print help)rrz�{} arg [option]
  list: lists repositories and their status. option = [all | id | glob]
  enable: enable repositories. option = repository id
  disable: disable repositories. option = repository idrz"{}
    resolve the transaction set)rrzy{} arg
  list: lists the contents of the transaction
  reset: reset (zero-out) the transaction
  run: run the transactionrz{}
    run the transaction)rrz{}
    exit the shella�Shell specific arguments:

config                   set config options
help                     print help
repository (or repo)     enable, disable or list repositories
resolvedep               resolve the transaction set
transaction (or ts)      list, reset or run the transaction set
run                      resolve and run the transaction set
exit (or quit)           exit the shellr>)	�
isinstance�listr[rr(r"rEZ
print_helprQ)r!r_�arg�msgr
r
rrD�sF"�������
zShellCommand._helpcCs�|r|dnd}|dvr6|�dd�|dd���n�|dvr�|jjj}d}|dd�D]L}|�|�}|r|t||��d}qXt�t	d	�dt	d
�|jj
j�|��qX|r�|j�
�d|j_n
|�d�dS)Nr�rbNz	repolist rAr?)ZenableZdisableFTr@zUnknown repo: '%s'r)rP�joinr"r:r]r^r1rLZcriticalr�output�term�boldr<Z_compsrD)r!r_rr]r<r�rr
r
r�_repo�s$

�

zShellCommand._repoc
CsNz|jj�|jjj�Wn0tjjyH}zt|�WYd}~n
d}~00dSr6)	r"r:rr.Z
allow_erasingrrJZ
DepsolveErrorrQ)r!r_rOr
r
r�_resolve�szShellCommand._resolvec	Cs�zTt|d��6}|��}|D]}|�d�s|�|�qWd�n1sH0YWn8ty�t�td�|jj	j
�|��t�
d�Yn0dS)Nrj�#z!Error: Cannot open %s for readingr?)�open�	readlinesr0rP�IOErrorrL�inforr:rgrhri�sysr)r!�file�fd�linesrNr
r
rr8�s
.zShellCommand._run_scriptc
Cs�|r|dnd}|dkr$|��dS|��|dvrZ|jjr�|jj�|jj�}t�|�n||dkr�z|j��WnBt	j
jy�}z&t�t
d�dt|��WYd}~nd}~00t�t
d��|��n
|�d�dS)	Nr�resetrerr@rAz	Complete!r)r=rlr:r;rgZlist_transactionrLrqZdo_transactionrrJrKrMrrrD)r!r_r�outrOr
r
rr;	s"0
zShellCommand._transactioncCs|�dg�dS)Nr)r;�r!r_r
r
r�_ts_run"szShellCommand._ts_runcCst�td��t�d�dS)Nz
Leaving Shellr)rLrqrrrrrxr
r
r�_quit%szShellCommand._quit)N)N)N)N)N)N)N)rrr	�aliasesrr(rr)r*ZsummaryrFr�staticmethodr,r5rr=rPr`rDrkrlr8r;ryrzr
r
r
rr,s8�

&

;



r)Zdnf.clirZdnf.i18nrrZdnf.utilrrrIZloggingrBrrZ	getLoggerrL�objectrrrrr
r
r
r�<module>s


Youez - 2016 - github.com/yon3zu
LinuXploit