관리-도구
편집 파일: pygrep.cpython-38.pyc
U ,�e� � @ sf d dl mZ d dlZd dlZd dlZd dlmZ d dlmZ d dlmZ d dl m Z d dl mZ d dlm Z d d lmZ dZe jZe jZe jZe jZd ddd �dd�Zd ddd �dd�Zd ddd �dd�Zd ddd �dd�ZG dd� de�Zeddd�eeddd�eeddd�eeddd�eiZddddddddd�d d!�Zd'd"dd#�d$d%�Z e!d&k�rbe"e � ��dS )(� )�annotationsN)� NamedTuple)�Pattern)�Sequence)� lang_base)�output)�Prefix)�xargszPattern[bytes]�str�int)�pattern�filename�returnc C sh d}t |d��P}t|dd�D ]<\}}| �|�rd}t�|� d|� d�� t�|�d�� qW 5 Q R X |S )Nr �rb� )�start�:s )�open� enumerate�searchr �write�write_line_b�rstrip)r r �retv�f�line_no�line� r �I/opt/hc_python/lib/python3.8/site-packages/pre_commit/languages/pygrep.py�_process_filename_by_line s r c C s� d}t |d���}|�� }| �|�}|r�d}|d |�� � �d�}t�|� d|d � d�� |d �d�}|�d�| |d<