コード例 #1
0
ファイル: app.py プロジェクト: giobel/FlaskTest
def drawingRegister():
    object_list = helpers.get_csv()
    return render_template('drawingRegister.html', object_list=object_list)
コード例 #2
0
import statistics as st

# miscellanous functions
import helpers as hp

# hash of hash.
# the first indice is the time difference between two
# coordinated objects. the second one is referring to a
# session. if a session refered by i has a value of 5, it
# means that it has 5 correlated objects with a predecessor at
# exactly i times steps behind.
session_sequences = {}
# keeps track of the number of events taken into account for one
# session in order to normalize
session_norm = {}
for file_path in hp.get_csv():
# iterating over the files (sessions)
    session_id = hp.get_id(file_path)
    # The Id in an integer
    session_id = int(session_id)
    session_norm[session_id] = 0
    # the name of the session is used as a table name in the
    # database
    session_name = hp.get_name(file_path)
    # array of arrays, stores for each coordinated object the
    # list of timespans between student switches
    event_time_differences = []

    con = lite.connect('mysteries.db')
    with con:
        cur = con.cursor()
コード例 #3
0
import sqlite3 as lite
import csv
import helpers as hp

# List of actions taken into account in the analysis
auth_actions = hp.auth_actions
# Objects that doesn't have an id
no_id_array = hp.no_id_array


for file_path in hp.get_csv():
# iterating over the logs files. each log file corresponds to
# a team solving a problem. A team solving a problem is called
# a session

    # extracting the id and the name of the "sessions" 
    session_id = hp.get_id(file_path)
    session_name = hp.get_name(file_path)

    con = lite.connect('mysteries.db')
    with con:
    # Cleaning and initializing the database.
        cur = con.cursor()
        try:
            cur.execute("\
                DROP TABLE %s;\
            " % (session_name))
        except:
            print("Table %s could not be dropped, not created yet"\
                    % (session_name))
        # Each tuple in database corresponds to an action