diff --git a/pyfpdb/Configuration.py b/pyfpdb/Configuration.py index 5186c2df..409c289f 100644 --- a/pyfpdb/Configuration.py +++ b/pyfpdb/Configuration.py @@ -637,14 +637,14 @@ class RawHands: if save in ("none", "error", "all"): self.save=save else: - print _("Invalid config value for raw_hands.save, defaulting to \"error\"") + print (_("Invalid config value for %s, defaulting to %s") % (raw_hands.save, "\"error\"")) self.save="error" compression=node.getAttribute("compression") if save in ("none", "gzip", "bzip2"): self.compression=compression else: - print _("Invalid config value for raw_hands.compression, defaulting to \"none\"") + print (_("Invalid config value for %s, defaulting to %s") % (raw_hands.compression, "\"none\"")) self.compression="none" #end def __init__ @@ -663,14 +663,14 @@ class RawTourneys: if save in ("none", "error", "all"): self.save=save else: - print _("Invalid config value for raw_tourneys.save, defaulting to \"error\"") + print (_("Invalid config value for %s, defaulting to %s") % (raw_tourneys.save, "\"error\"")) self.save="error" compression=node.getAttribute("compression") if save in ("none", "gzip", "bzip2"): self.compression=compression else: - print _("Invalid config value for raw_tourneys.compression, defaulting to \"none\"") + print (_("Invalid config value for %s, defaulting to %s") % (raw_tourneys.compression, "\"none\"")) self.compression="none" #end def __init__ @@ -688,8 +688,8 @@ class Config: if file is not None: # config file path passed in file = os.path.expanduser(file) if not os.path.exists(file): - print _("Configuration file %s not found. Using defaults.") % (file) - sys.stderr.write(_("Configuration file %s not found. Using defaults.") % (file)) + print _("Configuration file %s not found. Using defaults.") % (file) + sys.stderr.write(_("Configuration file %s not found. Using defaults.") % (file)) file = None self.example_copy,example_file = True,None @@ -726,7 +726,7 @@ class Config: self.doc = doc self.file_error = None except: - log.error(_("Error parsing %s. See error log file.") % (file)) + log.error((_("Error parsing %s.") % (file)) + _("See error log file.")) traceback.print_exc(file=sys.stderr) self.file_error = sys.exc_info()[1] # we could add a parameter to decide whether to return or read a line and exit? @@ -842,7 +842,7 @@ class Config: try: example_doc = xml.dom.minidom.parse(example_file) except: - log.error(_("Error parsing example configuration file %s. See error log file.") % (example_file)) + log.error((_("Error parsing example configuration file %s.") % (example_file)) + _("See error log file.")) return nodes_added for cnode in doc.getElementsByTagName("FreePokerToolsConfig"): diff --git a/pyfpdb/Database.py b/pyfpdb/Database.py index 4131d4ff..41b970a4 100644 --- a/pyfpdb/Database.py +++ b/pyfpdb/Database.py @@ -467,7 +467,7 @@ class Database: os.mkdir(self.config.dir_database) database = os.path.join(self.config.dir_database, database) self.db_path = database - log.info(_("Connecting to SQLite: %(database)s") % {'database':self.db_path}) + log.info(_("Connecting to SQLite: %s") % self.db_path) if os.path.exists(database) or create: self.connection = sqlite3.connect(self.db_path, detect_types=sqlite3.PARSE_DECLTYPES ) self.__connected = True @@ -510,19 +510,18 @@ class Database: self.cursor.execute("SELECT * FROM Settings") settings = self.cursor.fetchone() if settings[0] != DB_VERSION: - log.error(_("outdated or too new database version (%s) - please recreate tables") - % (settings[0])) + log.error((_("Outdated or too new database version (%s).") % (settings[0])) + " " + _("Please recreate tables.")) self.wrongDbVersion = True except:# _mysql_exceptions.ProgrammingError: if database != ":memory:": if create: - print _("Failed to read settings table - recreating tables") - log.info(_("Failed to read settings table - recreating tables")) + print (_("Failed to read settings table.") + " - " + _("Recreating tables.")) + log.info(_("Failed to read settings table.") + " - " + _("Recreating tables.")) self.recreate_tables() self.check_version(database=database, create=False) else: - print _("Failed to read settings table - please recreate tables") - log.info(_("Failed to read settings table - please recreate tables")) + print (_("Failed to read settings table.") + " - " + _("Please recreate tables.")) + log.info(_("Failed to read settings table.") + " - " + _("Please recreate tables.")) self.wrongDbVersion = True else: self.wrongDbVersion = True