Rename stuple
This commit is contained in:
		@@ -68,7 +68,7 @@ def get_data(conn):
 | 
			
		||||
        return get_data(conn)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
def select_final_time(conn, day, stuple):
 | 
			
		||||
def select_final_time(conn, day, data):
 | 
			
		||||
    """Select student finishing time.
 | 
			
		||||
 | 
			
		||||
    Returns ending time (type struct_time) of final lesson student must
 | 
			
		||||
@@ -76,7 +76,7 @@ def select_final_time(conn, day, stuple):
 | 
			
		||||
 | 
			
		||||
    :param conn: Connection object
 | 
			
		||||
    :param day: current weekday, lowercase str
 | 
			
		||||
    :param stuple: student data tuple returned by get_data
 | 
			
		||||
    :param data: student data tuple returned by get_data
 | 
			
		||||
    """
 | 
			
		||||
    cur = conn.cursor()
 | 
			
		||||
    # Select finishing time of IB lessons.
 | 
			
		||||
@@ -94,14 +94,14 @@ def select_final_time(conn, day, stuple):
 | 
			
		||||
            AND lesson_class = ?
 | 
			
		||||
        ORDER BY end_time DESC
 | 
			
		||||
        LIMIT 1
 | 
			
		||||
        """, (stuple[0], day, stuple[1]))  # Queries return None if no matches.
 | 
			
		||||
        """, (data[0], day, data[1]))  # Queries return None if no matches.
 | 
			
		||||
    ib_finish = cur.fetchone()
 | 
			
		||||
    if ib_finish is not None:
 | 
			
		||||
        ib_finish = parse_time_string(ib_finish[0])
 | 
			
		||||
 | 
			
		||||
    # Select finishing time of other lessons.
 | 
			
		||||
    others = []
 | 
			
		||||
    for subject in stuple[2]:
 | 
			
		||||
    for subject in data[2]:
 | 
			
		||||
        cur.execute("""
 | 
			
		||||
            SELECT end_time
 | 
			
		||||
            FROM timetable
 | 
			
		||||
@@ -111,7 +111,7 @@ def select_final_time(conn, day, stuple):
 | 
			
		||||
                AND lesson_class = ?
 | 
			
		||||
            ORDER BY end_time DESC
 | 
			
		||||
            LIMIT 1
 | 
			
		||||
            """, (subject, stuple[0], day, stuple[1]))
 | 
			
		||||
            """, (subject, data[0], day, data[1]))
 | 
			
		||||
        subject_finish = cur.fetchone()
 | 
			
		||||
        if subject_finish is not None:
 | 
			
		||||
            others.append(parse_time_string(subject_finish[0]))
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user