summaryrefslogtreecommitdiff
path: root/build-concerts.py
diff options
context:
space:
mode:
authorKévin Le Gouguec <kevin.legouguec@gmail.com>2022-02-13 13:55:32 +0100
committerKévin Le Gouguec <kevin.legouguec@gmail.com>2022-02-13 13:55:32 +0100
commit368daac4cd6a33352d92eddfe656e2f357275c8b (patch)
tree95e553fc88ef35de11028ad0932caa7396765f97 /build-concerts.py
parentc78f1b08f451027ffaf3666710433442fdb3031e (diff)
downloadquatuorbellefeuille.com-368daac4cd6a33352d92eddfe656e2f357275c8b.tar.xz
DRY up the code
Diffstat (limited to 'build-concerts.py')
-rwxr-xr-xbuild-concerts.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/build-concerts.py b/build-concerts.py
index e41dda1..43dce57 100755
--- a/build-concerts.py
+++ b/build-concerts.py
@@ -128,11 +128,14 @@ def read_concerts(filename):
def split_concerts(concerts, threshold):
+ cutoff = len(concerts)
+
for i, c in enumerate(concerts):
if c.time > threshold:
- return reversed(concerts[:i]), concerts[i:]
+ cutoff = i
+ break
- return reversed(concerts), ()
+ return reversed(concerts[:cutoff]), concerts[cutoff:]
LOCALIZED_TEXT = {