Skip to content

Commit d271f52

Browse files
committed
🎨 Format: add black format
1 parent a53a6f8 commit d271f52

File tree

3 files changed

+23
-18
lines changed

3 files changed

+23
-18
lines changed

src/vuegen/__main__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def main():
3939
# Initialize logger
4040
logger, logfile = get_logger(f"{logger_suffix}")
4141
logger.info("logfile: %s", logfile)
42-
42+
4343
# Generate the report
4444
_, _ = report_generator.get_report(
4545
report_type=report_type,
@@ -54,5 +54,6 @@ def main():
5454
# ! Could use now report_dir and config_path as information
5555
print(get_completion_message(report_type, config_path))
5656

57+
5758
if __name__ == "__main__":
5859
main()

src/vuegen/quarto_reportview.py

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ class QuartoReportView(r.ReportView):
2121
STATIC_FILES_DIR = BASE_DIR / "static"
2222

2323
def __init__(
24-
self,
25-
report: r.Report,
24+
self,
25+
report: r.Report,
2626
report_type: r.ReportType,
2727
quarto_cheks: bool = False,
2828
):
@@ -192,11 +192,15 @@ def run_report(self, output_dir: str = BASE_DIR) -> None:
192192
self.report.logger.info(
193193
f"Running '{self.report.title}' '{self.report_type}' report with {args!r}"
194194
)
195-
if self.report_type in [
196-
r.ReportType.PDF,
197-
r.ReportType.DOCX,
198-
r.ReportType.ODT,
199-
] and self.quarto_cheks:
195+
if (
196+
self.report_type
197+
in [
198+
r.ReportType.PDF,
199+
r.ReportType.DOCX,
200+
r.ReportType.ODT,
201+
]
202+
and self.quarto_cheks
203+
):
200204
subprocess.run(
201205
[self.quarto_path, "install", "tinytex", "--no-prompt"],
202206
check=True,
@@ -211,14 +215,16 @@ def run_report(self, output_dir: str = BASE_DIR) -> None:
211215
check=True,
212216
)
213217
if self.report_type == r.ReportType.REVEALJS:
214-
out_path = file_path_to_qmd.with_name(f"{file_path_to_qmd.stem}_revealjs.html")
218+
out_path = file_path_to_qmd.with_name(
219+
f"{file_path_to_qmd.stem}_revealjs.html"
220+
)
215221
elif self.report_type == r.ReportType.JUPYTER:
216222
out_path = file_path_to_qmd.with_suffix(".ipynb")
217223
else:
218224
out_path = file_path_to_qmd.with_suffix(f".{self.report_type.lower()}")
219225
if not out_path.exists():
220226
raise FileNotFoundError(f"Report file could not be created: {out_path}")
221-
227+
222228
if self.report_type == r.ReportType.JUPYTER:
223229
args = [self.quarto_path, "convert", str(file_path_to_qmd)]
224230
subprocess.run(

src/vuegen/utils.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -737,6 +737,7 @@ def get_logger(
737737

738738
return logger, log_file
739739

740+
740741
def get_completion_message(report_type: str, config_path: str) -> str:
741742
"""
742743
Generate a formatted completion message after report generation.
@@ -754,10 +755,9 @@ def get_completion_message(report_type: str, config_path: str) -> str:
754755
A formatted string containing the completion message.
755756
"""
756757
border = "─" * 65 # Creates a separator line
757-
758+
758759
if report_type == "streamlit":
759-
message = (
760-
f"""🚀 Streamlit Report Generated!
760+
message = f"""🚀 Streamlit Report Generated!
761761
762762
📂 All scripts to build the Streamlit app are available at:
763763
streamlit_report/sections
@@ -773,10 +773,8 @@ def get_completion_message(report_type: str, config_path: str) -> str:
773773
⚙️ Configuration file used:
774774
{config_path}
775775
"""
776-
)
777776
else:
778-
message = (
779-
f"""🚀 {report_type.capitalize()} Report Generated!
777+
message = f"""🚀 {report_type.capitalize()} Report Generated!
780778
781779
📂 Your {report_type} report is available at:
782780
quarto_report
@@ -789,10 +787,10 @@ def get_completion_message(report_type: str, config_path: str) -> str:
789787
⚙️ Configuration file used:
790788
{config_path}
791789
"""
792-
)
793-
790+
794791
return f"{message}\n{border}"
795792

793+
796794
## REPORT FORMATTING
797795
def generate_footer() -> str:
798796
"""

0 commit comments

Comments
 (0)