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())
|
||||
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)
|
||||
|
|
Loading…
Reference in a new issue