|
|
@ -112,9 +112,10 @@ def functionsession(): |
|
|
|
return(session) |
|
|
|
|
|
|
|
# THIS IS NOT WORKING YET DUNNO WHY |
|
|
|
# @app.context_processor |
|
|
|
# def context_processor(): |
|
|
|
# return dict(functionsession=functionsession) |
|
|
|
@app.context_processor |
|
|
|
def context_processor(): |
|
|
|
functionsession = session['wordpath'] |
|
|
|
return dict(functionsession=functionsession) |
|
|
|
|
|
|
|
@app.route('/about/') |
|
|
|
def about(): |
|
|
@ -182,7 +183,21 @@ def get_file(): |
|
|
|
idlist = session["id"] |
|
|
|
timelist = session["clicktime"] |
|
|
|
veryfirstnow = session['veryfirstnow'] |
|
|
|
clickongetfiletime = datetime.now() |
|
|
|
|
|
|
|
tadam = None |
|
|
|
initialtime = None |
|
|
|
|
|
|
|
if not (timelist[0] is None): |
|
|
|
thetime = timelist[0] |
|
|
|
thetime = str(thetime) |
|
|
|
thetime = dt.datetime.strptime(thetime, '%Y-%m-%d %H:%M:%S.%f') |
|
|
|
initialtime = thetime - veryfirstnow |
|
|
|
initialtime = initialtime.total_seconds() |
|
|
|
initialtime = int(initialtime) |
|
|
|
initialtime = "."*initialtime |
|
|
|
|
|
|
|
print(initialtime) |
|
|
|
|
|
|
|
for t in timelist : |
|
|
|
t = str(t) |
|
|
@ -192,7 +207,16 @@ def get_file(): |
|
|
|
prev = None |
|
|
|
wholestringy = None |
|
|
|
|
|
|
|
print("veryfirstnow : "+str(veryfirstnow)+"\n") |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (word, time, uniqueid) in zip(wordpath,timelistforoperations, idlist): |
|
|
|
print("word : "+word+"\n") |
|
|
|
print("timeofclick : "+str(time)+"\n") |
|
|
|
print("============") |
|
|
|
print(wordpath) |
|
|
|
print("============") |
|
|
|
filler = int(uniqueid) |
|
|
|
upperword = word.upper() |
|
|
|
|
|
|
@ -225,18 +249,41 @@ def get_file(): |
|
|
|
fullscore = wholestringy |
|
|
|
|
|
|
|
|
|
|
|
#If fullscore length superior 60 characters, insert linebreak |
|
|
|
# #If fullscore length superior 60 characters, insert linebreak |
|
|
|
|
|
|
|
# # Defining splitting point |
|
|
|
# n = 60 |
|
|
|
# # Using list comprehension |
|
|
|
# out = [(fullscore[i:i+n]) for i in range(0, len(fullscore), n)] |
|
|
|
# #joining the strings with linebreaks |
|
|
|
# tadam = '\n'.join(out) |
|
|
|
|
|
|
|
|
|
|
|
if not (fullscore is None): |
|
|
|
# outside of the loop calculate seconds from "clickongetfiletime" minus the last "time" from the loop |
|
|
|
lastdifftime = clickongetfiletime - prev |
|
|
|
lastdifftime = lastdifftime.total_seconds() |
|
|
|
lastdifftime = int(lastdifftime) |
|
|
|
lastdifftime = lastdifftime * '.' |
|
|
|
#the 60 seconds thing |
|
|
|
# print(lastdifftime+"\n") |
|
|
|
fullscore = initialtime+fullscore+lastdifftime |
|
|
|
# Defining splitting point |
|
|
|
n = 60 |
|
|
|
# Using list comprehension |
|
|
|
out = [(fullscore[i:i+n]) for i in range(0, len(fullscore), n)] |
|
|
|
#joining the strings with linebreaks |
|
|
|
tadam = '\n'.join(out) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# have a message in file if no nav has been recorded so it's less dull than error page |
|
|
|
if tadam is None: |
|
|
|
tadam = "This score is Null" |
|
|
|
|
|
|
|
# print("verylastnow : "+str(clickongetfilefime)+"\n") |
|
|
|
|
|
|
|
|
|
|
|
print(tadam) |
|
|
|
|
|
|
|
return Response(tadam, |
|
|
|