diff options
author | panni <[email protected]> | 2018-10-31 18:09:46 +0100 |
---|---|---|
committer | panni <[email protected]> | 2018-10-31 18:09:46 +0100 |
commit | 6cc97a17cd2109f8e75039d7417ab5ee5d1b22d3 (patch) | |
tree | 057b1ad0651826a3fc2eb896907a59cc4eae4709 /bazarr.py | |
parent | d8c6570b4962ad5f9d5be1fa57b07d74f1ccc9de (diff) | |
download | bazarr-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.py | 27 |
1 files changed, 3 insertions, 24 deletions
@@ -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..." |