From b38f87184e697f107eb51199260c8eee15e4200f Mon Sep 17 00:00:00 2001 From: Daniel Pollithy Date: Thu, 31 Aug 2017 12:33:22 +0200 Subject: [PATCH] resetup raspy --- drone.py | 1 + drone_poller.py | 28 ++++++++++++---------------- 2 files changed, 13 insertions(+), 16 deletions(-) diff --git a/drone.py b/drone.py index f58e402..2f8370f 100644 --- a/drone.py +++ b/drone.py @@ -7,6 +7,7 @@ def run(): p = Process(target=drone_poller.run) p.start() client.run() + p.join() if __name__ == '__main__': diff --git a/drone_poller.py b/drone_poller.py index 433dccf..4267dc4 100644 --- a/drone_poller.py +++ b/drone_poller.py @@ -59,24 +59,20 @@ def poll_website(): def run(): while True: try: - try: - # send my own data - notify_website() - except: - print('[x] Could not notify the website') - print("Unexpected error:", sys.exc_info()[0]) + # send my own data + notify_website() + except: + print('[x] Could not notify the website') + print("Unexpected error:", sys.exc_info()[0]) - try: - # receive new bookings - poll_website() - except : - print('[x] Could not fetch bookings from the website') - print("Unexpected error:", sys.exc_info()[0]) + try: + # receive new bookings + poll_website() + except : + print('[x] Could not fetch bookings from the website') + print("Unexpected error:", sys.exc_info()[0]) - time.sleep(settings.WEBSITE_POLLING_SLEEP) - except KeyboardInterrupt: - print('Program execution stopped by user') - exit() + time.sleep(settings.WEBSITE_POLLING_SLEEP) if __name__ == '__main__':