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 test_i18n_unicode(self): """ Testing gettext function so it will generate only unicode strings both in python 2 and 3. """ i18n.setup() # If something happened to i18n, it should raise a traceback in the next call translated_str = _("This is a string with no special characters.") self.assertIsInstance(translated_str, strtype) # Test something with a special character here. localized_fake_str = _("Привет всем") self.assertIsInstance(localized_fake_str, strtype)
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"])
("", ["app-configuration.defaults", "libvlccore.dll", "libvlc.dll", "cacerts.txt"]), ("", [certs.where()]), ("plugins", glob("plugins/*/*.dll")), ]+get_locales() def get_locales(): answer = [] for root, dirs, files in os.walk('locales'): new = (root, glob(os.path.join(root, '*.mo'))) answer.append(new) return answer if __name__ == '__main__': import i18n i18n.setup() import application setup( name = application.name, author = application.author, author_email = application.authorEmail, version = application.version, url = application.url, packages= find_packages(), data_files = get_data(), options = { 'py2exe': { 'optimize':2, 'packages': ["pubsub", "pubsub.core", "pubsub.core.kwargs"], 'dll_excludes': ["MPR.dll", "api-ms-win-core-apiquery-l1-1-0.dll", "api-ms-win-core-console-l1-1-0.dll", "api-ms-win-core-delayload-l1-1-1.dll", "api-ms-win-core-errorhandling-l1-1-1.dll", "api-ms-win-core-file-l1-2-0.dll", "api-ms-win-core-handle-l1-1-0.dll", "api-ms-win-core-heap-obsolete-l1-1-0.dll", "api-ms-win-core-libraryloader-l1-1-1.dll", "api-ms-win-core-localization-l1-2-0.dll", "api-ms-win-core-processenvironment-l1-2-0.dll", "api-ms-win-core-processthreads-l1-1-1.dll", "api-ms-win-core-profile-l1-1-0.dll", "api-ms-win-core-registry-l1-1-0.dll", "api-ms-win-core-synch-l1-2-0.dll", "api-ms-win-core-sysinfo-l1-2-0.dll", "api-ms-win-security-base-l1-2-0.dll", "api-ms-win-core-heap-l1-2-0.dll", "api-ms-win-core-interlocked-l1-2-0.dll", "api-ms-win-core-localization-obsolete-l1-1-0.dll", "api-ms-win-core-string-l1-1-0.dll", "api-ms-win-core-string-obsolete-l1-1-0.dll", "WLDAP32.dll", "MSVCP90.dll", "CRYPT32.dll"], # 'skip_archive': False
# -*- coding: utf-8 -*- import sys import platform import os import i18n from cx_Freeze import setup, Executable from babel.messages import frontend as babel i18n.setup() import application def find_sound_lib_datafiles(): import os import platform import sound_lib path = os.path.join(sound_lib.__path__[0], 'lib') if platform.architecture()[0] == '32bit' or platform.system() == 'Darwin': arch = 'x86' else: arch = 'x64' dest_dir = os.path.join('sound_lib', 'lib', arch) source = os.path.join(path, arch) return (source, dest_dir) def find_accessible_output2_datafiles(): import accessible_output2 path = os.path.join(accessible_output2.__path__[0], 'lib') dest_dir = os.path.join('accessible_output2', 'lib') return (path, dest_dir)
def setUp(self): """ Configure i18n functions for avoiding a traceback later. """ i18n.setup()