summaryrefslogtreecommitdiffhomepage
path: root/bazarr.py
diff options
context:
space:
mode:
authorHalali <[email protected]>2019-06-11 20:45:48 +0200
committerHalali <[email protected]>2019-06-11 20:45:48 +0200
commitdaa6d87e7639bdf79795133680b205ea890ae195 (patch)
tree84919f2a49bba4261788454d9f28ff27d4499c57 /bazarr.py
parent78b819ef50ba00c66d3eb0d2f7fb7cc24b20ce0d (diff)
downloadbazarr-daa6d87e7639bdf79795133680b205ea890ae195.tar.gz
bazarr-daa6d87e7639bdf79795133680b205ea890ae195.zip
Reformat code
Diffstat (limited to 'bazarr.py')
-rw-r--r--bazarr.py17
1 files changed, 9 insertions, 8 deletions
diff --git a/bazarr.py b/bazarr.py
index a6e7740e7..5e559fe03 100644
--- a/bazarr.py
+++ b/bazarr.py
@@ -1,7 +1,6 @@
# coding=utf-8
import subprocess as sp
-import threading
import time
import os
import sys
@@ -14,7 +13,7 @@ dir_name = os.path.dirname(__file__)
def start_bazarr():
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..."
try:
@@ -27,17 +26,18 @@ def start_bazarr():
if __name__ == '__main__':
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)
except:
pass
-
+
try:
os.remove(stopfile)
except:
pass
-
+
+
def daemon():
if os.path.exists(stopfile):
try:
@@ -47,7 +47,7 @@ if __name__ == '__main__':
else:
print 'Bazarr exited.'
os._exit(0)
-
+
if os.path.exists(restartfile):
try:
os.remove(restartfile)
@@ -55,9 +55,10 @@ if __name__ == '__main__':
print 'Unable to delete restart file.'
else:
start_bazarr()
-
+
+
start_bazarr()
-
+
# Keep the script running forever.
while True:
daemon()