diff options
author | Louis Vézina <[email protected]> | 2018-10-14 09:32:16 -0400 |
---|---|---|
committer | Louis Vézina <[email protected]> | 2018-10-14 09:32:16 -0400 |
commit | 9c28c30ec8d3c95f7746d46ac8aeb664b3fdfbb3 (patch) | |
tree | 7f29157b149e44d17a527fdcdda77b8d703826b3 /bazarr.py | |
parent | bf02d0775962b2379607692a8a54e938e86a21eb (diff) | |
download | bazarr-9c28c30ec8d3c95f7746d46ac8aeb664b3fdfbb3.tar.gz bazarr-9c28c30ec8d3c95f7746d46ac8aeb664b3fdfbb3.zip |
Add link to restart and manage KeyboardInterrupt
Diffstat (limited to 'bazarr.py')
-rw-r--r-- | bazarr.py | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -29,10 +29,13 @@ dir_name = os.path.dirname(__file__) def start_bazarr(): script = [sys.executable, os.path.normcase(os.path.join(globals()['dir_name'], 'bazarr/main.py'))] + globals()['arguments'] - ep = sp.Popen(script, stdout=sp.PIPE, stderr=sp.STDOUT) + ep = sp.Popen(script, stdout=sp.PIPE, stderr=sp.STDOUT, stdin=sp.PIPE) logging.info("Bazarr starting...") - for line in iter(ep.stdout.readline, ''): - sys.stdout.write(line) + try: + for line in iter(ep.stdout.readline, ''): + sys.stdout.write(line) + except KeyboardInterrupt: + pass if __name__ == '__main__': |