Starting work on index page.
This commit is contained in:
parent
74f19611ea
commit
bdf4bbef6c
15
app.py
15
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('/<tmp>')
|
||||
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:
|
||||
|
Loading…
Reference in New Issue
Block a user