Exemplo n.º 1
0
def base():
    """
    Page behavior for the base url ('/') of the site. Handles redirection to other pages.
    Note: Returns a response object (often a render_template call) to flask and eventually
          to the browser.
    """
    if 'id' not in session:
        session_functions.init() # Initialize the session if needed
    return redirect(url_for('upload'))
Exemplo n.º 2
0
def reset():
    """
    Resets the session and initializes a new one every time the reset URL is used
    (either manually or via the "Reset" button)
    Note: Returns a response object (often a render_template call) to flask and eventually
          to the browser.
    """
    session_functions.reset()  # Reset the session and session folder
    session_functions.init()  # Initialize the new session
    return redirect(url_for('upload'))
Exemplo n.º 3
0
def base():
    """
    Page behavior for the base url ('/') of the site. Handles redirection to other pages.
    Note: Returns a response object (often a render_template call) to flask and eventually
          to the browser.
    """
    try:
        if not os.path.isdir(os.path.join(constants.UPLOAD_FOLDER, session['id'])):
            session_functions.init()  # Check browser for recent Lexos session
    except:
        if 'id' not in session:  # If session was never generated
            session_functions.init()  # Initialize the session if needed

    return redirect(url_for('upload'))