feat: add desktop packaging (pywebview + PyInstaller)
- resource_path.py: frozen/dev path resolution for bundled data files - app_desktop.py: pywebview entry point (Dash in daemon thread) - app.spec: PyInstaller onedir config with data files and hidden imports - Updated queries.py, card_browser.py, app.py to use get_resource_path() - Added pywebview + pyinstaller to project dependencies - Fixed unresolved merge conflict in .gitignore - Removed stale 01_nhs_classic.html and AdditionalAnalytics.md
This commit is contained in:
+8
-4
@@ -1,7 +1,10 @@
|
||||
"""Dash application entry point with layout root and state stores."""
|
||||
import sys
|
||||
|
||||
from dash import Dash, html, dcc
|
||||
import dash_mantine_components as dmc
|
||||
|
||||
from core.resource_path import get_resource_path
|
||||
from dash_app.components.header import make_header
|
||||
from dash_app.components.sub_header import make_sub_header
|
||||
from dash_app.components.sidebar import make_sidebar
|
||||
@@ -12,10 +15,11 @@ from dash_app.components.modals import make_modals
|
||||
from dash_app.components.trust_comparison import make_tc_landing, make_tc_dashboard
|
||||
from dash_app.components.trends import make_trends_landing, make_trends_detail
|
||||
|
||||
app = Dash(
|
||||
__name__,
|
||||
suppress_callback_exceptions=True,
|
||||
)
|
||||
_app_kwargs = {"suppress_callback_exceptions": True}
|
||||
if getattr(sys, "frozen", False):
|
||||
_app_kwargs["assets_folder"] = str(get_resource_path("dash_app/assets"))
|
||||
|
||||
app = Dash(__name__, **_app_kwargs)
|
||||
|
||||
app.layout = dmc.MantineProvider(
|
||||
children=[
|
||||
|
||||
@@ -9,12 +9,11 @@ Also provides get_all_drugs() for the flat "All Drugs" card.
|
||||
|
||||
import csv
|
||||
from collections import defaultdict
|
||||
from pathlib import Path
|
||||
|
||||
from core.resource_path import get_resource_path
|
||||
from data_processing.diagnosis_lookup import SEARCH_TERM_MERGE_MAP
|
||||
|
||||
DATA_DIR = Path(__file__).resolve().parents[2] / "data"
|
||||
DIM_SEARCH_TERM_PATH = DATA_DIR / "DimSearchTerm.csv"
|
||||
DIM_SEARCH_TERM_PATH = get_resource_path("data/DimSearchTerm.csv")
|
||||
|
||||
|
||||
def build_directorate_tree() -> dict[str, dict[str, list[str]]]:
|
||||
|
||||
@@ -5,9 +5,9 @@ Resolves the database path relative to this file's location and delegates
|
||||
to the shared functions in src/data_processing/pathway_queries.py.
|
||||
"""
|
||||
|
||||
from pathlib import Path
|
||||
from typing import Optional
|
||||
|
||||
from core.resource_path import get_resource_path
|
||||
from data_processing.pathway_queries import (
|
||||
load_initial_data as _load_initial_data,
|
||||
load_pathway_nodes as _load_pathway_nodes,
|
||||
@@ -33,7 +33,7 @@ from data_processing.pathway_queries import (
|
||||
get_trend_data as _get_trend_data,
|
||||
)
|
||||
|
||||
DB_PATH = Path(__file__).resolve().parents[2] / "data" / "pathways.db"
|
||||
DB_PATH = get_resource_path("data/pathways.db")
|
||||
|
||||
|
||||
def load_initial_data() -> dict:
|
||||
|
||||
Reference in New Issue
Block a user