From 465900988aafd32e4a3df9cea0397122f6b1b31f Mon Sep 17 00:00:00 2001 From: MaZderMind Date: Thu, 1 Sep 2016 14:27:04 +0200 Subject: Allow setting Voctogui-Host per Commandline, fixes #88 --- voctogui/lib/args.py | 2 ++ voctogui/lib/videodisplay.py | 3 ++- voctogui/voctogui.py | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/voctogui/lib/args.py b/voctogui/lib/args.py index db87fd7..83cd40d 100644 --- a/voctogui/lib/args.py +++ b/voctogui/lib/args.py @@ -18,5 +18,7 @@ parser.add_argument('-i', '--ini-file', action='store', parser.add_argument('-u', '--ui-file', action='store', help="Load a custom .ui-File") +parser.add_argument('-H', '--host', action='store', + help="Connect to this host instead of the configured one.") Args = parser.parse_args() diff --git a/voctogui/lib/videodisplay.py b/voctogui/lib/videodisplay.py index c5a639b..744e1aa 100644 --- a/voctogui/lib/videodisplay.py +++ b/voctogui/lib/videodisplay.py @@ -1,6 +1,7 @@ import logging from gi.repository import Gst +from lib.args import Args from lib.config import Config from lib.clock import Clock @@ -105,7 +106,7 @@ class VideoDisplay(object): acaps=Config.get('mix', 'audiocaps'), vcaps=Config.get('mix', 'videocaps'), previewcaps=Config.get('previews', 'videocaps'), - host=Config.get('server', 'host'), + host=Args.host if Args.host else Config.get('server', 'host'), port=port, ) diff --git a/voctogui/voctogui.py b/voctogui/voctogui.py index 6611480..9ae3af5 100755 --- a/voctogui/voctogui.py +++ b/voctogui/voctogui.py @@ -109,7 +109,7 @@ def main(): # establish a synchronus connection to server Connection.establish( - Config.get('server', 'host')) + Args.host if Args.host else Config.get('server', 'host')) # fetch config from server Config.fetchServerConfig() -- cgit v1.2.3