Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/textfsm/__pycache__/clitable.cpython-39.pyc
Ðазад
a i�h3 � @ s� d Z ddlmZ ddlmZ ddlmZ ddlmZ ddlZddlZddlZddl Z ddl mZ ddl mZ ddl Z dd l mZ dd l mZ G dd� de�ZG d d� de�ZG dd� de�ZG dd� de�ZG dd� dej�ZdS )aV GCLI Table - CLI data in TextTable format. Class that reads CLI output and parses into tabular format. Supports the use of index files to map TextFSM templates to device/command output combinations and store the data in a TextTable. Is the glue between an automated command scraping program (such as RANCID) and the TextFSM output parser. � )�absolute_import)�division)�print_function)�unicode_literalsN)�object)�str)�copyable_regex_object)� texttablec @ s e Zd ZdZdS )�ErrorzBase class for errors.N��__name__� __module__�__qualname__�__doc__� r r ��/root/rpmbuild/BUILDROOT/imh-python39-modules-3.9.7-92.el8.x86_64/opt/imh-python/lib/python3.9/site-packages/textfsm/clitable.pyr , s r c @ s e Zd ZdZdS )�IndexTableErrorzGeneral INdexTable error.Nr r r r r r 0 s r c @ s e Zd ZdZdS )� CliTableErrorzGeneral CliTable error.Nr r r r r r 4 s r c @ sL e Zd ZdZddd�Zdd� Zdd� Zd d � Zddd�Zd d� Z dd� Z dS )� IndexTableak Class that reads and stores comma-separated values as a TextTable. Stores a compiled regexp of the value for efficient matching. Includes functions to preprocess Columns (both compiled and uncompiled). Attributes: index: TextTable, the index file parsed into a texttable. compiled: TextTable, the table but with compiled regexp for each field. Nc C s4 d| _ d| _|r0|| _t| jd�| _| �||� dS )a Create new IndexTable object. Args: preread: func, Pre-processing, applied to each field as it is read. precompile: func, Pre-compilation, applied to each field before compiling. file_path: String, Location of file to use as input. N�r)�index�compiled�_index_file�open� _index_handle�_ParseIndex)�self�preread� precompile� file_pathr r r �__init__D s zIndexTable.__init__c C s t | d�r| j�� dS )zClose index handle.r N)�hasattrr �close�r r r r �__del__S s zIndexTable.__del__c C s | j jS )z Returns number of rows in table.)r �sizer# r r r �__len__X s zIndexTable.__len__c C s4 t � }t| d�r | j|_| j|_| j|_| j|_|S )z'Returns a copy of an IndexTable object.r )r r! r r r r )r �cloner r r �__copy__\ s zIndexTable.__copy__c C sL t � }t| d�r,t�| j�|_t|jd�|_t�| j�|_t�| j�|_|S )z+Returns a deepcopy of an IndexTable object.r r ) r r! �copy�deepcopyr r r r r )r Zmemodictr'