From bdf4bbef6c624ee6df9f5e5cb670728a7aa5457c Mon Sep 17 00:00:00 2001 From: FrederikBaerentsen Date: Sun, 3 Mar 2024 05:15:38 -0500 Subject: [PATCH] Starting work on index page. --- app.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/app.py b/app.py index fd73ff5..a756fc3 100644 --- a/app.py +++ b/app.py @@ -1,12 +1,25 @@ from flask import Flask, request, jsonify, render_template import json from pprint import pprint as pp +from pathlib import Path +import re app = Flask(__name__) #tmp = '71386-10' + +@app.route('/') +def index(): + pathlist = Path('./info/').rglob('*.json') + set_list = [] + for path in pathlist: + print(str(path)) + set_list.append(re.findall(r"\b\d+(?:-\d+)?\b",str(path))) + + return set_list + @app.route('/') -def index(tmp): +def sets(tmp): with open('./sets/'+tmp+'/info.json') as info: info_file = json.loads(info.read()) with open('./sets/'+tmp+'/inventory.json') as inventory: