From 96bc42869431da08f90940b6bcb8466c6e02cbec Mon Sep 17 00:00:00 2001 From: Evan Chen Date: Mon, 12 Feb 2024 14:01:46 -0500 Subject: [PATCH] feat(elmo): Autodetect ELMO max year --- elmo/assemble.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/elmo/assemble.py b/elmo/assemble.py index 30b0dc7..67ff5e5 100644 --- a/elmo/assemble.py +++ b/elmo/assemble.py @@ -1,4 +1,3 @@ -import datetime import heapq import sys @@ -9,13 +8,13 @@ BASE = r"file:///home/evan/Sync/www/elmo/" else: BASE = r"//web.evanchen.cc/elmo/" -YEAR_NEXT = datetime.datetime.today().year -YEAR_PREV = YEAR_NEXT - 1 -YEARS = range(2012, YEAR_NEXT + 1) with open("internal/prob_links.yaml") as d: data = yaml.load(d, Loader=yaml.SafeLoader) - PREV_URL = data[YEAR_PREV]["AoPS Thread"] - NEXT_URL = data[YEAR_NEXT]["AoPS Thread"] +YEAR_NEXT = max(data.keys()) +YEAR_PREV = YEAR_NEXT - 1 +YEARS = range(2012, YEAR_NEXT + 1) +PREV_URL = data[YEAR_PREV]["AoPS Thread"] +NEXT_URL = data[YEAR_NEXT]["AoPS Thread"] # Create header {{{1 with open("static/header.html") as f: