openpyxl: add baseline stubs for new modules (#9921)

This commit is contained in:
Alex Waygood
2023-03-24 11:39:10 +00:00
committed by GitHub
parent 1cf2e73c32
commit 1d6a880a3d
2 changed files with 96 additions and 0 deletions

View File

@@ -0,0 +1,49 @@
from _typeshed import Incomplete
from collections.abc import Iterator
from typing_extensions import Self
from openpyxl.descriptors import Bool, DateTime, Float, Integer, Sequence, Strict, String
from openpyxl.descriptors.nested import NestedText
class NestedBoolText(Bool, NestedText): ...
class _TypedProperty(Strict):
name: String
value: Incomplete
def __init__(self, name: str, value) -> None: ...
def __eq__(self, other: _TypedProperty) -> bool: ... # type: ignore[override]
class IntProperty(_TypedProperty):
value: Integer
class FloatProperty(_TypedProperty):
value: Float
class StringProperty(_TypedProperty):
value: String
class DateTimeProperty(_TypedProperty):
value: DateTime
class BoolProperty(_TypedProperty):
value: Bool
class LinkProperty(_TypedProperty):
value: String
CLASS_MAPPING: Incomplete
XML_MAPPING: Incomplete
class CustomPropertyList(Strict):
props: Sequence
def __init__(self) -> None: ...
@classmethod
def from_tree(cls, tree) -> Self: ...
def append(self, prop) -> None: ...
def to_tree(self): ...
def __len__(self) -> int: ...
@property
def names(self) -> list[str]: ...
def __getitem__(self, name): ...
def __delitem__(self, name) -> None: ...
def __iter__(self) -> Iterator[Incomplete]: ...

View File

@@ -0,0 +1,47 @@
from _typeshed import Incomplete
from re import Pattern
from typing_extensions import Self
from openpyxl.descriptors import Integer, Strict, String
from openpyxl.utils.cell import SHEETRANGE_RE as SHEETRANGE_RE
from .cell_range import MultiCellRange
COL_RANGE: str
COL_RANGE_RE: Pattern[str]
ROW_RANGE: str
ROW_RANGE_RE: Pattern[str]
TITLES_REGEX: Pattern[str]
PRINT_AREA_RE: Pattern[str]
class ColRange(Strict):
min_col: String
max_col: String
def __init__(
self, range_string: Incomplete | None = None, min_col: Incomplete | None = None, max_col: Incomplete | None = None
) -> None: ...
def __eq__(self, other: object) -> bool: ...
class RowRange(Strict):
min_row: Integer
max_row: Integer
def __init__(
self, range_string: Incomplete | None = None, min_row: Incomplete | None = None, max_row: Incomplete | None = None
) -> None: ...
def __eq__(self, other: object) -> bool: ...
class PrintTitles(Strict):
cols: Incomplete
rows: Incomplete
title: String
def __init__(self, cols: Incomplete | None = None, rows: Incomplete | None = None, title: str = "") -> None: ...
@classmethod
def from_string(cls, value) -> Self: ...
def __eq__(self, other: object) -> bool: ...
class PrintArea(MultiCellRange):
title: str
@classmethod
def from_string(cls, value) -> Self: ...
def __init__(self, ranges=(), title: str = "") -> None: ...
def __eq__(self, other): ...