]> vcs.slashdirt.org Git - sw/tic2json.git/commitdiff

vcs.slashdirt.org Git - sw/tic2json.git/commitdiff

git git / sw / tic2json.git / commitdiff
? search:
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: bd956cb)
tools/ticprocess.py: ensure RTE start date is future
Fri, 8 Dec 2023 10:56:44 +0000 (11:56 +0100)
Fri, 8 Dec 2023 13:35:08 +0000 (14:35 +0100)
Just in case the API suddenly decides to serve old data by default


diff --git a/tools/ticprocess.py b/tools/ticprocess.py
index 3f60235cd88c8660419dfa3b47541904f0d57a29..745e7fa71c67958d4478b0afc10546492749bbb1 100755 (executable)
--- a/tools/ticprocess.py
+++ b/tools/ticprocess.py
@@ -4,7 +4,7 @@
## ticprocess.py
## Basic processing of tic2json dictionary output
##
-## (C) 2022 Thibaut VARENE
+## (C) 2022-2023 Thibaut VARENE
## License: GPLv2 - http://www.gnu.org/licenses/gpl-2.0.html
##
@@ -66,7 +66,9 @@ def fetch_rte_ncolor():
now = datetime.now(udate.tzinfo)
- if (now.day != udate.day):
+ if (now.day != udate.day): # skip if update day isn't today
+ return None
+ elif (sdate < now): # skip if start date is past
return None
else:
match color:
@@ -174,9 +176,7 @@ for ticjsonline in sys.stdin:
delest = inhibit_loads(tic) or over_vatresh(tic)
edhwok = allow_edhw(tic)
dayhc = day_hc(tic)
- colors = tempo_colors(tic)
- dc = colors[0]
- ndc = colors[1]
+ (dc, ndc) = tempo_colors(tic)
p = tic.get(ETIQ_POWER)
p = p and p.get("data")
tic2json TIC parser/converter
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /