관리-도구
편집 파일: __init__.cpython-36.pyc
3 �`g� � @ s� d Z ddlZddlT ddlT ddljZejZejZejZejZej Z e e jd��Zyddl T W n ek rr Y nX yddlT W n ek r� Y nX eZdd� Zdd� Zdd d�Zddd �Zdd� Zdd� Zdefdd�ZdS )aK RPM Module This module enables you to manipulate rpms and the rpm database. The rpm base module provides the main starting point for accessing RPM from Python. For most usage, call the TransactionSet method to get a transaction set (rpmts). For example: import rpm ts = rpm.TransactionSet() The transaction set will open the RPM database as needed, so in most cases, you do not need to explicitly open the database. The transaction set is the workhorse of RPM. You can open another RPM database, such as one that holds all packages for a given Linux distribution, to provide packages used to solve dependencies. To do this, use the following code: rpm.addMacro('_dbpath', '/path/to/alternate/database') solvets = rpm.TransactionSet() solvets.openDB() rpm.delMacro('_dbpath') # Open default database ts = rpm.TransactionSet() This code gives you access to two RPM databases through two transaction sets (rpmts): ts is a transaction set associated with the default RPM database and solvets is a transaction set tied to an alternate database, which is very useful for resolving dependencies. � N)�*�.c O s t jdtdd� t| |�S )z"DEPRECATED! Use rpm.hdr() instead.zUse rpm.hdr() instead.� )� stacklevel)�warnings�warn�DeprecationWarning�hdr)�args�kwds� r � /usr/lib64/python3.6/__init__.py� headerLoadA s r c C sL g }xBy$t | �}|r|jt� |j|� W q tjk rB P Y qX qW |S )N)r ZconvertZHEADERCONV_RETROFIT_V3�append�_rpm�error)Zrpm_fd�retrofit�hlist�hr r r �_doHeaderListFromFDG s r Tc C s t | t�st| �} t| |�S )N)� isinstance�fdr )� file_descr r r r �readHeaderListFromFDU s r c C s t | �}t||�}|j� |S )N)r r �close)�pathr �fr r r r �readHeaderListFromFile[ s r c C sR t | t�st| �} y| j� }t| �}W n" tjtfk rH d}d}Y nX ||fS )zReturn (header, pos_before_hdr)N)r r �tellr r r �IOError)r �offsetr r r r �readHeaderFromFDb s r! c C s( g }x| D ]}t |�r |j|� q W |S )z)Returns list of signals that were caught.)ZsignalCaughtr )ZsiglistZcaughtZsigr r r � signalsCaughtp s r"