Optionaler Name für eine Konfiguration hinzugefügt
This commit is contained in:
@@ -62,6 +62,12 @@ class Muell:
|
|||||||
'User-Agent': 'Mozilla/5.0 (Linux; x68_64; x64; rv:88.0) Gecko/20100101 Firefox/88.0',
|
'User-Agent': 'Mozilla/5.0 (Linux; x68_64; x64; rv:88.0) Gecko/20100101 Firefox/88.0',
|
||||||
'Content-Type': 'application/x-www-form-urlencoded',
|
'Content-Type': 'application/x-www-form-urlencoded',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try:
|
||||||
|
self.__name = self.__config['name']
|
||||||
|
except KeyError:
|
||||||
|
self.__name = None
|
||||||
|
|
||||||
kommune = self.__config['kommune']
|
kommune = self.__config['kommune']
|
||||||
self.__csv = f'muell-{kommune}-{self.__current_year}.csv'
|
self.__csv = f'muell-{kommune}-{self.__current_year}.csv'
|
||||||
|
|
||||||
@@ -176,7 +182,10 @@ class Muell:
|
|||||||
|
|
||||||
if len(tonnen) > 0:
|
if len(tonnen) > 0:
|
||||||
tonnen = ' und '.join(tonnen)
|
tonnen = ' und '.join(tonnen)
|
||||||
ausgabe = f'Morgen {wird} {tonnen} abgeholt'
|
if self.__name is not None:
|
||||||
|
ausgabe = f'{self.__name}: Morgen {wird} {tonnen} abgeholt'
|
||||||
|
else:
|
||||||
|
ausgabe = f'Morgen {wird} {tonnen} abgeholt'
|
||||||
else:
|
else:
|
||||||
ausgabe = None
|
ausgabe = None
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user