|
13 | 13 | import os
|
14 | 14 | import platform
|
15 | 15 | import shutil
|
16 |
| -import logging |
17 | 16 | from pathlib import Path
|
18 | 17 | from typing import TYPE_CHECKING
|
19 | 18 |
|
|
27 | 26 | if TYPE_CHECKING:
|
28 | 27 | from Pynite import FEModel3D
|
29 | 28 |
|
30 |
| - |
31 |
| -# ============================================================================= |
32 |
| -# Logging Setup |
33 |
| -# ============================================================================= |
34 |
| - |
35 |
| -# Create a module-level logger |
36 |
| -logger = logging.getLogger(__name__) |
37 |
| - |
38 |
| -# Only configure logging if this file is run directly. |
39 |
| -# When imported as a library, the caller controls logging configuration. |
40 |
| -if __name__ == "__main__" and not logger.handlers: |
41 |
| - logging.basicConfig( |
42 |
| - level=logging.INFO, |
43 |
| - format="%(levelname)s [%(name)s]: %(message)s" |
44 |
| - ) |
45 |
| - |
46 |
| - |
47 |
| -# ============================================================================= |
| 29 | +# %% |
48 | 30 | # Jinja2 Template Setup
|
49 |
| -# ============================================================================= |
50 | 31 |
|
51 | 32 | # Determine the directory where this file lives
|
52 | 33 | path = Path(__file__).parent
|
|
60 | 41 | # Load the main HTML report template
|
61 | 42 | template = env.get_template('Report_Template.html')
|
62 | 43 |
|
| 44 | +# %% |
63 | 45 | def create_report(model: FEModel3D,
|
64 | 46 | output_filepath: Path | str = path / 'Pynite Report.pdf',
|
65 | 47 | format: str = 'pdf',
|
@@ -201,10 +183,7 @@ def get_wkhtmltopdf_path(log: bool = True) -> str | None:
|
201 | 183 | return None
|
202 | 184 |
|
203 | 185 |
|
204 |
| -# ============================================================================= |
205 |
| -# Script Entry Point |
206 |
| -# ============================================================================= |
207 |
| - |
| 186 | +# %% |
208 | 187 | if __name__ == "__main__":
|
209 | 188 | # Example: Run a demo if this file is executed directly
|
210 | 189 | logger.info("This module is intended to be imported, not run directly.")
|
0 commit comments