Файловый менеджер - Редактировать - /home/digitalm/venv/lib/python3.7/site-packages/openpyxl/worksheet/__pycache__/cell_range.cpython-37.pyc
Назад
B �5�g�: � @ s� d dl m Z d dlmZ d dlmZ d dlmZ d dlmZ d dlm Z d dl mZmZm Z mZ G dd � d e �ZG d d� de�ZdS ) � )�copy)� attrgetter)�Strict)�MinMax)�UniqueSequence)�Serialisable)�range_boundaries�range_to_tuple�get_column_letter�quote_sheetnamec @ s� e Zd ZdZedded�Zedded�Zedded�Zedded�Z dFdd�Z ed d � �Zedd� �Z ed d� �Zedd� �Zedd� �Zdd� Zdd� Zdd� Zdd� Zdd� ZdGdd�Zd d!� Zd"d#� Zd$d%� ZeZd&d'� Zd(d)� Zd*d+� ZeZd,d-� Zd.d/� Z d0d1� Z!d2d3� Z"e"Z#d4d5� Z$e$Z%d6d7� Z&dHd8d9�Z'dId:d;�Z(ed<d=� �Z)ed>d?� �Z*ed@dA� �Z+edBdC� �Z,edDdE� �Z-dS )J� CellRangea� Represents a range in a sheet: title and coordinates. This object is used to perform operations on ranges, like: - shift, expand or shrink - union/intersection with another sheet range, We can check whether a range is: - equal or not equal to another, - disjoint of another, - contained in another. We can get: - the size of a range. - the range bounds (vertices) - the coordinates, - the string representation, � ifG )�min�max� expected_typei Nc C s� |d k r6d|kr&t |�\}\}}}}nt|�\}}}}|| _|| _|| _|| _|| _||krrd}t|j||d���||kr�d}t|j||d���d S )N�!z({max_col} must be greater than {min_col})�min_col�max_colz({max_row} must be greater than {min_row})�min_row�max_row) r r r r r r �title� ValueError�format)�selfZrange_stringr r r r r �fmt� r �S/home/digitalm-up/venv/lib/python3.7/site-packages/openpyxl/worksheet/cell_range.py�__init__0 s zCellRange.__init__c C s | j | j| j| jfS )z2 Vertices of the range as a tuple )r r r r )r r r r �boundsF s zCellRange.boundsc C sB d}| j | jkr | j| jkr d}|jt| j �| jt| j�| jd�S )z9 Excel-style representation of the range z%{min_col}{min_row}:{max_col}{max_row}z{min_col}{min_row})r r r r )r r r r r r )r r r r r �coordN s zCellRange.coordc # sB x<t | j| jd �D ]&� � fdd�t | j| jd �D �V qW dS )z1 Return cell coordinates as rows r c s g | ]}� |f�qS r r )�.0�col)�rowr r � <listcomp>e s z"CellRange.rows.<locals>.<listcomp>N)�ranger r r r )r r )r"