Move main loop into a new function

This lets the simulator drop to the command line rather than looping.

Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
This commit is contained in:
Anna Schumaker 2015-04-22 20:44:08 -04:00
parent d20813b4ff
commit 668260c7b2
1 changed files with 11 additions and 6 deletions

View File

@ -117,9 +117,14 @@ def read_rfid():
RFID_SERIAL.flushInput() # ignore errors, no data
while True:
try:
read_rfid()
except Exception(e):
door_close()
print(e)
def main():
while True:
try:
read_rfid()
except Exception as e:
door_close()
print(e)
if __name__ == "__main__": main()