Skip to content

Commit d832f80

Browse files
committed
refactor: update presentation save paths to use with_suffix for consistency
1 parent f289ee9 commit d832f80

File tree

3 files changed

+4
-9
lines changed

3 files changed

+4
-9
lines changed

examples/dataflame_table.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@
44

55
import tppt
66

7-
# Flag to determine whether to use Polars
8-
EXAMPLE_DIR = Path(__file__).parent
9-
107

118
def main():
129
"""Run the sample."""
@@ -71,7 +68,7 @@ def main():
7168
)
7269

7370
# Save the presentation
74-
presentation.save(EXAMPLE_DIR / "dataflame_table.pptx")
71+
presentation.save(Path(__file__).with_suffix(".pptx"))
7572

7673
print("Successfully created presentation from Polars dataframe!")
7774

@@ -90,4 +87,4 @@ def main():
9087
width=(500, "pt"),
9188
height=(50, "pt"),
9289
)
93-
).build().save(EXAMPLE_DIR / "dataflame_table.pptx")
90+
).build().save(Path(__file__).with_suffix(".pptx"))

examples/presentation_tree.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55

66
import tppt
77

8-
EXAMPLE_DIR = Path(__file__).parent
9-
108

119
def main() -> None:
1210
presentation = (
@@ -22,7 +20,7 @@ def main() -> None:
2220
)
2321
.build()
2422
)
25-
presentation.save(EXAMPLE_DIR / "presentation_tree.pptx")
23+
presentation.save(Path(__file__).with_suffix(".pptx"))
2624

2725
# Get and display the tree structure
2826
print(

examples/simple_example.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ def main():
116116
)
117117

118118
# Save the presentation
119-
presentation.save(Path(__file__).parent / "simple_example.pptx")
119+
presentation.save(Path(__file__).with_suffix(".pptx"))
120120

121121
print("Rich presentation created successfully!")
122122

0 commit comments

Comments
 (0)