|
@ -112,9 +112,10 @@ def functionsession(): |
|
|
return(session) |
|
|
return(session) |
|
|
|
|
|
|
|
|
# THIS IS NOT WORKING YET DUNNO WHY |
|
|
# THIS IS NOT WORKING YET DUNNO WHY |
|
|
# @app.context_processor |
|
|
@app.context_processor |
|
|
# def context_processor(): |
|
|
def context_processor(): |
|
|
# return dict(functionsession=functionsession) |
|
|
functionsession = session['wordpath'] |
|
|
|
|
|
return dict(functionsession=functionsession) |
|
|
|
|
|
|
|
|
@app.route('/about/') |
|
|
@app.route('/about/') |
|
|
def about(): |
|
|
def about(): |
|
@ -182,7 +183,21 @@ def get_file(): |
|
|
idlist = session["id"] |
|
|
idlist = session["id"] |
|
|
timelist = session["clicktime"] |
|
|
timelist = session["clicktime"] |
|
|
veryfirstnow = session['veryfirstnow'] |
|
|
veryfirstnow = session['veryfirstnow'] |
|
|
|
|
|
clickongetfiletime = datetime.now() |
|
|
|
|
|
|
|
|
tadam = None |
|
|
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 : |
|
|
for t in timelist : |
|
|
t = str(t) |
|
|
t = str(t) |
|
@ -192,7 +207,16 @@ def get_file(): |
|
|
prev = None |
|
|
prev = None |
|
|
wholestringy = None |
|
|
wholestringy = None |
|
|
|
|
|
|
|
|
|
|
|
print("veryfirstnow : "+str(veryfirstnow)+"\n") |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (word, time, uniqueid) in zip(wordpath,timelistforoperations, idlist): |
|
|
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) |
|
|
filler = int(uniqueid) |
|
|
upperword = word.upper() |
|
|
upperword = word.upper() |
|
|
|
|
|
|
|
@ -225,18 +249,41 @@ def get_file(): |
|
|
fullscore = wholestringy |
|
|
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 |
|
|
# Defining splitting point |
|
|
n = 60 |
|
|
n = 60 |
|
|
# Using list comprehension |
|
|
# Using list comprehension |
|
|
out = [(fullscore[i:i+n]) for i in range(0, len(fullscore), n)] |
|
|
out = [(fullscore[i:i+n]) for i in range(0, len(fullscore), n)] |
|
|
#joining the strings with linebreaks |
|
|
#joining the strings with linebreaks |
|
|
tadam = '\n'.join(out) |
|
|
tadam = '\n'.join(out) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# have a message in file if no nav has been recorded so it's less dull than error page |
|
|
# have a message in file if no nav has been recorded so it's less dull than error page |
|
|
if tadam is None: |
|
|
if tadam is None: |
|
|
tadam = "This score is Null" |
|
|
tadam = "This score is Null" |
|
|
|
|
|
|
|
|
|
|
|
# print("verylastnow : "+str(clickongetfilefime)+"\n") |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
print(tadam) |
|
|
print(tadam) |
|
|
|
|
|
|
|
|
return Response(tadam, |
|
|
return Response(tadam, |
|
|