def setup(): log.debug("Starting " + application.name + " %s" % (application.version, )) config.setup() fixes.setup() log.debug("Using %s %s" % (platform.system(), platform.architecture()[0])) log.debug("Application path is %s" % (paths.app_path(), )) log.debug("config path is %s" % (paths.config_path(), )) sound.setup() output.setup() languageHandler.setLanguage(config.app["app-settings"]["language"]) keys.setup() from controller import mainController from sessionmanager import sessionManager app = widgetUtils.mainLoopObject() if system == "Windows": if config.app["app-settings"]["donation_dialog_displayed"] == False: donation() updater.do_update() sm = sessionManager.sessionManagerController() sm.fill_list() if len(sm.sessions) == 0: sm.show() else: sm.do_ok() if hasattr(sm.view, "destroy"): sm.view.destroy() del sm r = mainController.Controller() r.view.show() r.do_work() r.check_invisible_at_startup() if system == "Windows": call_threaded(r.start) elif system == "Linux": GLib.idle_add(r.start) app.run()
def SetNewConfigValues (self): config.main['languages']['current'] = i18n.lang_from_printable_language(self.languages.language.GetValue()) config.main['speech']['screenreader'] = self.speech.screenReader.GetValue() logging.info("Screen reader set to: %s" % config.main['speech']['screenreader']) config.main['speech']['rate'] = self.speech.SAPIRate.GetValue() logging.info("SAPI speech rate set to: %d" % config.main['speech']['rate']) config.main['speech']['volume'] = self.speech.SAPIVolume.GetValue() logging.info("SAPI volume set to: %d "% config.main['speech']['volume']) try: config.main['speech']['voice'] = self.speech.SAPIVoice.GetValue() logging.info("SAPI voice set to: %s." % config.main['speech']['voice']) except: logging.exception("Error setting new SAPI voice config value.") config.main['recognition']['enabled'] = self.speech.EnableSpeechRecognition.GetValue() config.main['client']['step'] = int(self.navigation.step.GetValue()) or 5 config.main['client']['timeStep'] = int(self.navigation.timeStepHours.GetValue()*60 + self.navigation.timeStepMins.GetValue()) or 60 config.main['client']['undoStackSize']=int(self.navigation.undoStackSize.GetValue()) or 100 config.main['braille']['brailleSpoken'] = self.speech.braille.GetValue() config.main['client']['AutoStart'] = self.misc.AutoStart.GetValue() logging.info("AutoStart set to: %d." % config.main['client']['AutoStart']) config.main['client']['AskForExit'] = self.misc.AskForExit.GetValue() logging.info("AskForExit set to: %d." % config.main['client']['AskForExit']) config.main['shortener']['urlShortener'] = self.misc.shorteners.GetValue() logging.info("urlShortener set to: %s" % config.main['shortener']['urlShortener']) config.main['AudioServices']['sndUpAPIKey'] = self.misc.sndupKey.GetValue() logging.info("SndUp API key set to: %s." % config.main['AudioServices']['sndUpAPIKey']) config.main['UI']['stdKeyHandling'] = self.misc.stdKeyHandling.GetValue() logging.info("stdKeyHandling set to: %d" % config.main['UI']['stdKeyHandling']) config.main['UI']['sendMessagesWithEnterKey'] = self.misc.sendMessagesWithEnterKey.GetValue() logging.info("sendMessagesWithEnterKey set to: %d" % config.main['UI']['sendMessagesWithEnterKey']) config.main.write() i18n.setup() output.setup() if hasattr(sys, 'frozen') and not global_vars.portable: windows.setAutoStart(application.name, config.main['client']['AutoStart'])
def SetNewConfigValues(self): config.main['languages'][ 'current'] = i18n.lang_from_printable_language( self.languages.language.GetValue()) config.main['speech'][ 'screenreader'] = self.speech.screenReader.GetValue() logging.info("Screen reader set to: %s" % config.main['speech']['screenreader']) config.main['speech']['rate'] = self.speech.SAPIRate.GetValue() logging.info("SAPI speech rate set to: %d" % config.main['speech']['rate']) config.main['speech']['volume'] = self.speech.SAPIVolume.GetValue() logging.info("SAPI volume set to: %d " % config.main['speech']['volume']) try: config.main['speech']['voice'] = self.speech.SAPIVoice.GetValue() logging.info("SAPI voice set to: %s." % config.main['speech']['voice']) except: logging.exception("Error setting new SAPI voice config value.") config.main['recognition'][ 'enabled'] = self.speech.EnableSpeechRecognition.GetValue() config.main['client']['step'] = int( self.navigation.step.GetValue()) or 5 config.main['client']['timeStep'] = int( self.navigation.timeStepHours.GetValue() * 60 + self.navigation.timeStepMins.GetValue()) or 60 config.main['client']['undoStackSize'] = int( self.navigation.undoStackSize.GetValue()) or 100 config.main['braille']['brailleSpoken'] = self.speech.braille.GetValue( ) config.main['client']['AutoStart'] = self.misc.AutoStart.GetValue() logging.info("AutoStart set to: %d." % config.main['client']['AutoStart']) config.main['client']['AskForExit'] = self.misc.AskForExit.GetValue() logging.info("AskForExit set to: %d." % config.main['client']['AskForExit']) config.main['shortener'][ 'urlShortener'] = self.misc.shorteners.GetValue() logging.info("urlShortener set to: %s" % config.main['shortener']['urlShortener']) config.main['AudioServices'][ 'sndUpAPIKey'] = self.misc.sndupKey.GetValue() logging.info("SndUp API key set to: %s." % config.main['AudioServices']['sndUpAPIKey']) config.main['UI'][ 'stdKeyHandling'] = self.misc.stdKeyHandling.GetValue() logging.info("stdKeyHandling set to: %d" % config.main['UI']['stdKeyHandling']) config.main['UI'][ 'sendMessagesWithEnterKey'] = self.misc.sendMessagesWithEnterKey.GetValue( ) logging.info("sendMessagesWithEnterKey set to: %d" % config.main['UI']['sendMessagesWithEnterKey']) config.main.write() i18n.setup() output.setup() if hasattr(sys, 'frozen') and not global_vars.portable: windows.setAutoStart(application.name, config.main['client']['AutoStart'])
def ok(self, ev): if self.list.get_count() == 0: wx.MessageDialog(None, _(u"You need to configure an account."), _(u"Account Error"), wx.ICON_ERROR).ShowModal() return current_session = self.sessions[self.list.get_selected()] manager.manager.set_current_session(current_session) config.MAINFILE = "%s/session.conf" % (manager.manager.get_current_session()) config.setup() lang=config.main['general']['language'] languageHandler.setLanguage(lang) sound.setup() output.setup() self.EndModal(wx.ID_OK)
def ok(self, ev): if self.list.get_count() == 0: wx.MessageDialog(None, _(u"You need to configure an account."), _(u"Account Error"), wx.ICON_ERROR).ShowModal() return current_session = self.sessions[self.list.get_selected()] manager.manager.set_current_session(current_session) config.MAINFILE = "%s/session.conf" % ( manager.manager.get_current_session()) config.setup() lang = config.main['general']['language'] languageHandler.setLanguage(lang) sound.setup() output.setup() self.EndModal(wx.ID_OK)
def setup(): log.debug("Starting " + application.name + " %s" % (application.version,)) config.setup() log.debug("Using %s %s" % (platform.system(), platform.architecture()[0])) log.debug("Application path is %s" % (paths.app_path(),)) log.debug("config path is %s" % (paths.config_path(),)) sound.setup() output.setup() languageHandler.setLanguage(config.app["app-settings"]["language"]) message(message=_(u"Loading files and configuration, please wait...")) fixes.setup() keys.setup() from controller import mainController from sessionmanager import sessionManager app = widgetUtils.mainLoopObject() gplwarning() if system == "Windows": if config.app["app-settings"]["donation_dialog_displayed"] == False: donation() if config.app["app-settings"]["check_updates"] == True: updater.do_update() else: message(message=_(u"Set to ignore updates at startup. To change this preference, go to global config")) sm = sessionManager.sessionManagerController() sm.fill_list() if len(sm.sessions) == 0: sm.show() else: sm.do_ok() if hasattr(sm.view, "destroy"): sm.view.destroy() del sm r = mainController.Controller() r.view.show() r.do_work() r.check_invisible_at_startup() if system == "Windows": call_threaded(r.start) elif system == "Linux": GLib.idle_add(r.start) message( message=_(u"Welcome to %s. Main application's window will appears shortly. Happy tweeting!") % application.name ) app.run()
def setup(): log.debug("Starting Socializer %s" % (application.version,)) config.setup() log.debug("Using %s %s" % (platform.system(), platform.architecture()[0])) log.debug("Application path is %s" % (paths.app_path(),)) log.debug("config path is %s" % (paths.config_path(),)) output.setup() languageHandler.setLanguage(config.app["app-settings"]["language"]) log.debug("Language set to %s" % (languageHandler.getLanguage())) keys.setup() from controller import mainController from sessionmanager import sessionManager app = widgetUtils.mainLoopObject() log.debug("Created Application mainloop object") sm = sessionManager.sessionManagerController() del sm r = mainController.Controller() call_threaded(r.login) app.run()
def SetNewConfigValues(self): config.main["languages"]["current"] = i18n.lang_from_printable_language(self.languages.language.GetValue()) config.main["speech"]["screenreader"] = self.speech.screenReader.GetValue() logging.info("Screen reader set to: %s" % config.main["speech"]["screenreader"]) config.main["speech"]["rate"] = self.speech.SAPIRate.GetValue() logging.info("SAPI speech rate set to: %d" % config.main["speech"]["rate"]) config.main["speech"]["volume"] = self.speech.SAPIVolume.GetValue() logging.info("SAPI volume set to: %d " % config.main["speech"]["volume"]) try: config.main["speech"]["voice"] = self.speech.SAPIVoice.GetValue() logging.info("SAPI voice set to: %s." % config.main["speech"]["voice"]) except: logging.exception("Error setting new SAPI voice config value.") config.main["recognition"]["enabled"] = self.speech.EnableSpeechRecognition.GetValue() config.main["client"]["step"] = int(self.navigation.step.GetValue()) or 5 config.main["client"]["timeStep"] = ( int(self.navigation.timeStepHours.GetValue() * 60 + self.navigation.timeStepMins.GetValue()) or 60 ) config.main["client"]["undoStackSize"] = int(self.navigation.undoStackSize.GetValue()) or 100 config.main["braille"]["brailleSpoken"] = self.braille.braille.GetValue() config.main["client"]["AutoStart"] = self.misc.AutoStart.GetValue() logging.info("AutoStart set to: %d." % config.main["client"]["AutoStart"]) config.main["client"]["AskForExit"] = self.misc.AskForExit.GetValue() logging.info("AskForExit set to: %d." % config.main["client"]["AskForExit"]) config.main["shortener"]["urlShortener"] = self.misc.shorteners.GetValue() logging.info("urlShortener set to: %s" % config.main["shortener"]["urlShortener"]) config.main["AudioServices"]["service"] = self.misc.audioServices.GetValue() logging.info("Audio service set to: %s." % config.main["AudioServices"]["service"]) config.main["AudioServices"]["sndUpAPIKey"] = self.misc.sndupKey.GetValue() logging.info("SndUp API key set to: %s." % config.main["AudioServices"]["sndUpAPIKey"]) config.main["UI"]["stdKeyHandling"] = self.misc.stdKeyHandling.GetValue() logging.info("stdKeyHandling set to: %d" % config.main["UI"]["stdKeyHandling"]) config.main["UI"]["sendMessagesWithEnterKey"] = self.misc.sendMessagesWithEnterKey.GetValue() logging.info("sendMessagesWithEnterKey set to: %d" % config.main["UI"]["sendMessagesWithEnterKey"]) config.main.write() i18n.setup() output.setup() # sessions.current_session.interface.ShowGui() if hasattr(sys, "frozen") and not global_vars.portable: windows.setAutoStart(application.name, config.main["client"]["AutoStart"])
os.remove(stdout_temp.name) os.remove(stderr_temp.name) app = wx.App() #app = wx.App(redirect=True, useBestVisual=True, filename=paths.logs_path('tracebacks.log')) configured = False configs = [] for i in os.listdir(paths.config_path()): if os.path.isdir(paths.config_path(i)): configs.append(i) if len(configs) == 1: manager.manager.set_current_session(configs[0]) config.MAINFILE = "%s/session.conf" % (manager.manager.get_current_session()) config.setup() lang=config.main['general']['language'] languageHandler.setLanguage(lang) sound.setup() output.setup() configured = True else: ssmg = smGUI.sessionManagerWindow() if configured == True or ssmg.ShowModal() == wx.ID_OK: frame = gui.main.mainFrame() frame.Show() frame.showing = True if config.main != None and config.main["general"]["hide_gui"] == True and platform.system() == "Windows": frame.show_hide() frame.Hide() app.SetTopWindow(frame) else: app.Exit() ### I should uncomment this #if platform.system() != "Windows":
os.remove(stderr_temp.name) app = wx.App() #app = wx.App(redirect=True, useBestVisual=True, filename=paths.logs_path('tracebacks.log')) configured = False configs = [] for i in os.listdir(paths.config_path()): if os.path.isdir(paths.config_path(i)): configs.append(i) if len(configs) == 1: manager.manager.set_current_session(configs[0]) config.MAINFILE = "%s/session.conf" % ( manager.manager.get_current_session()) config.setup() lang = config.main['general']['language'] languageHandler.setLanguage(lang) sound.setup() output.setup() configured = True else: ssmg = smGUI.sessionManagerWindow() if configured == True or ssmg.ShowModal() == wx.ID_OK: frame = gui.main.mainFrame() frame.Show() frame.showing = True if config.main != None and config.main["general"][ "hide_gui"] == True and platform.system() == "Windows": frame.show_hide() frame.Hide() app.SetTopWindow(frame) else: app.Exit() ### I should uncomment this