summaryrefslogtreecommitdiffhomepage
path: root/bazarr.py
diff options
context:
space:
mode:
authormorpheus65535 <[email protected]>2018-10-10 07:15:06 -0400
committermorpheus65535 <[email protected]>2018-10-10 07:15:06 -0400
commit1cccd810ae6bb750f91dc0fcde7d7aedf91b802a (patch)
treea35c780abaf807db333c295d59e3bea9c8791b18 /bazarr.py
parent56226f941da8266539ce1e1c5957a85f0356ebbd (diff)
downloadbazarr-1cccd810ae6bb750f91dc0fcde7d7aedf91b802a.tar.gz
bazarr-1cccd810ae6bb750f91dc0fcde7d7aedf91b802a.zip
Auto reload after restart
Diffstat (limited to 'bazarr.py')
-rw-r--r--bazarr.py23
1 files changed, 10 insertions, 13 deletions
diff --git a/bazarr.py b/bazarr.py
index 48a822268..abe2f5c53 100644
--- a/bazarr.py
+++ b/bazarr.py
@@ -30,20 +30,17 @@ def start_bazarr():
script = [sys.executable, os.path.normcase(os.path.join(os.path.dirname(__file__), 'bazarr/main.py'))] + globals()['arguments']
pidfile = os.path.normcase(os.path.join(os.path.dirname(__file__), 'bazarr.pid'))
- if os.path.exists(pidfile):
- logging.error("Bazarr already running, please stop it first.")
+ ep = sp.Popen(script, stdout=sp.PIPE, stderr=sp.STDOUT)
+ try:
+ file = open(pidfile,'w')
+ except:
+ logging.error("Error trying to write pid file.")
else:
- ep = sp.Popen(script, stdout=sp.PIPE, stderr=sp.STDOUT)
- try:
- file = open(pidfile,'w')
- except:
- logging.error("Error trying to write pid file.")
- else:
- file.write(str(ep.pid))
- file.close()
- logging.info("Bazarr starting with process id: " + str(ep.pid) + "...")
- for line in iter(ep.stdout.readline, ''):
- sys.stdout.write(line)
+ file.write(str(ep.pid))
+ file.close()
+ logging.info("Bazarr starting with process id: " + str(ep.pid) + "...")
+ for line in iter(ep.stdout.readline, ''):
+ sys.stdout.write(line)
def shutdown_bazarr(restarting):