From 7a9455f6fb6d168dbde687d1d0e1de32c0d5eae9 Mon Sep 17 00:00:00 2001 From: Jules Dejaeghere Date: Sat, 31 Oct 2020 21:03:58 +0100 Subject: [PATCH] Change working directory --- app/server.py | 4 ++-- app/tools/caching.py | 2 +- app/tools/tools.py | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/server.py b/app/server.py index 3677685..8da4bd2 100644 --- a/app/server.py +++ b/app/server.py @@ -1,5 +1,5 @@ -from tools.tools import * -from tools.caching import * +from app.tools.tools import * +from app.tools.caching import * from flask import Flask, make_response app = Flask(__name__) diff --git a/app/tools/caching.py b/app/tools/caching.py index 02cca63..776797a 100644 --- a/app/tools/caching.py +++ b/app/tools/caching.py @@ -66,7 +66,7 @@ def horodate(cal: Calendar, prefix='') -> Calendar: def background_cache() -> None: - path = "config" + path = "app/config" files = [os.path.join(path, f) for f in os.listdir(path) if os.path.isfile(os.path.join(path, f)) and f.endswith('.json')] diff --git a/app/tools/tools.py b/app/tools/tools.py index 030cdd3..bdff209 100644 --- a/app/tools/tools.py +++ b/app/tools/tools.py @@ -77,7 +77,7 @@ from typing import List from ics import Calendar from pathvalidate import sanitize_filename -from tools.caching import load_cal +from app.tools.caching import load_cal def filtering(cal: Calendar, filters: dict, field_name: str) -> Calendar: @@ -312,7 +312,7 @@ def process(path: str) -> Calendar: :rtype: Calendar """ - o = "config/" + sanitize_filename(path) + o = "app/config/" + sanitize_filename(path) print("Try to open " + o) file = open(o, "r") config = json.loads(file.read())