Remove try catch
This commit is contained in:
parent
6dcd8c7a47
commit
244c4ced38
1 changed files with 16 additions and 24 deletions
|
@ -107,33 +107,25 @@ def exitClock ():
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
try:
|
serial=spi(port=0, device=0, gpio=noop())
|
||||||
serial=spi(port=0, device=0, gpio=noop())
|
device=max7219(serial, width=32, height=8, rotate=2, block_orientation=-90)
|
||||||
device=max7219(serial, width=32, height=8, rotate=2, block_orientation=-90)
|
|
||||||
|
|
||||||
device.contrast(stdContrast)
|
device.contrast(stdContrast)
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
#while getMsgInc():
|
#while getMsgInc():
|
||||||
# time.sleep(1)
|
# time.sleep(1)
|
||||||
|
|
||||||
if timeInNightRange():
|
if timeInNightRange():
|
||||||
printDark()
|
printDark()
|
||||||
now = datetime.now()
|
now = datetime.now()
|
||||||
timeUntilMorning = 6 - now.hour - (3600 - 60*now.minute - now.second)
|
timeUntilMorning = 6 - now.hour - (3600 - 60*now.minute - now.second)
|
||||||
time.sleep(timeUntilMorning)
|
time.sleep(timeUntilMorning)
|
||||||
|
|
||||||
printClock()
|
printClock()
|
||||||
|
|
||||||
#if getDirectmessengerState() == False :
|
#if getDirectmessengerState() == False :
|
||||||
# initializeDirectmessenger()
|
# initializeDirectmessenger()
|
||||||
|
|
||||||
timeUntilNextMinute = 60 - datetime.now().second
|
timeUntilNextMinute = 60 - datetime.now().second
|
||||||
time.sleep(timeUntilNextMinute)
|
time.sleep(timeUntilNextMinute)
|
||||||
except KeyboardInterrupt:
|
|
||||||
print("Matrixclock shuts down, because of ^C")
|
|
||||||
exitClock()
|
|
||||||
exit()
|
|
||||||
except BaseException:
|
|
||||||
exitClock()
|
|
||||||
exit()
|
|
||||||
|
|
Loading…
Reference in a new issue