X-Git-Url: http://git.treefish.org/~alex/mtxbot.git/blobdiff_plain/d9f14eda67869d8dec02066325fa47995bf4aa0d..a6f58518069909db7b170ad374b13328986b98da:/src/mtxbot.py diff --git a/src/mtxbot.py b/src/mtxbot.py index 0372ffe..d92dcdc 100755 --- a/src/mtxbot.py +++ b/src/mtxbot.py @@ -16,10 +16,10 @@ assert sys.version_info >= (3, 5) 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() @@ -52,7 +52,7 @@ logging.basicConfig(format='[%(asctime)s] %(levelname)s: %(message)s', mainPid = os.getpid() signal.signal(signal.SIGINT, handleInterrupt) -stopped = False +stop = False if len(sys.argv) != 2: print("Usage: %s " % sys.argv[0]) @@ -61,7 +61,7 @@ if len(sys.argv) != 2: 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) @@ -72,7 +72,7 @@ while not stopped: 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)