HEX
Server: Apache
System: Linux pdx1-shared-a1-38 6.6.104-grsec-jammy+ #3 SMP Tue Sep 16 00:28:11 UTC 2025 x86_64
User: mmickelson (3396398)
PHP: 8.1.31
Disabled: NONE
Upload Files
File: //usr/lib/python3/dist-packages/devscripts/__pycache__/control.cpython-310.pyc
o

���a��@sndZddlZddlZddlmZzddlZWney)e�d�e�	d�Ynwdd�Z
Gdd	�d	�ZdS)
z>This module implements facilities to deal with Debian control.�N)�Loggerz=Please install 'python3-debian' in order to use this utility.�cCs�z|jWn	tyYnw|||<z	|�||�WdSty&YdSwd}|D]}|r8|�|�}|||<||krBd}|||<q+|sK|||<dSdS)zeInsert new_item into directly after item_before

       New items added to a dictionary are appended.NFT)�order_after�AttributeError�KeyError�pop)�	paragraph�item_before�new_item�	new_value�
item_found�item�value�r�4/usr/lib/python3/dist-packages/devscripts/control.py�
_insert_after s2
���
��rc@sJeZdZdZdd�Zdd�Zdd�Zdd	d
�Zdd�Zd
d�Z	dd�Z
dS)�Controlz Represents a debian/control filecCsvtj�|�sJd|��||_g|_t|dd��}tjj�	|�D]}|j�
|�q Wd�dS1s4wYdS)Nz%s does not exist.�utf8)�encoding)�os�path�isfile�filename�
paragraphs�open�debian�deb822�Deb822�iter_paragraphs�append)�selfr�sequencerrrr�__init__Bs�"�zControl.__init__cC�|jd�d�S)z*Returns the value of the Maintainer field.r�
Maintainer�r�get�r rrr�get_maintainerJ�zControl.get_maintainercCr#)z8Returns the value of the XSBC-Original-Maintainer field.r�XSBC-Original-Maintainerr%r'rrr�get_original_maintainerNr)zControl.get_original_maintainerNcCsb|r||_d�dd�|jD��}t|jd��}|�|�d��Wd�dS1s*wYdS)zSaves the control file.�
cS�g|]}|���qSr)�dump)�.0�xrrr�
<listcomp>V�z Control.save.<locals>.<listcomp>�wbzutf-8N)r�joinrr�write�encode)r r�content�control_filerrr�saveRs"�zControl.savecCs||jdd<dS)z'Sets the value of the Maintainer field.rr$N)r)r �
maintainerrrr�set_maintainerZszControl.set_maintainercCs8d|jdvr||jdd<dSt|jddd|�dS)z5Sets the value of the XSBC-Original-Maintainer field.r*rr$N)rr)r �original_maintainerrrr�set_original_maintainer^s
�zControl.set_original_maintainercCs@|jD]}|D]}||�d�}d�dd�|D��||<qqdS)z1Strips all trailing spaces from the control file.r,cSr-r)�rstrip)r/�linerrrr1kr2z1Control.strip_trailing_spaces.<locals>.<listcomp>N)r�splitr4)r rr
�linesrrr�strip_trailing_spacesfs
��zControl.strip_trailing_spaces)N)�__name__�
__module__�__qualname__�__doc__r"r(r+r9r;r=rBrrrrr?s
r)rFr�sys�devscripts.loggerr�
debian.deb822r�ImportError�error�exitrrrrrr�<module>s��