...
 
Commits (2)
......@@ -45,7 +45,7 @@ def generate_flyer(sessions: List[Dict]) -> bytes:
"""
env = make_env(loader=FileSystemLoader(dirname(__file__)))
template = env.get_template('template.tex')
pdf = build_pdf(template.render(sessions=sessions))
pdf = build_pdf(template.render(sessions=sessions, urls=True))
return pdf.__bytes__()
def process_sessions(sessions: List[Dict]) -> List[Dict]:
......@@ -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.
......
......@@ -25,10 +25,10 @@
\begin{longtable}{|p{0.45\linewidth}|p{0.2\linewidth}|l|l|}
\hline
\textbf{Was?} & \textbf{Wo?} & \textbf{Wann?} & \textbf{URL}
\textbf{Wann?} & \textbf{Was?} & \textbf{Wo?} & \textbf{URL}
\\ \hline \hline
%- for session in sessions
\VAR{session.title | e} & \VAR{session.providers | e} & \VAR{session.start | e}
\VAR{session.start | e} & \VAR{session.title | e} & \VAR{session.providers | e}
& \qrcode{\VAR{session.url | e}}
\\ \hline
%- endfor
......