Remove try catch

This commit is contained in:
Maximilian Giller 2023-10-11 01:13:59 +02:00
parent 6dcd8c7a47
commit 244c4ced38

View file

@ -107,33 +107,25 @@ def exitClock ():
try:
serial=spi(port=0, device=0, gpio=noop())
device=max7219(serial, width=32, height=8, rotate=2, block_orientation=-90)
serial=spi(port=0, device=0, gpio=noop())
device=max7219(serial, width=32, height=8, rotate=2, block_orientation=-90)
device.contrast(stdContrast)
device.contrast(stdContrast)
while True:
#while getMsgInc():
# time.sleep(1)
while True:
#while getMsgInc():
# time.sleep(1)
if timeInNightRange():
printDark()
now = datetime.now()
timeUntilMorning = 6 - now.hour - (3600 - 60*now.minute - now.second)
time.sleep(timeUntilMorning)
if timeInNightRange():
printDark()
now = datetime.now()
timeUntilMorning = 6 - now.hour - (3600 - 60*now.minute - now.second)
time.sleep(timeUntilMorning)
printClock()
printClock()
#if getDirectmessengerState() == False :
# initializeDirectmessenger()
#if getDirectmessengerState() == False :
# initializeDirectmessenger()
timeUntilNextMinute = 60 - datetime.now().second
time.sleep(timeUntilNextMinute)
except KeyboardInterrupt:
print("Matrixclock shuts down, because of ^C")
exitClock()
exit()
except BaseException:
exitClock()
exit()
timeUntilNextMinute = 60 - datetime.now().second
time.sleep(timeUntilNextMinute)