From c1d8ad88a43a87ac7ecdf7f324750252a9e6505b Mon Sep 17 00:00:00 2001 From: erdgeist Date: Mon, 6 Jan 2025 04:03:17 +0100 Subject: Let versions reside under var/ --- fullnarp.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'fullnarp.py') diff --git a/fullnarp.py b/fullnarp.py index 1085732..2007749 100644 --- a/fullnarp.py +++ b/fullnarp.py @@ -20,7 +20,7 @@ a halfnarp2 checked out in the home of user halfnarp: } location /fullnarp/versions { - alias /home/halfnarp/halfnarp2/versions/; + alias /home/halfnarp/halfnarp2/var/versions/; } location /fullnarp/ws/ { @@ -185,7 +185,7 @@ async def handle_client(websocket): "lastupdate": int(newest_version), } with open( - "versions/fullnarp_" + "var/versions/fullnarp_" + str(newest_version).zfill(5) + ".json", "w", @@ -227,14 +227,14 @@ async def main(): Base.metadata.create_all(bind=engine) # load state file - newest_file = sorted(listdir("versions/"))[-1] + newest_file = sorted(listdir("var/versions/"))[-1] global newest_version global current_version if newest_file: newest_version = int(newest_file.replace("fullnarp_", "").replace(".json", "")) print("Resuming from version: " + str(newest_version)) - with open("versions/" + str(newest_file)) as data_file: + with open("var/versions/" + str(newest_file)) as data_file: current_version = json.load(data_file) else: current_version = {} -- cgit v1.2.3