Skip to content

Commit 7dc2376

Browse files
committed
Replace hardcoded EOLs
1 parent c47ae7b commit 7dc2376

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

history_plot.py

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,7 @@
2121
from termcolor import colored # pip install termcolor
2222

2323
from history_get import load_jsonlines
24-
25-
EOL = {
26-
"2.7": "2020-01-01",
27-
"3.4": "2019-03-18",
28-
"3.5": "2020-09-30",
29-
"3.6": "2021-12-23",
30-
"3.7": "2023-06-27",
31-
}
24+
from template import get_eols
3225

3326

3427
def dopplr(name):
@@ -56,13 +49,14 @@ def make_chart(dates, totals):
5649
fig, ax = plt.subplots()
5750

5851
print("Plot...")
52+
eol = get_eols()
5953
for version, v in totals.items():
6054
print(version)
6155

62-
if version in EOL and EOL[version] in dates:
56+
if version in eol and eol[version] in dates:
6357
# Add a vertical line to zero at EOL
64-
eol_pos = dates.index(EOL[version])
65-
# dates.insert(eol_pos, EOL[version])
58+
eol_pos = dates.index(eol[version])
59+
# dates.insert(eol_pos, eol[version])
6660
totals[version][eol_pos] = 0
6761
# breakpoint()
6862

0 commit comments

Comments
 (0)