def OnSaveSettings(self, e): from goku.core import SETTINGS SETTINGS["center_server"] = self.inputs[0].GetValue() SETTINGS["center_server2"] = self.inputs[1].GetValue() logging.info("config primary_server:%s" % SETTINGS["center_server"]) logging.info("config secondary_server:%s" % SETTINGS["center_server2"]) from goku.models import connect connect(SETTINGS["center_server"], SETTINGS["center_server2"]) self.Close()
def main(): frozen = getattr(sys, 'frozen', '') if not frozen: app_root = os.path.dirname(os.path.dirname(__file__)) elif frozen in ('dll', 'console_exe', 'windows_exe'): app_root = os.path.join(os.path.dirname(sys.executable)) sys.path.insert(0, app_root) from goku.core import SETTINGS from goku.gui import MainFrame from goku.gui.login_frame import LoginFrame from goku.models import connect GoKuApp.MainFrame = MainFrame GoKuApp.LoginFrame = LoginFrame #data = SETTINGS['center_server'] SETTINGS.set("APP_ROOT", app_root, False, True) _init_logging(SETTINGS) _init_i18n(app_root, SETTINGS['lang']) connect(SETTINGS['center_server']) app = GoKuApp(0) app.MainLoop()