diff options
| author | Kévin Le Gouguec <kevin.legouguec@gmail.com> | 2022-02-13 13:55:32 +0100 |
|---|---|---|
| committer | Kévin Le Gouguec <kevin.legouguec@gmail.com> | 2022-02-13 13:55:32 +0100 |
| commit | 368daac4cd6a33352d92eddfe656e2f357275c8b (patch) | |
| tree | 95e553fc88ef35de11028ad0932caa7396765f97 /build-concerts.py | |
| parent | c78f1b08f451027ffaf3666710433442fdb3031e (diff) | |
| download | quatuorbellefeuille.com-368daac4cd6a33352d92eddfe656e2f357275c8b.tar.xz | |
DRY up the code
Diffstat (limited to 'build-concerts.py')
| -rwxr-xr-x | build-concerts.py | 7 |
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 = { |
