mirror of
https://github.com/FAUSheppy/ths-reference-data-collector
synced 2025-12-06 06:51:35 +01:00
fix: german 'märz' econding for sorting
This commit is contained in:
6
main.py
6
main.py
@@ -114,6 +114,8 @@ def checkLastMonths(backwardsMonths=6):
|
|||||||
|
|
||||||
# parse and dump
|
# parse and dump
|
||||||
mname = calendar.month_name[monthNumber]
|
mname = calendar.month_name[monthNumber]
|
||||||
|
if monthNumber == 3:
|
||||||
|
mname = "März" # fix german months
|
||||||
|
|
||||||
csvOut = os.path.join(CSV_DIR, 'Wetterdaten-{}-{}.csv'.format(mname, year))
|
csvOut = os.path.join(CSV_DIR, 'Wetterdaten-{}-{}.csv'.format(mname, year))
|
||||||
with open(csvOut, 'w', newline='', encoding="utf-8") as file:
|
with open(csvOut, 'w', newline='', encoding="utf-8") as file:
|
||||||
@@ -169,6 +171,10 @@ class Data:
|
|||||||
def __str__(self):
|
def __str__(self):
|
||||||
return "Data: {} {} {}".format(self.dtype, self.time, self.value)
|
return "Data: {} {} {}".format(self.dtype, self.time, self.value)
|
||||||
|
|
||||||
|
def sort_func(s):
|
||||||
|
tile = s.title.replace("März", calendar.month_name[3]) # fix german ä
|
||||||
|
return datetime.datetime.strptime(s.title, "Wetterdaten-%B-%Y.csv")
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|
||||||
# parse arguments #
|
# parse arguments #
|
||||||
|
|||||||
Reference in New Issue
Block a user