Skip to content

Commit a2bec94

Browse files
authored
No default logger and print message after completion (#76)
* 🎨 Styile: print completion message in the terminal * 🐛 Fix(report_generator.py): remove logger from the function definition to avoid creating a logger when there is not a report * 🎨 Ensure black format * 🎨 Black formsat on main * 📝 Docs(pyproject.toml): update vuegen description * 🎨 Style(pyproject.toml): description in a single line
1 parent 45ba1e0 commit a2bec94

File tree

4 files changed

+51
-4
lines changed

4 files changed

+51
-4
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = "vuegen"
33
dynamic = ["version"]
44

55
[tool.poetry]
6-
description = "Module to generate automatic web interface reports with visualizations"
6+
description = "VueGen automates the creation of reports from bioinformatics outputs, supporting formats like PDF, HTML, DOCX, ODT, PPTX, Reveal.js, Jupyter notebooks, and Streamlit web applications. Users simply provide a directory with output files and VueGen compiles them into a structured report."
77
authors = ["MoNA group"]
88
license = "MIT"
99
readme = "README.md"

src/vuegen/__main__.py

Lines changed: 4 additions & 1 deletion
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
5+
from vuegen.utils import get_logger, get_parser, print_completion_message
66

77

88
def main():
@@ -47,6 +47,9 @@ def main():
4747
streamlit_autorun=streamlit_autorun,
4848
)
4949

50+
# Print completion message
51+
print_completion_message(report_type)
52+
5053

5154
if __name__ == "__main__":
5255
main()

src/vuegen/report_generator.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
def get_report(
1212
report_type: str,
13-
logger: logging.Logger = get_logger("report"),
13+
logger: logging.Logger = None,
1414
config_path: str = None,
1515
dir_path: str = None,
1616
streamlit_autorun: bool = False,
@@ -36,7 +36,11 @@ def get_report(
3636
ValueError
3737
If neither 'config_path' nor 'directory' is provided.
3838
"""
39-
# Initialize the config manager object
39+
# Initialize logger only if it's not provided
40+
if logger is None:
41+
logger = get_logger("report")
42+
43+
# Create the config manager object
4044
config_manager = ConfigManager(logger)
4145

4246
if dir_path:

src/vuegen/utils.py

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -744,6 +744,46 @@ def get_logger(log_suffix):
744744
return logger
745745

746746

747+
def print_completion_message(report_type: str):
748+
"""
749+
Prints a formatted completion message after report generation.
750+
"""
751+
border = "─" * 65 # Creates a separator line
752+
print(f"\n{border}\n🎉 Pipeline Execution Complete! 🎉\n")
753+
754+
if report_type == "streamlit":
755+
print(
756+
"""🚀 Streamlit Report Generated!
757+
758+
📂 All scripts to build the Streamlit app are available at:
759+
nf_container_results/streamlit_report/sections
760+
761+
▶️ To run the Streamlit app, use the following command:
762+
streamlit run nf_container_results/streamlit_report/sections/report_manager.py
763+
764+
✨ You can extend the report by adding new files to the input directory or updating the config file.
765+
766+
🛠️ Advanced users can modify the Python scripts directly in:
767+
nf_container_results/streamlit_report/sections
768+
"""
769+
)
770+
else:
771+
print(
772+
f"""🚀 {report_type.capitalize()} Report Generated!
773+
774+
📂 Your {report_type} report is available at:
775+
nf_container_results/quarto_report
776+
777+
✨ You can extend the report by adding new files to the input directory or updating the config file.
778+
779+
🛠️ Advanced users can modify the report template directly in:
780+
nf_container_results/quarto_report/quarto_report.qmd
781+
"""
782+
)
783+
784+
print(border)
785+
786+
747787
## REPORT FORMATTING
748788
def generate_footer() -> str:
749789
"""

0 commit comments

Comments
 (0)