From 80940fccb2efe8ace80242f8a3c560d20db935b2 Mon Sep 17 00:00:00 2001 From: Sakamoto Shiina <68018796+ShiinaSakamoto@users.noreply.github.com> Date: Fri, 10 Nov 2023 17:52:25 +0900 Subject: [PATCH] =?UTF-8?q?[Update]=20cmd=E3=81=8B=E3=82=89=E3=81=AEexe?= =?UTF-8?q?=E8=B5=B7=E5=8B=95=E6=99=82=E3=81=AA=E3=81=A9=E3=81=AB=E3=80=81?= =?UTF-8?q?=E5=BC=95=E6=95=B0=E3=81=A8=E3=81=97=E3=81=A6osc=20port?= =?UTF-8?q?=E3=81=A8ip=20address=E3=81=AE=E8=A8=AD=E5=AE=9A=E3=81=8C?= =?UTF-8?q?=E3=81=A7=E3=81=8D=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- controller.py | 14 ++++++++++++++ view.py | 4 ++++ 2 files changed, 18 insertions(+) diff --git a/controller.py b/controller.py index d7bdc414..2e254997 100644 --- a/controller.py +++ b/controller.py @@ -6,6 +6,7 @@ from model import model from view import view from utils import get_key_by_value, isUniqueStrings from languages import selectable_languages +import argparse # Common def callbackUpdateSoftware(): @@ -684,11 +685,24 @@ def callbackSetOscPort(value): print("callbackSetOscPort", int(value)) config.OSC_PORT = int(value) +def initSetConfigByExeArguments(): + parser = argparse.ArgumentParser() + parser.add_argument("--ip") + parser.add_argument("--port") + args = parser.parse_args() + if args.ip is not None: + config.OSC_IP_ADDRESS = str(args.ip) + view.setGuiVariable_OscIpAddress(config.OSC_IP_ADDRESS) + if args.port is not None: + config.OSC_PORT = int(args.port) + view.setGuiVariable_OscPort(config.OSC_PORT) + def createMainWindow(): # create GUI view.createGUI() # init config + initSetConfigByExeArguments() initSetLanguageAndCountry() if model.authenticationTranslator(config.CHOICE_TRANSLATOR, config.AUTH_KEYS[config.CHOICE_TRANSLATOR]) is False: diff --git a/view.py b/view.py index de8b66f1..9b673a03 100644 --- a/view.py +++ b/view.py @@ -1096,7 +1096,11 @@ class View(): self.view_variable.VAR_SPEAKER_MAX_PHRASES.set(str(value)) + def setGuiVariable_OscIpAddress(self, value): + self.view_variable.VAR_OSC_IP_ADDRESS.set(str(value)) + def setGuiVariable_OscPort(self, value): + self.view_variable.VAR_OSC_PORT.set(int(value))