Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 40 additions & 36 deletions lcov.info
Original file line number Diff line number Diff line change
Expand Up @@ -274,79 +274,83 @@ DA:89,1
DA:90,1
DA:92,1
DA:98,1
DA:99,1
DA:100,1
DA:111,1
DA:112,1
DA:113,1
DA:114,1
DA:101,1
DA:102,1
DA:104,1
DA:115,1
DA:116,1
DA:117,1
DA:118,1
DA:119,1
DA:120,1
DA:121,1
DA:130,1
DA:131,1
DA:132,1
DA:122,1
DA:123,1
DA:125,1
DA:134,1
DA:135,1
DA:136,1
DA:137,1
DA:138,1
DA:139,1
DA:140,1
DA:141,1
DA:142,1
DA:143,1
DA:144,1
DA:145,1
DA:146,1
DA:147,1
DA:149,1
DA:148,1
DA:150,1
DA:151,1
DA:152,1
DA:153,1
DA:154,1
DA:155,1
DA:156,1
DA:157,1
DA:158,1
DA:159,1
DA:160,1
DA:161,1
DA:162,1
DA:163,1
DA:164,1
DA:165,1
DA:166,1
DA:167,1
DA:168,1
DA:169,1
DA:171,1
DA:172,1
DA:174,1
DA:184,1
DA:185,1
DA:186,1
DA:187,1
DA:173,1
DA:175,1
DA:176,1
DA:178,1
DA:188,1
DA:189,1
DA:190,1
DA:191,1
DA:193,1
DA:194,1
DA:195,1
DA:196,1
DA:197,1
DA:198,1
DA:199,1
DA:200,1
DA:201,1
DA:203,1
DA:206,1
DA:204,1
DA:205,1
DA:207,1
DA:208,1
DA:209,1
DA:210,1
DA:211,1
DA:212,1
DA:214,1
DA:213,1
DA:215,1
DA:217,1
DA:216,1
DA:218,1
LF:135
LH:135
DA:219,1
DA:221,1
DA:222,1
LF:139
LH:139
FN:16,35,date_index
FNDA:1,date_index
FN:38,42,fiscal_year
Expand All @@ -357,21 +361,21 @@ FN:77,80,GanttFrame.name
FNDA:1,GanttFrame.name
FN:83,84,GanttFrame.days
FNDA:1,GanttFrame.days
FN:92,98,GanttChart.__init__
FN:92,102,GanttChart.__init__
FNDA:1,GanttChart.__init__
FN:100,154,GanttChart.add_table
FN:104,158,GanttChart.add_table
FNDA:1,GanttChart.add_table
FN:157,159,GanttChart.origin
FN:161,163,GanttChart.origin
FNDA:1,GanttChart.origin
FN:162,165,GanttChart.day_width
FN:166,169,GanttChart.day_width
FNDA:1,GanttChart.day_width
FN:167,169,GanttChart.x
FN:171,173,GanttChart.x
FNDA:1,GanttChart.x
FN:171,172,GanttChart.y
FN:175,176,GanttChart.y
FNDA:1,GanttChart.y
FN:174,203,GanttChart.add
FN:178,207,GanttChart.add
FNDA:1,GanttChart.add
FN:206,218,strptime
FN:210,222,strptime
FNDA:1,strptime
FNF:13
FNH:13
Expand Down
8 changes: 6 additions & 2 deletions src/pptxlib/contrib/gantt.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,13 @@ class GanttChart:
def __init__(
self,
kind: str,
start: datetime,
end: datetime,
start: datetime | str,
end: datetime | str,
) -> None:
if isinstance(start, str):
start = strptime(start)
if isinstance(end, str):
end = strptime(end)
self.frame = GanttFrame(kind, start, end)

def add_table(
Expand Down
2 changes: 1 addition & 1 deletion tests/contrib/test_gantt.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def test_name_day():
@pytest.fixture(scope="module")
def gantt(prs: Presentations):
pr = prs.add(with_window=False)
gantt = GanttChart("week", datetime(2025, 5, 21), datetime(2025, 6, 10))
gantt = GanttChart("week", "2025/5/21", "2025/6/10")
slide = pr.slides.add()
gantt.add_table(slide, 20, 150)
yield gantt
Expand Down
Loading