Skip to content

Commit 7edad2e

Browse files
JWock82JWock82
authored andcommitted
Code simplification
1 parent 44c15dc commit 7edad2e

File tree

1 file changed

+3
-24
lines changed

1 file changed

+3
-24
lines changed

Pynite/Reporting.py

Lines changed: 3 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
import os
1414
import platform
1515
import shutil
16-
import logging
1716
from pathlib import Path
1817
from typing import TYPE_CHECKING
1918

@@ -27,26 +26,8 @@
2726
if TYPE_CHECKING:
2827
from Pynite import FEModel3D
2928

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+
# %%
4830
# Jinja2 Template Setup
49-
# =============================================================================
5031

5132
# Determine the directory where this file lives
5233
path = Path(__file__).parent
@@ -60,6 +41,7 @@
6041
# Load the main HTML report template
6142
template = env.get_template('Report_Template.html')
6243

44+
# %%
6345
def create_report(model: FEModel3D,
6446
output_filepath: Path | str = path / 'Pynite Report.pdf',
6547
format: str = 'pdf',
@@ -201,10 +183,7 @@ def get_wkhtmltopdf_path(log: bool = True) -> str | None:
201183
return None
202184

203185

204-
# =============================================================================
205-
# Script Entry Point
206-
# =============================================================================
207-
186+
# %%
208187
if __name__ == "__main__":
209188
# Example: Run a demo if this file is executed directly
210189
logger.info("This module is intended to be imported, not run directly.")

0 commit comments

Comments
 (0)