Commit 4896733f authored by PizZaKatZe's avatar PizZaKatZe

Sort sessions by start time

parent 410bd391
......@@ -61,8 +61,9 @@ def process_sessions(sessions: List[Dict]) -> List[Dict]:
return datetime.fromtimestamp(int(start['timestamp'])).day == 27
def relevant(session: Dict) -> bool:
return bool(list(filter(is_correct_date, session['printouts']['Start'])))
sessions = list(filter(relevant, sessions))
return list(map(transform_session, sessions))
sessions = [transform_session(s) for s in sessions if relevant(s)]
sessions.sort(key=lambda a: a['start'])
return sessions
def read_data(path: str) -> List[Dict]:
"""Reads self-organized session data from file.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment