aboutsummaryrefslogtreecommitdiffhomepage
path: root/bazarr.py
diff options
context:
space:
mode:
authorpanni <[email protected]>2018-10-31 18:09:46 +0100
committerpanni <[email protected]>2018-10-31 18:09:46 +0100
commit6cc97a17cd2109f8e75039d7417ab5ee5d1b22d3 (patch)
tree057b1ad0651826a3fc2eb896907a59cc4eae4709 /bazarr.py
parentd8c6570b4962ad5f9d5be1fa57b07d74f1ccc9de (diff)
downloadbazarr-6cc97a17cd2109f8e75039d7417ab5ee5d1b22d3.tar.gz
bazarr-6cc97a17cd2109f8e75039d7417ab5ee5d1b22d3.zip
make bazarr a module; use centralized getopt in daemon; add --debug option for console handler; add logging dependencies
Diffstat (limited to 'bazarr.py')
-rw-r--r--bazarr.py27
1 files changed, 3 insertions, 24 deletions
diff --git a/bazarr.py b/bazarr.py
index 405158a2b..5411e6585 100644
--- a/bazarr.py
+++ b/bazarr.py
@@ -3,35 +3,14 @@ import threading
import time
import os
import sys
-import getopt
-
-config_dir = os.path.join(os.path.dirname(__file__), 'data/')
-no_update = False
-
-arguments = []
-try:
- opts, args = getopt.getopt(sys.argv[1:],"h:",["no-update", "config="])
-except getopt.GetoptError:
- print 'bazarr.py -h --no-update --config <config_directory>'
- sys.exit(2)
-for opt, arg in opts:
- arguments.append(opt)
- if arg != '':
- arguments.append(arg)
-
- if opt == '-h':
- print 'bazarr.py -h --no-update --config <config_directory>'
- sys.exit()
- elif opt in ("--no-update"):
- no_update = True
- elif opt in ("--config"):
- config_dir = arg
+from bazarr.get_argv import config_dir, arguments
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'))] + globals()['arguments']
+ script = [sys.executable, "-u", os.path.normcase(os.path.join(globals()['dir_name'], 'bazarr/main.py'))] + arguments
ep = sp.Popen(script, stdout=sp.PIPE, stderr=sp.STDOUT, stdin=sp.PIPE)
print "Bazarr starting..."