Commit 0d520b3a authored by PizZaKatZe's avatar PizZaKatZe

Fix type warnings

parent 55967f85
......@@ -71,8 +71,8 @@ def process_sessions(sessions: List[Dict], day: int) -> List[Dict]:
return datetime.fromtimestamp(int(start['timestamp'])).day == day
def relevant(session: Dict) -> bool:
return bool(list(filter(is_correct_date, session['printouts']['Start'])))
sessions = [transform_session(s, day) for s in sessions if relevant(s)]
sessions = [s for ss in sessions for s in ss]
sessionss = [transform_session(s, day) for s in sessions if relevant(s)]
sessions = [s for ss in sessionss for s in ss]
sessions.sort(key=lambda a: a['start'])
return sessions
......@@ -124,6 +124,6 @@ def transform_session(session: Dict, day: int) -> List[Dict]:
title = sub('Session:', '', session['fulltext'])
url = session['fullurl']
providers = ', '.join(map(process_provider, session['printouts']['organized by']))
starts = list(map(parse_date, session['printouts']['Start']))
starts = [s.strftime('%H:%M') for s in filter(lambda d: d.day == day, starts)]
start_dates = list(map(parse_date, session['printouts']['Start']))
starts = [s.strftime('%H:%M') for s in filter(lambda d: d.day == day, start_dates)]
return [build_session(title, url, providers, s) for s in starts]
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