Einzüge gefixt
This commit is contained in:
parent
070cf59b2e
commit
70617fdbe0
@ -85,8 +85,8 @@ def read_file(jahr):
|
||||
# print(f'Column names are {", ".join(row)}')
|
||||
lines += 1
|
||||
else:
|
||||
if isinstance(row, list):
|
||||
antwort_liste.append(row)
|
||||
if isinstance(row, list):
|
||||
antwort_liste.append(row)
|
||||
except FileNotFoundError:
|
||||
pass
|
||||
|
||||
@ -154,19 +154,19 @@ if __name__ == '__main__':
|
||||
tomorrow = (datetime.now() + timedelta(1)).strftime('%d.%m.%Y')
|
||||
index = set();
|
||||
for row in antwort_liste:
|
||||
try:
|
||||
pos = row.index(tomorrow)
|
||||
if pos < 4:
|
||||
index.add(pos)
|
||||
except ValueError:
|
||||
pass
|
||||
try:
|
||||
pos = row.index(tomorrow)
|
||||
if pos < 4:
|
||||
index.add(pos)
|
||||
except ValueError:
|
||||
pass
|
||||
|
||||
wird = 'wird' if len(index) < 2 else 'werden'
|
||||
tonnen = []
|
||||
for pos in index:
|
||||
tonnen.append(muell_arten[pos])
|
||||
tonnen.append(muell_arten[pos])
|
||||
|
||||
if len(tonnen) > 0:
|
||||
tonnen = ' und '.join(tonnen)
|
||||
# Jetzt den Bot ansprechen
|
||||
os.system(f'echo "Morgen {wird} {tonnen} abgeholt" | {config["pathBot"]} -u {config["tgReceiver"]}')
|
||||
tonnen = ' und '.join(tonnen)
|
||||
# Jetzt den Bot ansprechen
|
||||
os.system(f'echo "Morgen {wird} {tonnen} abgeholt" | {config["pathBot"]} -u {config["tgReceiver"]}')
|
||||
|
Loading…
Reference in New Issue
Block a user