def testGetVersion(self): version = Voikko.getVersion() # We can't test for correct version but let's assume it starts with a number self.failUnless(re.compile(u"[0-9].*").match(version) is not None)
logging.getLogger().setLevel(logging.DEBUG) def messageBox(messageText): ctx = uno.getComponentContext() sManager = ctx.ServiceManager toolkit = sManager.createInstance("com.sun.star.awt.Toolkit") msgbox = toolkit.createMessageBox(None, ERRORBOX, BUTTONS_OK, "Error initializing Voikko", messageText) return msgbox.execute() if not PropertyManager.loadingFailed: try: # Force initialization of property manager so that it is done before anything else. PropertyManager.getInstance() # We could check for specific version but this at least ensures that libvoikko is installed # (this would throw an exception if it's not). Voikko.getVersion() # name of g_ImplementationHelper is significant, Python component loader expects to find it g_ImplementationHelper = unohelper.ImplementationHelper() g_ImplementationHelper.addImplementation(SettingsEventHandler, \ SettingsEventHandler.IMPLEMENTATION_NAME, SettingsEventHandler.SUPPORTED_SERVICE_NAMES,) g_ImplementationHelper.addImplementation(SpellChecker, \ SpellChecker.IMPLEMENTATION_NAME, SpellChecker.SUPPORTED_SERVICE_NAMES,) g_ImplementationHelper.addImplementation(Hyphenator, \ Hyphenator.IMPLEMENTATION_NAME, Hyphenator.SUPPORTED_SERVICE_NAMES,) g_ImplementationHelper.addImplementation(GrammarChecker, \ GrammarChecker.IMPLEMENTATION_NAME, GrammarChecker.SUPPORTED_SERVICE_NAMES,) except OSError as e: