Skip to content

Commit a53a6f8

Browse files
committed
🎨 Format: add config_path parameter and change the strcuture of the function to print completion message
1 parent 5b4f1c7 commit a53a6f8

File tree

2 files changed

+28
-12
lines changed

2 files changed

+28
-12
lines changed

src/vuegen/__main__.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from pathlib import Path
33

44
from vuegen import report_generator
5-
from vuegen.utils import get_logger, get_parser, print_completion_message
5+
from vuegen.utils import get_logger, get_parser, get_completion_message
66

77

88
def main():
@@ -52,8 +52,7 @@ def main():
5252

5353
# Print completion message
5454
# ! Could use now report_dir and config_path as information
55-
print_completion_message(report_type)
56-
55+
print(get_completion_message(report_type, config_path))
5756

5857
if __name__ == "__main__":
5958
main()

src/vuegen/utils.py

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -737,15 +737,27 @@ def get_logger(
737737

738738
return logger, log_file
739739

740-
741-
def print_completion_message(report_type: str):
740+
def get_completion_message(report_type: str, config_path: str) -> str:
742741
"""
743-
Prints a formatted completion message after report generation.
742+
Generate a formatted completion message after report generation.
743+
744+
Parameters
745+
----------
746+
report_type : str
747+
The type of report generated (e.g., "streamlit", "html").
748+
config_path : str
749+
The path to the configuration file used for generating the report.
750+
751+
Returns
752+
-------
753+
str
754+
A formatted string containing the completion message.
744755
"""
745756
border = "─" * 65 # Creates a separator line
757+
746758
if report_type == "streamlit":
747-
print(
748-
"""🚀 Streamlit Report Generated!
759+
message = (
760+
f"""🚀 Streamlit Report Generated!
749761
750762
📂 All scripts to build the Streamlit app are available at:
751763
streamlit_report/sections
@@ -757,10 +769,13 @@ def print_completion_message(report_type: str):
757769
758770
🛠️ Advanced users can modify the Python scripts directly in:
759771
streamlit_report/sections
772+
773+
⚙️ Configuration file used:
774+
{config_path}
760775
"""
761776
)
762777
else:
763-
print(
778+
message = (
764779
f"""🚀 {report_type.capitalize()} Report Generated!
765780
766781
📂 Your {report_type} report is available at:
@@ -770,11 +785,13 @@ def print_completion_message(report_type: str):
770785
771786
🛠️ Advanced users can modify the report template directly in:
772787
quarto_report/quarto_report.qmd
788+
789+
⚙️ Configuration file used:
790+
{config_path}
773791
"""
774792
)
775-
776-
print(border)
777-
793+
794+
return f"{message}\n{border}"
778795

779796
## REPORT FORMATTING
780797
def generate_footer() -> str:

0 commit comments

Comments
 (0)