Refactorization
This commit is contained in:
parent
462fbac614
commit
4b9f364120
@ -10,5 +10,4 @@ from syncplay import utils
|
||||
if __name__ == '__main__':
|
||||
args = utils.get_configuration()
|
||||
manager = client.Manager(args.host, args.port, args.name, lambda m: mpc.run_mpc(m))
|
||||
thread.start_new_thread(utils.stdin_thread, (manager,))
|
||||
manager.start()
|
||||
|
||||
@ -8,11 +8,14 @@ from syncplay.players import mpc_using_api
|
||||
|
||||
from syncplay import utils
|
||||
|
||||
if __name__ == '__main__':
|
||||
args = utils.get_configuration()
|
||||
if(args.mpc_path == None):
|
||||
|
||||
def prepare_args(args):
|
||||
if (args.mpc_path == None):
|
||||
sys.exit("You must supply mpc-path on first run")
|
||||
args.args.extend(['/open', '/new'])
|
||||
|
||||
if __name__ == '__main__':
|
||||
args = utils.get_configuration()
|
||||
prepare_args(args)
|
||||
manager = client.Manager(args.host, args.port, args.name, lambda m: mpc_using_api.run_mpc(m, args.mpc_path, args.file, args.args))
|
||||
thread.start_new_thread(utils.stdin_thread, (manager,))
|
||||
manager.start()
|
||||
|
||||
@ -13,6 +13,5 @@ if __name__ == '__main__':
|
||||
args.args.extend(('-slave', '-msglevel', 'all=1:global=4'))
|
||||
if(args.file): args.args.extend((args.file,))
|
||||
manager = client.Manager(args.host, args.port, args.name, lambda m: mplayer.run_mplayer(m, 'mplayer', args.args))
|
||||
thread.start_new_thread(utils.stdin_thread, (manager,))
|
||||
manager.start()
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user