From 7d373b8cf44b97b5398a3e7f8337a64f269c9161 Mon Sep 17 00:00:00 2001 From: Eric Lay Date: Wed, 27 Mar 2024 11:24:52 -0500 Subject: [PATCH] Update app.py Added removal of escape template if not Nth page load --- app.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app.py b/app.py index e657247..780fc84 100644 --- a/app.py +++ b/app.py @@ -13,7 +13,6 @@ unique_requests = set() # OR change the ROOT_DIR path below :) ROOT_DIR = os.path.dirname(os.path.abspath(__file__)) WEBSITE_DIRS = [name for name in os.listdir(ROOT_DIR) if not name.startswith('.') and os.path.isdir(os.path.join(ROOT_DIR, name))] -print(ROOT_DIR) # Site choosing logic website_dir = None @@ -24,8 +23,13 @@ def current_website_dir(): global website_dir website_dir = str(ROOT_DIR+"/Marvel") else: + global WEBSITE_DIRS + try: + WEBSITE_DIRS.remove('Marvel') + except ValueError: + pass website_dir = random.choice(WEBSITE_DIRS) - + # Make static files available @app.route('/', methods=['GET']) def static_proxy(filename):