summaryrefslogtreecommitdiffhomepage
path: root/bazarr.py
diff options
context:
space:
mode:
authorpanni <[email protected]>2018-10-31 20:34:40 +0100
committerpanni <[email protected]>2018-10-31 20:34:40 +0100
commitf692930e267ccf7d948556f2ae34eaf53adefcd8 (patch)
treec28b64b3f6baa2fbcb07cc449036048d840dc211 /bazarr.py
parent1d1029fa2a7ff4cf72fa4f419c092e37a7ae01b1 (diff)
downloadbazarr-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.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/bazarr.py b/bazarr.py
index 5411e6585..93abf9ddc 100644
--- a/bazarr.py
+++ b/bazarr.py
@@ -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)