|
|
@ -100,7 +100,7 @@ def home(): |
|
|
|
sessionid = "current_user.id" |
|
|
|
#add the very first time of connection to the interface |
|
|
|
# if veryfirstnow is None : |
|
|
|
session['veryfirstnow'] = datetime.now() |
|
|
|
session['veryfirstnow'] = datetime.now() |
|
|
|
return render_template('home.html') |
|
|
|
def functionsession(): |
|
|
|
return(session) |
|
|
@ -130,6 +130,7 @@ def description(): |
|
|
|
|
|
|
|
#open json file, list filepaths in array and loop with thefile |
|
|
|
textfile="" |
|
|
|
textfiles=[] |
|
|
|
with open("static/"+jsonfilefordescription, 'r') as f: |
|
|
|
data_dict = json.load(f) |
|
|
|
datafromjson = data_dict["files"] |
|
|
@ -139,12 +140,9 @@ def description(): |
|
|
|
if file.lower().endswith(('.html')): |
|
|
|
with open("static/"+file,"r", encoding='utf-8') as f: |
|
|
|
textfile = f.read() |
|
|
|
# wordlinked = "<a href='/diverge?search="+word+"'>"+word+"</a>" |
|
|
|
# textfile = re.sub(word, wordlinked, textfile) |
|
|
|
textfile = Markup(textfile) |
|
|
|
|
|
|
|
|
|
|
|
return render_template('description.html', datafromjson=datafromjson, itemid=itemid, textfile=textfile, idno=idno) |
|
|
|
textfiles.append(textfile) |
|
|
|
return render_template('description.html', datafromjson=datafromjson, itemid=itemid, textfiles=textfiles, idno=idno) |
|
|
|
|
|
|
|
@app.route('/diverge', methods=['GET']) |
|
|
|
def diverge(): |
|
|
@ -180,7 +178,7 @@ def get_file(): |
|
|
|
veryfirstnow = session['veryfirstnow'] |
|
|
|
tadam = None |
|
|
|
|
|
|
|
for t in timelist : |
|
|
|
for t in timelist : |
|
|
|
t = str(t) |
|
|
|
yo = dt.datetime.strptime(t, '%Y-%m-%d %H:%M:%S.%f') |
|
|
|
timelistforoperations.append(yo) |
|
|
@ -223,12 +221,12 @@ def get_file(): |
|
|
|
|
|
|
|
#If fullscore length superior 60 characters, insert linebreak |
|
|
|
|
|
|
|
# Defining splitting point |
|
|
|
# Defining splitting point |
|
|
|
n = 60 |
|
|
|
# Using list comprehension |
|
|
|
# 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) |
|
|
|
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" |
|
|
|