-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
314 additions
and
51 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,37 @@ | ||
from __future__ import annotations | ||
|
||
from dataclasses import dataclass | ||
from typing import TYPE_CHECKING | ||
|
||
from pptxlib.core import Element | ||
|
||
if TYPE_CHECKING: | ||
from pptxlib.tables import Borders | ||
|
||
|
||
@dataclass(repr=False) | ||
class LineFormat(Element): | ||
parent: Borders | ||
|
||
|
||
# def get_borders( | ||
# cell: Cell | CellRange, | ||
# border_type: Literal["bottom","left","right","top"], | ||
# width: float = 1, | ||
# color: int | str | tuple[int, int, int] = 0, | ||
# line_style: Literal["-", "--"] = "-", | ||
# *, | ||
# visible: bool = True, | ||
# ): | ||
# border_type_int = getattr(constants, "ppBorder" + border_type[0].upper() + border_type[1:]) | ||
# border = cell.api.Borders(border_type_int) | ||
# border.Visible = visible | ||
|
||
# if not visible: | ||
# return | ||
|
||
# border.Weight = width | ||
# border.ForeColor.RGB = color | ||
|
||
# if line_style == "--": | ||
# border.DashStyle = constants.msoLineDash" |
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
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,13 @@ | ||
from pptxlib.tables import Cell, CellRange | ||
|
||
|
||
def test_cell_border(cell: Cell): | ||
line_format = cell.borders("left") | ||
assert line_format.api.__class__.__name__ == "LineFormat" | ||
assert line_format.__class__.__name__ == "LineFormat" | ||
|
||
|
||
def test_cell_border_parent(cell: Cell): | ||
line_format = cell.borders("left") | ||
assert line_format.api.Parent.__class__.__name__ == "Borders" | ||
assert line_format.parent.__class__.__name__ == "Borders" |
Oops, something went wrong.