관리-도구
편집 파일: debug.cpython-39.pyc
a �&c1 � @ s� d dl mZ d dl mZ d dlmZ d dlmZmZ d dlZd dl Zd dl Z d dlZd dlZd dl Z d dlZd dlZdZG dd� dej�ZG d d � d ejj�ZG dd� dejj�Zd d� Zdd� Zdd� ZdS )� )�absolute_import)�unicode_literals��ucd)�_�loggerNzdnf-debug-dump version 1 c s e Zd ZdZ� fdd�Z� ZS )�Debug�debugc sD t t| ��||� || _|| _| jd ur@| j�t� | j�t� d S �N)�superr �__init__�base�cliZregister_command�DebugDumpCommand�DebugRestoreCommand)�selfr r �� __class__� �5/usr/lib/python3.9/site-packages/dnf-plugins/debug.pyr ) s zDebug.__init__)�__name__� __module__�__qualname__�namer � __classcell__r r r r r % s r c st e Zd ZdZed�Z� fdd�Zdd� Zedd� �Z d d � Z dd� Zd d� Zdd� Z dd� Zdd� Zdd� Z� ZS )r )z debug-dumpz5dump information about installed rpm packages to filec s t t| ��|� d | _d S r )r r r � dump_file)r r r r r r 7 s zDebugDumpCommand.__init__c C s d| j j_d| j j_d S �NT)r �demands�sack_activation�available_repos�r r r r � configure; s zDebugDumpCommand.configurec C s. | j dddtd�d� | j ddtd�d � d S ) Nz --norepos� store_trueFz/do not attempt to dump the repository contents.)�action�default�help�filename�?zoptional name of dump file��nargsr% ��add_argumentr ��parserr r r � set_argparser? s ��zDebugDumpCommand.set_argparserc C s� | j j}|s6t�dt�t�� ��}dt�� d |f }tj�|�}|� d�r\t �|d�| _nt |d�| _| �t� | �� | �� | �� | �| j j � | �� | j�� ttd�| � dS )z{create debug txt file and compress it, if no filename specified use dnf_debug_dump-<timestamp>.txt.gz by defaultz%Y-%m-%d_%Tzdnf_debug_dump-%s-%s.txt.gz� �.gz�wzOutput written to: %sN)�optsr&