diff --git a/.DS_Store b/.DS_Store index ccfb04e..34f6869 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/__pycache__/contextualise.cpython-36.pyc b/__pycache__/contextualise.cpython-36.pyc index 063d10f..5824120 100644 Binary files a/__pycache__/contextualise.cpython-36.pyc and b/__pycache__/contextualise.cpython-36.pyc differ diff --git a/contextualise.py b/contextualise.py index 1e49c0f..c351efa 100644 --- a/contextualise.py +++ b/contextualise.py @@ -16,20 +16,29 @@ app.config.from_object(Config) # setting variables for holding paths, folder names and the one file for description path = "static/files/" jsonfiles = [] #json files - fullpathjsonfiles = [] #fullpath for some situations listingfiles= [] #fullpaths listingdirectories = [] #paths - -jsonfiles = [] #json files -fullpathjsonfiles = [] #fullpath for some situations thefile = None #selected file for description now = strftime("%Y-%m-%d_%H:%M:%S", gmtime()) #description time positioninarray = 8 #counter 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 = [] + +#reading wordlist.json +with open('wordlist.json', 'r') as f: + wordlist_dict = json.load(f) + + #listing paths and files, not in order but well... for path, subdirs, files in os.walk(path): for name in files: @@ -62,7 +71,7 @@ print("-------------------------") dict = {} #dict for the form entries -with open("static/"+jsonfiles[4], 'r') as f: +with open("static/"+jsonfilefordescription, 'r') as f: data_dict = json.load(f) datafromjson = data_dict["files"] print(datafromjson) @@ -88,7 +97,7 @@ def all(): def description(): #open json file, list filepaths in array and loop with thefile textfile="" - with open("static/"+jsonfiles[0], 'r') as f: + with open("static/"+jsonfilefordescription, 'r') as f: data_dict = json.load(f) datafromjson = data_dict["files"] itemid = data_dict["id"] @@ -107,7 +116,7 @@ def description(): @app.route('/diverge', methods=['GET']) def diverge(): searchterm=request.args.get('search') - return render_template('diverge.html', searchterm=searchterm) + return render_template('diverge.html', wordlist_dict=wordlist_dict, searchterm=searchterm) if __name__ == '__main__': app.run(debug=True) diff --git a/static/files/00. Pushing Scores/00.json b/static/files/00. Pushing Scores/00.json new file mode 100644 index 0000000..9bc2eff --- /dev/null +++ b/static/files/00. Pushing Scores/00.json @@ -0,0 +1,13 @@ +{ + "id": "00.", + "name": "Yes", + "email": "sure@whynot.com", + "friend": "Y", + "content": "A sound file.", + "files":[ + "files/00. Pushing Scores/Participants.txt", + "files/00. Pushing Scores/PushingScores.html", + "files/00. Pushing Scores/events.txt" + + ] +} diff --git a/templates/diverge.html b/templates/diverge.html index b2e4efd..f10004c 100644 --- a/templates/diverge.html +++ b/templates/diverge.html @@ -2,5 +2,10 @@ {% block content %}

test

-

{{searchterm}}

+

{{ searchterm }}

+{% for word in wordlist_dict %} + {% if word==searchterm %} + {{word[0]['way']}} + {% endif %} +{% endfor %} {% endblock %} diff --git a/wordlist_v2.json b/wordlist_v2.json new file mode 100644 index 0000000..650e325 --- /dev/null +++ b/wordlist_v2.json @@ -0,0 +1,13 @@ +{ + +"way" : [ + {"id": ["17", "He described his own art as a way of 'ensuring that the details of everyday life, the random constellations of objects that surround us, stop going unnoticed.'"]}, + {"id": ["00", "Our ambition, and that of our collaborating partners, is to emancipate graphic notation from the confines of the modernist tradition, in such a way that it may remain an innovative and provocative medium for decades to come."]} +], + +"artwork" : [ + {"id": ["17", "One of the originators of 'participatory' art, in which the artwork can only be experienced by the active involvement of the viewer, he is most famous for his Event Scores such as Drip Music 1962, and is widely seen as an important precursor to conceptual art."]}, + {"id": ["00", "It unfolds through a nomadic program which includes the creation of newly commissioned artworks and public events that addres scontemporary questions and issues in this particular field.", + "The discursive program for 2016–2017 will include lectures, presentations of newly commissioned artworks, concert evenings, and workshops."]} +] +}