home · contact · privacy
Rename DB path environment variable to something more unique.
authorChristian Heller <c.heller@plomlompom.de>
Tue, 19 Mar 2024 23:48:16 +0000 (00:48 +0100)
committerChristian Heller <c.heller@plomlompom.de>
Tue, 19 Mar 2024 23:48:16 +0000 (00:48 +0100)
run.py

diff --git a/run.py b/run.py
index ef6aeab6b7fd56a93ed3c9e76a7b5bbfe532b68c..33346375ea8ad03a19b43ce8f26e0c3e8498bbbd 100755 (executable)
--- a/run.py
+++ b/run.py
@@ -6,7 +6,7 @@ from plomtask.misc import HandledException
 from plomtask.http import TaskHandler, TaskServer
 from plomtask.db import DatabaseFile
 
-PATH_DB = environ.get('PATH_DB')
+PLOMTASK_DB_PATH = environ.get('PLOMTASK_DB_PATH')
 HTTP_PORT = 8082
 TEMPLATES_DIR = 'templates'
 DB_CREATION_ASK = 'Database file not found. Create? Y/n\n'
@@ -14,9 +14,9 @@ DB_CREATION_ASK = 'Database file not found. Create? Y/n\n'
 
 if __name__ == '__main__':
     try:
-        if not PATH_DB:
-            raise HandledException('PATH_DB not set.')
-        db_file = DatabaseFile(PATH_DB)
+        if not PLOMTASK_DB_PATH:
+            raise HandledException('PLOMTASK_DB_PATH not set.')
+        db_file = DatabaseFile(PLOMTASK_DB_PATH)
         if not db_file.exists:
             legal_yesses = {'y', 'yes', 'yes.', 'yes!'}
             reply = input(DB_CREATION_ASK)