manuel1618 / mpcforces-extractor

Get forces from RBE2s in Optistruct summed by connected parts
https://manuel1618.github.io/mpcforces-extractor/
MIT License
0 stars 0 forks source link

Better Paths to local dirs with importlib or similar #65

Closed manuel1618 closed 2 weeks ago

manuel1618 commented 2 weeks ago

This code is messy:

from pathlib import Path

ITEMS_PER_PAGE = 100
PACKAGE_ROOT_DIR = Path(__file__).resolve().parent.parent
UPLOAD_FOLDER = f"{PACKAGE_ROOT_DIR}/data/uploads"
OUTPUT_FOLDER = f"{PACKAGE_ROOT_DIR}/data/output"
STATIC_DIR = f"{PACKAGE_ROOT_DIR}/frontend/static"  # Path to the static directory
TEMPLATES_DIR = (
    f"{PACKAGE_ROOT_DIR}/frontend/templates"  # Path to the templates directory
)

Could use a lib to solve it

manuel1618 commented 2 weeks ago

Additionally, the paths dont make sense. Some paths I would like to have them in the os.getcwd() / data or so.