File manager - Edit - /usr/lib/python3/dist-packages/landscape/lib/apt/package/__pycache__/skeleton.cpython-310.pyc
Back
o ���c� � @ s� d dl mZmZ d dlmZ d dlZdZdZdZdZ dZ d eB Zd eB ZdeB Z deB Zd eB Zde B Zde B ZG dd� de�ZG dd� de�Zdd� Z ddd�Zddd�ZdS )� )�unicode�_PY3)�sha1N� � � � � i i i i i i i c @ s e Zd ZdZdS )�PackageTypeErrorzDRaised when an unsupported package type is passed to build_skeleton.N)�__name__� __module__�__qualname__�__doc__� r r �D/usr/lib/python3/dist-packages/landscape/lib/apt/package/skeleton.pyr s r c @ sD e Zd ZdZdZdZdZdZdZdd� Z dd� Z dd� Zdd � ZdS ) �PackageSkeletonNc C s || _ || _|| _g | _d S �N)�type�name�version� relations)�selfr r r r r r �__init__# s zPackageSkeleton.__init__c C s | j �||f� d S r )r �append)r r �infor r r �add_relation) s zPackageSkeleton.add_relationc C sp | j dur| j S d| j| j| jf �d�}t|�}| j�� | jD ]}|�d|d |d f �d�� q!|� � S )z�Calculate the package hash. If C{set_hash} has been used, that hash will be returned and the hash won't be the calculated value. Nz [%d %s %s]�asciiz[%d %s]r r ) �_hashr r r �encoder r �sort�update�digest)r �package_infor! �pairr r r �get_hash, s � �zPackageSkeleton.get_hashc C s || _ dS )aZ Set the hash to an explicit value. This should be used when the hash is previously known and can't be calculated from the relations anymore. The only use case for this is package resurrection. We're planning on getting rid of package resurrection, and this code can be removed when that is done. N)r )r �package_hashr r r �set_hash? s zPackageSkeleton.set_hash) r r r �section�summary�description�size�installed_sizer r r r$ r&