summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaZderMind <git@mazdermind.de>2016-09-01 14:27:04 +0200
committerMaZderMind <git@mazdermind.de>2016-09-01 14:30:25 +0200
commit465900988aafd32e4a3df9cea0397122f6b1b31f (patch)
treefcd39b80cd7a6372495aac6537bc0685385ef01d
parent59e7cedd2d7f70869e1db08166166ef34dd8df1c (diff)
Allow setting Voctogui-Host per Commandline, fixes #88
-rw-r--r--voctogui/lib/args.py2
-rw-r--r--voctogui/lib/videodisplay.py3
-rwxr-xr-xvoctogui/voctogui.py2
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()