mirror of
https://github.com/FAUSheppy/ths-reference-data-collector
synced 2025-12-07 23:31:35 +01:00
fix: locale check & remove special handling
This commit is contained in:
4
main.py
4
main.py
@@ -17,7 +17,7 @@ import locale
|
|||||||
import fallback_csv
|
import fallback_csv
|
||||||
import platform
|
import platform
|
||||||
|
|
||||||
if not platform.system() == "Linux":
|
if platform.system() != "Linux":
|
||||||
locale.setlocale(locale.LC_TIME, "de_DE.UTF-8")
|
locale.setlocale(locale.LC_TIME, "de_DE.UTF-8")
|
||||||
|
|
||||||
CSV_DIR = "csvfiles"
|
CSV_DIR = "csvfiles"
|
||||||
@@ -114,8 +114,6 @@ 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:
|
||||||
|
|||||||
Reference in New Issue
Block a user