|
@ -44,19 +44,19 @@ pathofnumbers = [] |
|
|
app.secret_key = 'your secret' |
|
|
app.secret_key = 'your secret' |
|
|
app.config['SESSION_TYPE'] = 'filesystem' |
|
|
app.config['SESSION_TYPE'] = 'filesystem' |
|
|
|
|
|
|
|
|
def setupSession(): |
|
|
def clearSession(): |
|
|
# session should be configured from within request context |
|
|
|
|
|
# so this function should be called on each request |
|
|
|
|
|
if 'wordpath' not in session: |
|
|
|
|
|
# Flask sessions are serialised into a cookie, so we cannot use the deque here |
|
|
# Flask sessions are serialised into a cookie, so we cannot use the deque here |
|
|
session['wordpath'] = [] |
|
|
session['wordpath'] = [] |
|
|
if 'clicktime' not in session: |
|
|
|
|
|
session['clicktime'] = [] |
|
|
session['clicktime'] = [] |
|
|
if 'id' not in session: |
|
|
|
|
|
session['id'] = [] |
|
|
session['id'] = [] |
|
|
if 'veryfirstnow' not in session: |
|
|
|
|
|
session['veryfirstnow'] = datetime.now().isoformat() |
|
|
session['veryfirstnow'] = datetime.now().isoformat() |
|
|
|
|
|
|
|
|
|
|
|
def setupSession(): |
|
|
|
|
|
# session should be configured from within request context |
|
|
|
|
|
# so this function should be called on each request |
|
|
|
|
|
if 'veryfirstnow' not in session: |
|
|
|
|
|
clearSession() |
|
|
|
|
|
|
|
|
# preparing the index.json file for the navbar |
|
|
# preparing the index.json file for the navbar |
|
|
index_dict = {} |
|
|
index_dict = {} |
|
|
|
|
|
|
|
@ -125,6 +125,13 @@ def about(): |
|
|
|
|
|
|
|
|
return render_template('about.html') |
|
|
return render_template('about.html') |
|
|
|
|
|
|
|
|
|
|
|
@app.route('/clear') |
|
|
|
|
|
def clear(): |
|
|
|
|
|
# return to a refer if its set, default to root |
|
|
|
|
|
return_url = request.environ.get("HTTP_REFERER", '/') |
|
|
|
|
|
clearSession() |
|
|
|
|
|
return redirect(return_url) |
|
|
|
|
|
|
|
|
# @app.route('/all/') |
|
|
# @app.route('/all/') |
|
|
# def all(): |
|
|
# def all(): |
|
|
# thefile = listingfiles[positioninarray] |
|
|
# thefile = listingfiles[positioninarray] |
|
|