From d58346e7f44afdbce938bae253a03caaf5ec45c0 Mon Sep 17 00:00:00 2001 From: Cristina Cochior Date: Tue, 16 Apr 2019 18:53:21 +0200 Subject: [PATCH] last commit of the day --- .DS_Store | Bin 21508 -> 21508 bytes __pycache__/contextualise.cpython-36.pyc | Bin 2861 -> 3024 bytes contextualise.py | 25 +++++++++++++++-------- static/files/00. Pushing Scores/00.json | 13 ++++++++++++ templates/diverge.html | 7 ++++++- wordlist_v2.json | 13 ++++++++++++ 6 files changed, 49 insertions(+), 9 deletions(-) create mode 100644 static/files/00. Pushing Scores/00.json create mode 100644 wordlist_v2.json diff --git a/.DS_Store b/.DS_Store index ccfb04e7c37e98a7a6cdb96c0d568877e6b0d1b9..34f6869ac738ab2f9e9a54454ca107249a475e31 100644 GIT binary patch delta 166 zcmZo!!Pv5bae@>RL)%0dV^Ko}1_ovZ1_1_!M1~TEOorrw48!1wh02o+Ojss!vxrWP z5fGYeq#(4J$-)R3)e&$V^L!U1_ovZ1_1_!M1~TEOorr~;6HZWnC*e$wQ zM`s%I=IUD5q1_%xI2#{a`av3Jam@Jws VDB-o)PUQg8W)X`I(i0yD001bpMY{k1 diff --git a/__pycache__/contextualise.cpython-36.pyc b/__pycache__/contextualise.cpython-36.pyc index 063d10f19dd8426bb9968c92cfcabec8c2f894c9..5824120038f80fccb046e681346b913410011170 100644 GIT binary patch delta 1590 zcmah|OK%%h6uxI3o{3{8sbl;|oTr_K^G@p$(ne6JVFMC~7RhMT%5`#YoS8V|_Rg3_ zku4(`c7!IH6%xMy1eHLDZrD@;Ay%wMV#Qxz#R75eO`BTT;E~U{=ey@M-#PPb>W_5( zT09>8``;h$jSdp>7wP#W@O%sZ-tTAmr)OcVLkF#CI>e^agkDJ#sS{~pGS;HCbo2>ZLi@;C zX3NeBO>`kfPJz49dhNoBJDrTP$}()Zt5|C+=d6oFK-egr)@X`qpD9@)kr!z&NdXJ? zMrAMip2DL-8OuFNmdVkBp7!osw6`tW+p?BBFZ;v9&;Ktm8xf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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."]} +] +}