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