diff options
author | panni <[email protected]> | 2018-10-31 20:34:40 +0100 |
---|---|---|
committer | panni <[email protected]> | 2018-10-31 20:34:40 +0100 |
commit | f692930e267ccf7d948556f2ae34eaf53adefcd8 (patch) | |
tree | c28b64b3f6baa2fbcb07cc449036048d840dc211 /bazarr.py | |
parent | 1d1029fa2a7ff4cf72fa4f419c092e37a7ae01b1 (diff) | |
download | bazarr-f692930e267ccf7d948556f2ae34eaf53adefcd8.tar.gz bazarr-f692930e267ccf7d948556f2ae34eaf53adefcd8.zip |
rewrite get_argv to get_args; use in daemon and bazarr; fix os.path.join usage; PEPify most
Diffstat (limited to 'bazarr.py')
-rw-r--r-- | bazarr.py | 13 |
1 files changed, 8 insertions, 5 deletions
@@ -1,16 +1,19 @@ +# coding=utf-8 + import subprocess as sp import threading import time import os import sys -from bazarr.get_argv import config_dir, arguments +from bazarr import libs +from bazarr.get_args import args dir_name = os.path.dirname(__file__) def start_bazarr(): - script = [sys.executable, "-u", os.path.normcase(os.path.join(globals()['dir_name'], 'bazarr/main.py'))] + arguments + script = [sys.executable, "-u", os.path.normcase(os.path.join(dir_name, 'bazarr', 'main.py'))] + sys.argv[1:] ep = sp.Popen(script, stdout=sp.PIPE, stderr=sp.STDOUT, stdin=sp.PIPE) print "Bazarr starting..." @@ -22,8 +25,8 @@ def start_bazarr(): if __name__ == '__main__': - restartfile = os.path.normcase(os.path.join(config_dir, 'bazarr.restart')) - stopfile = os.path.normcase(os.path.join(config_dir, 'bazarr.stop')) + restartfile = os.path.normcase(os.path.join(args.config_dir, 'bazarr.restart')) + stopfile = os.path.normcase(os.path.join(args.config_dir, 'bazarr.stop')) try: os.remove(restartfile) @@ -62,4 +65,4 @@ if __name__ == '__main__': # Keep the script running forever. while True: - time.sleep(0.001)
\ No newline at end of file + time.sleep(0.001) |