Update app.py
Added removal of escape template if not Nth page load
This commit is contained in:
parent
574c66db5e
commit
7d373b8cf4
6
app.py
6
app.py
|
@ -13,7 +13,6 @@ unique_requests = set()
|
||||||
# OR change the ROOT_DIR path below :)
|
# OR change the ROOT_DIR path below :)
|
||||||
ROOT_DIR = os.path.dirname(os.path.abspath(__file__))
|
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))]
|
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
|
# Site choosing logic
|
||||||
website_dir = None
|
website_dir = None
|
||||||
|
@ -24,6 +23,11 @@ def current_website_dir():
|
||||||
global website_dir
|
global website_dir
|
||||||
website_dir = str(ROOT_DIR+"/Marvel")
|
website_dir = str(ROOT_DIR+"/Marvel")
|
||||||
else:
|
else:
|
||||||
|
global WEBSITE_DIRS
|
||||||
|
try:
|
||||||
|
WEBSITE_DIRS.remove('Marvel')
|
||||||
|
except ValueError:
|
||||||
|
pass
|
||||||
website_dir = random.choice(WEBSITE_DIRS)
|
website_dir = random.choice(WEBSITE_DIRS)
|
||||||
|
|
||||||
# Make static files available
|
# Make static files available
|
||||||
|
|
Loading…
Reference in New Issue