def reloadConfiguration(self): Settings.loadFromFile() self.prefix = Settings.value('runner.prefix', '') self.limit = Settings.value('runner.max_results', 5) # If no 'runner' specific settings, use standard Koo defaults self.language = Settings.value('runner.language', Settings.value('client.language')) self.url = Settings.value('runner.url', Settings.value('login.url')) self.database = Settings.value('runner.db', Settings.value('login.db')) Localization.initializeTranslations(self.language) if not Rpc.session.login(self.url, self.database): print('### KooRunner: Could not log in.')
from Koo.Common import CommandLine from Koo.Common import Localization # Note that we need translations in order to parse command line arguments # because we might have to print information to the user. However, koo's # language configuration is stored in the .rc file users might provide in # the command line. # # To solve this problem we load translations twice: one before command line # parsing and another one after, with the definitive language. # # Under windows, loading language twice doesn't work, and the first one loaded # will be the one used so we first load settings from default file and registre, # then load translations based on that file, then parse command line arguments # and eventually load definitive translations (which windows will ignore silently). Settings.loadFromFile() Settings.loadFromRegistry() Localization.initializeTranslations(Settings.value('client.language')) arguments = CommandLine.parseArguments(sys.argv) Localization.initializeTranslations(Settings.value('client.language')) imports = {} from PyQt5.QtCore import * from PyQt5.QtGui import * from Koo.Common import Notifier, Common from Koo.Common import DBus