Browse Source

new stuff

master
Cristina Cochior 6 years ago
parent
commit
7f455de9ae
  1. BIN
      __pycache__/contextualise.cpython-36.pyc
  2. 19
      contextualise.py

BIN
__pycache__/contextualise.cpython-36.pyc

Binary file not shown.

19
contextualise.py

@ -26,10 +26,6 @@ listofdicts=[] #to be able to import and use json content
datafromjson = []
#test getting json file from id
id = "17"
jsonfilefordescription = "files/"+id+"/"+id+".json"
#arrays with the user path of words and numbers
pathofwords = []
pathofnumbers = []
@ -71,10 +67,10 @@ print("-------------------------")
dict = {} #dict for the form entries
with open("static/"+jsonfilefordescription, 'r') as f:
data_dict = json.load(f)
datafromjson = data_dict["files"]
print(datafromjson)
# with open("static/"+jsonfilefordescription, 'r') as f:
# data_dict = json.load(f)
# datafromjson = data_dict["files"]
# print(datafromjson)
@app.route("/")
def home():
@ -95,6 +91,11 @@ def all():
@app.route('/description')
def description():
idno=request.args.get('id')
jsonfilefordescription = "files/"+idno+"/"+idno+".json"
with open("static/"+jsonfilefordescription, 'r') as f:
data_dict = json.load(f)
datafromjson = data_dict["files"]
#open json file, list filepaths in array and loop with thefile
textfile=""
with open("static/"+jsonfilefordescription, 'r') as f:
@ -111,7 +112,7 @@ def description():
textfile = Markup(textfile)
return render_template('description.html', datafromjson=datafromjson, itemid=itemid, textfile=textfile)
return render_template('description.html', datafromjson=datafromjson, itemid=itemid, textfile=textfile, idno=idno)
@app.route('/diverge', methods=['GET'])
def diverge():

Loading…
Cancel
Save