mirror of
https://github.com/FAUSheppy/ths-reference-data-collector
synced 2025-12-06 06:51:35 +01:00
fix: use new sorting function
This commit is contained in:
5
main.py
5
main.py
@@ -172,8 +172,8 @@ class Data:
|
|||||||
return "Data: {} {} {}".format(self.dtype, self.time, self.value)
|
return "Data: {} {} {}".format(self.dtype, self.time, self.value)
|
||||||
|
|
||||||
def sort_func(s):
|
def sort_func(s):
|
||||||
tile = s.title.replace("März", calendar.month_name[3]) # fix german ä
|
title = s.title.replace("März", calendar.month_name[3]) # fix german ä
|
||||||
return datetime.datetime.strptime(s.title, "Wetterdaten-%B-%Y.csv")
|
return datetime.datetime.strptime(title, "Wetterdaten-%B-%Y.csv")
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|
||||||
@@ -245,7 +245,6 @@ if __name__ == "__main__":
|
|||||||
cell.alignment = openpyxl.styles.Alignment(horizontal='center')
|
cell.alignment = openpyxl.styles.Alignment(horizontal='center')
|
||||||
|
|
||||||
# sort the sheets #
|
# sort the sheets #
|
||||||
sort_func = lambda s: datetime.datetime.strptime(s.title, "Wetterdaten-%B-%Y.csv")
|
|
||||||
wb._sheets.sort(key=sort_func, reverse=True)
|
wb._sheets.sort(key=sort_func, reverse=True)
|
||||||
|
|
||||||
wb.save(outfileRaw)
|
wb.save(outfileRaw)
|
||||||
|
|||||||
Reference in New Issue
Block a user