[Update] cmdからのexe起動時などに、引数としてosc portとip addressの設定ができるように。
This commit is contained in:
@@ -6,6 +6,7 @@ from model import model
|
|||||||
from view import view
|
from view import view
|
||||||
from utils import get_key_by_value, isUniqueStrings
|
from utils import get_key_by_value, isUniqueStrings
|
||||||
from languages import selectable_languages
|
from languages import selectable_languages
|
||||||
|
import argparse
|
||||||
|
|
||||||
# Common
|
# Common
|
||||||
def callbackUpdateSoftware():
|
def callbackUpdateSoftware():
|
||||||
@@ -684,11 +685,24 @@ def callbackSetOscPort(value):
|
|||||||
print("callbackSetOscPort", int(value))
|
print("callbackSetOscPort", int(value))
|
||||||
config.OSC_PORT = 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():
|
def createMainWindow():
|
||||||
# create GUI
|
# create GUI
|
||||||
view.createGUI()
|
view.createGUI()
|
||||||
|
|
||||||
# init config
|
# init config
|
||||||
|
initSetConfigByExeArguments()
|
||||||
initSetLanguageAndCountry()
|
initSetLanguageAndCountry()
|
||||||
|
|
||||||
if model.authenticationTranslator(config.CHOICE_TRANSLATOR, config.AUTH_KEYS[config.CHOICE_TRANSLATOR]) is False:
|
if model.authenticationTranslator(config.CHOICE_TRANSLATOR, config.AUTH_KEYS[config.CHOICE_TRANSLATOR]) is False:
|
||||||
|
|||||||
4
view.py
4
view.py
@@ -1096,7 +1096,11 @@ class View():
|
|||||||
self.view_variable.VAR_SPEAKER_MAX_PHRASES.set(str(value))
|
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))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user