from presence import Presence
def handleInterrupt(sig, frame):
- global stopped
+ global stop
if os.getpid() == mainPid:
logging.info( "Got stop signal." )
- stopped = True
+ stop = True
for presence in presences:
presence.stop()
mainPid = os.getpid()
signal.signal(signal.SIGINT, handleInterrupt)
-stopped = False
+stop = False
if len(sys.argv) != 2:
print("Usage: %s <config json>" % sys.argv[0])
with open(sys.argv[1]) as configFile:
config = json.load(configFile)
-while not stopped:
+while not stop:
presences = []
for entry in os.listdir(config['paths']['fifodir']):
fullpath = "%s/%s" % (config['paths']['fifodir'], entry)
logging.error("No fifos could be found!")
break
asyncio.run(main())
- if not stopped:
+ if not stop:
logging.warning("Main loop exited!")
logging.info("Restarting after grace period...")
time.sleep(3.0)