-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[openpyxl] Annotate Worksheet and other items (#9892)
Co-authored-by: Alex Waygood <[email protected]>
- Loading branch information
1 parent
a34da85
commit c7d805b
Showing
7 changed files
with
186 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
from collections.abc import Iterable | ||
from typing import overload | ||
from typing_extensions import Self | ||
|
||
from openpyxl.descriptors import Strict, String, Typed | ||
|
||
class TextBlock(Strict): | ||
font: Typed | ||
text: String | ||
|
||
def __init__(self, font: Typed, text: String) -> None: ... | ||
def __eq__(self, other: TextBlock) -> bool: ... # type: ignore[override] | ||
|
||
class CellRichText(list[str | TextBlock]): | ||
@overload | ||
def __init__(self, __args: list[str] | list[TextBlock] | list[str | TextBlock] | tuple[str | TextBlock, ...]) -> None: ... | ||
@overload | ||
def __init__(self, *args: str | TextBlock) -> None: ... | ||
@classmethod | ||
def from_tree(cls, node) -> Self: ... | ||
def __add__(self, arg: Iterable[str | TextBlock]) -> CellRichText: ... # type: ignore[override] | ||
def append(self, arg: str | TextBlock) -> None: ... | ||
def extend(self, arg: Iterable[str | TextBlock]) -> None: ... | ||
def as_list(self) -> list[str]: ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
from _typeshed import Incomplete | ||
from collections import defaultdict | ||
from typing import TypeVar | ||
|
||
class BoundDictionary(defaultdict[Incomplete, Incomplete]): | ||
reference: Incomplete | ||
def __init__(self, reference: Incomplete | None = ..., *args, **kw) -> None: ... | ||
def __getitem__(self, key): ... | ||
_KT = TypeVar("_KT") | ||
_VT = TypeVar("_VT") | ||
|
||
class BoundDictionary(defaultdict[_KT, _VT]): | ||
reference: str | None | ||
def __init__(self, reference: str | None = None, *args, **kw) -> None: ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters