diff options
Diffstat (limited to 'prediction_report_service.py')
| -rw-r--r-- | prediction_report_service.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/prediction_report_service.py b/prediction_report_service.py index 4b2e521..7017ac6 100644 --- a/prediction_report_service.py +++ b/prediction_report_service.py @@ -2,7 +2,7 @@ from datetime import datetime from typing import List
from io import BytesIO
-from xhtml2pdf import pisa
+# Import xhtml2pdf lazily in export to avoid heavy import at module load
from calendar_manager import CalendarManager
from prediction_controller import PredictionController
@@ -18,6 +18,7 @@ class PredictionReportService: out_path: str,
dateformat: str = "dd.MM.yyyy") -> bool:
try:
+ from xhtml2pdf import pisa
# Gather data
launch_dt = prediction_controller.get_launch_date()
duration = prediction_controller.get_duration()
|
