aboutsummaryrefslogtreecommitdiff
path: root/backend/hist_data/gen_disp_data.py
diff options
context:
space:
mode:
Diffstat (limited to 'backend/hist_data/gen_disp_data.py')
-rwxr-xr-xbackend/hist_data/gen_disp_data.py13
1 files changed, 5 insertions, 8 deletions
diff --git a/backend/hist_data/gen_disp_data.py b/backend/hist_data/gen_disp_data.py
index 6bb84ad..ca9b172 100755
--- a/backend/hist_data/gen_disp_data.py
+++ b/backend/hist_data/gen_disp_data.py
@@ -5,19 +5,16 @@ Adds data about event distribution to the database,
and removes events not eligible for display
"""
-# For unit testing, resolve imports of modules within this directory
-import os
-import sys
-parentDir = os.path.dirname(os.path.realpath(__file__))
-sys.path.append(parentDir)
-
import argparse
+import os
import sqlite3
-from cal import SCALES, dbDateToHistDate, dateToUnit
+from .cal import SCALES, dbDateToHistDate, dateToUnit
MAX_DISPLAYED_PER_UNIT = 4
-DB_FILE = 'data.db'
+
+DATA_DIR = os.path.dirname(os.path.realpath(__file__))
+DB_FILE = os.path.join(DATA_DIR, 'data.db')
def genData(dbFile: str, scales: list[int], maxDisplayedPerUnit: int, forImageTables: bool) -> None:
dbCon = sqlite3.connect(dbFile)