Browse Source

last commit of the day

master
Cristina Cochior 6 years ago
parent
commit
d58346e7f4
  1. BIN
      .DS_Store
  2. BIN
      __pycache__/contextualise.cpython-36.pyc
  3. 25
      contextualise.py
  4. 13
      static/files/00. Pushing Scores/00.json
  5. 5
      templates/diverge.html
  6. 13
      wordlist_v2.json

BIN
.DS_Store

Binary file not shown.

BIN
__pycache__/contextualise.cpython-36.pyc

Binary file not shown.

25
contextualise.py

@ -16,20 +16,29 @@ app.config.from_object(Config)
# setting variables for holding paths, folder names and the one file for description # setting variables for holding paths, folder names and the one file for description
path = "static/files/" path = "static/files/"
jsonfiles = [] #json files jsonfiles = [] #json files
fullpathjsonfiles = [] #fullpath for some situations fullpathjsonfiles = [] #fullpath for some situations
listingfiles= [] #fullpaths listingfiles= [] #fullpaths
listingdirectories = [] #paths listingdirectories = [] #paths
jsonfiles = [] #json files
fullpathjsonfiles = [] #fullpath for some situations
thefile = None #selected file for description thefile = None #selected file for description
now = strftime("%Y-%m-%d_%H:%M:%S", gmtime()) #description time now = strftime("%Y-%m-%d_%H:%M:%S", gmtime()) #description time
positioninarray = 8 #counter positioninarray = 8 #counter
listofdicts=[] #to be able to import and use json content listofdicts=[] #to be able to import and use json content
datafromjson = [] 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... #listing paths and files, not in order but well...
for path, subdirs, files in os.walk(path): for path, subdirs, files in os.walk(path):
for name in files: for name in files:
@ -62,7 +71,7 @@ print("-------------------------")
dict = {} #dict for the form entries 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) data_dict = json.load(f)
datafromjson = data_dict["files"] datafromjson = data_dict["files"]
print(datafromjson) print(datafromjson)
@ -88,7 +97,7 @@ def all():
def description(): def description():
#open json file, list filepaths in array and loop with thefile #open json file, list filepaths in array and loop with thefile
textfile="" textfile=""
with open("static/"+jsonfiles[0], 'r') as f: with open("static/"+jsonfilefordescription, 'r') as f:
data_dict = json.load(f) data_dict = json.load(f)
datafromjson = data_dict["files"] datafromjson = data_dict["files"]
itemid = data_dict["id"] itemid = data_dict["id"]
@ -107,7 +116,7 @@ def description():
@app.route('/diverge', methods=['GET']) @app.route('/diverge', methods=['GET'])
def diverge(): def diverge():
searchterm=request.args.get('search') 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__': if __name__ == '__main__':
app.run(debug=True) app.run(debug=True)

13
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"
]
}

5
templates/diverge.html

@ -3,4 +3,9 @@
<p>test</p> <p>test</p>
<p>{{ searchterm }}</p> <p>{{ searchterm }}</p>
{% for word in wordlist_dict %}
{% if word==searchterm %}
{{word[0]['way']}}
{% endif %}
{% endfor %}
{% endblock %} {% endblock %}

13
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."]}
]
}
Loading…
Cancel
Save