From f94408c8812ce515fc8d15b0ff1b7cbbff9c069d Mon Sep 17 00:00:00 2001 From: Erki Ferenc Date: Wed, 1 Dec 2010 19:54:53 +0100 Subject: [PATCH 1/8] l10n: updated Hungarian translation --- pyfpdb/locale/fpdb-hu_HU.po | 50 ++++++++++++++----------------------- 1 file changed, 19 insertions(+), 31 deletions(-) diff --git a/pyfpdb/locale/fpdb-hu_HU.po b/pyfpdb/locale/fpdb-hu_HU.po index d387bc90..c11587ee 100644 --- a/pyfpdb/locale/fpdb-hu_HU.po +++ b/pyfpdb/locale/fpdb-hu_HU.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.20.905 plus git\n" "POT-Creation-Date: 2010-11-29 21:40+CET\n" -"PO-Revision-Date: 2010-11-10 10:26+0100\n" +"PO-Revision-Date: 2010-12-01 19:54+0100\n" "Last-Translator: Ferenc Erki \n" "Language-Team: Hungarian \n" "Language: hu\n" @@ -40,26 +40,23 @@ msgstr "Nem sikerült felismerni a játéktípust innen: '%s'" #: AbsoluteToFpdb.py:204 msgid "readHandInfo: Didn't match: '%s'" -msgstr "" +msgstr "readHandInfo: Nem illeszkedik: '%s'" #: AbsoluteToFpdb.py:205 -#, fuzzy msgid "Absolute: Didn't match re_HandInfo: '%s'" -msgstr "re_HandInfo nem illeszkedik" +msgstr "Absolute: re_HandInfo nem illeszkedik: '%s'" #: AbsoluteToFpdb.py:207 -#, fuzzy msgid "readHandInfo: File name didn't match re_*InfoFromFilename" -msgstr "A fájlnév nem illeszkedik re_*InfoFromFilename-re" +msgstr "readHandInfo: A fájlnév nem illeszkedik re_*InfoFromFilename-re" #: AbsoluteToFpdb.py:208 msgid "File name: %s" msgstr "Fájlnév: %s" #: AbsoluteToFpdb.py:209 -#, fuzzy msgid "Absolute: Didn't match re_*InfoFromFilename: '%s'" -msgstr "A fájlnév nem illeszkedik re_*InfoFromFilename-re" +msgstr "Absolute: nem illeszkedik re_*InfoFromFilename-re: '%s'" #: AbsoluteToFpdb.py:278 EverleafToFpdb.py:215 FulltiltToFpdb.py:346 #: OnGameToFpdb.py:303 PokerStarsToFpdb.py:352 Win2dayToFpdb.py:203 @@ -1651,41 +1648,37 @@ msgid "Tournament Results" msgstr "Versenyeredmények" #: GuiTourneyImport.py:72 GuiTourneyImport.py:290 -#, fuzzy msgid "" "GuiTourneyImport.load done: Stored: %d\tErrors: %d in %s seconds - %.0f/sec" msgstr "" -"GuiBulkImport.load kész: Tárolt: %d \tDuplikáció: %d \tRészleges: %d " -"\tHibák: %d %s másodperc alatt - %.0f/mp" +"GuiTourneyImport.load kész: Tárolva: %d\tHibák: %d; %s másodperc alatt - " +"%.0f/mp" #: GuiTourneyImport.py:175 fpdb_import.py:223 msgid "Attempted to add non-directory '%s' as an import directory" msgstr "Nem könyvtár ('%s') megadása importálási könyvtárként" #: GuiTourneyImport.py:191 -#, fuzzy msgid "Tourney Summary Import started at %s - %d files to import." -msgstr "Elindítva: %s -- %d fájl importálása. Indexek: %s" +msgstr "Verseny összegzés import elindítva ekkor: %s - %d fájl importálása." #: GuiTourneyImport.py:217 -#, fuzzy msgid "TourneyImport: Removing text < 100 characters from end of file" -msgstr "50 karakternél rövidebb szöveg eltávolítása" +msgstr "" +"TourneyImport: 100 karakternél rövidebb szöveg eltávolítása a fájl végéről" #: GuiTourneyImport.py:221 -#, fuzzy msgid "TourneyImport: Removing text < 100 characters from start of file" -msgstr "50 karakternél rövidebb szöveg eltávolítása" +msgstr "" +"TourneyImport: 100 karakternél rövidebb szöveg eltávolítása a fájl elejéről" #: GuiTourneyImport.py:231 -#, fuzzy msgid "Finished importing %s/%s tournament summaries" -msgstr "%s/%s PS összefoglaló importálása kész" +msgstr "%s/%s verseny összegzés importálása befejezve" #: GuiTourneyImport.py:252 -#, fuzzy msgid "GTI.readFile: '%s'" -msgstr "'%s' követése" +msgstr "GTI.readFile: '%s'" #: GuiTourneyImport.py:271 ImapFetcher.py:176 msgid "Need to define a converter" @@ -1693,7 +1686,7 @@ msgstr "Meg kell adni egy konvertert" #: GuiTourneyImport.py:278 msgid "Need a filename to import" -msgstr "" +msgstr "Importálandó fájlnév megadása szükséges" #: GuiTourneyPlayerStats.py:75 msgid "_Refresh Stats" @@ -3306,14 +3299,12 @@ msgid "B" msgstr "I" #: fpdb.pyw:810 -#, fuzzy msgid "R" -msgstr "L" +msgstr "R" #: fpdb.pyw:810 -#, fuzzy msgid "Tournament _Results Import" -msgstr "Versenyeredmények" +msgstr "Ve_rsenyeredmények importálása" #: fpdb.pyw:811 msgid "I" @@ -3368,9 +3359,8 @@ msgid "T" msgstr "T" #: fpdb.pyw:818 -#, fuzzy msgid "_Tourney Stats (tabulated view, not on pgsql)" -msgstr "Versenyjá_tékos statisztikák (táblázat; Postgre-vel nem)" +msgstr "Versenystatisztikák (táblázat; Postgre-vel nem)" #: fpdb.pyw:819 msgid "Tourney _Viewer" @@ -3539,9 +3529,8 @@ msgid "Bulk Import" msgstr "Importálás" #: fpdb.pyw:1007 -#, fuzzy msgid "Tournament Results Import" -msgstr "Versenyeredmények" +msgstr "Versenyeredmények importálása" #: fpdb.pyw:1013 msgid "eMail Import" @@ -3552,7 +3541,6 @@ msgid "Ring Player Stats" msgstr "Készpénzes statisztikák" #: fpdb.pyw:1026 -#, fuzzy msgid "Tourney Stats" msgstr "Versenystatisztikák" From 2813bb7fe67358634d9107872891db2e6113fedb Mon Sep 17 00:00:00 2001 From: Steffen Schaumburg Date: Sat, 25 Dec 2010 20:38:18 +0100 Subject: [PATCH 2/8] prevent crasher when connecting to empty mysql (presumably this bug also applied to postgres) --- pyfpdb/Database.py | 5 +++-- pyfpdb/fpdb.pyw | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/pyfpdb/Database.py b/pyfpdb/Database.py index b9786b16..7caeaae8 100644 --- a/pyfpdb/Database.py +++ b/pyfpdb/Database.py @@ -244,8 +244,9 @@ class Database: # create index indexname on tablename (col); - def __init__(self, c, sql = None, autoconnect = True): + def __init__(self, c, sql = None, autoconnect = True, create_db=False): #log = Configuration.get_logger("logging.conf", "db", log_dir=c.dir_log) + print "create DB=",create_db log.debug(_("Creating Database instance, sql = %s") % sql) self.config = c self.__connected = False @@ -307,7 +308,7 @@ class Database: self.saveActions = False if self.import_options['saveActions'] == False else True - if self.is_connected(): + if self.is_connected() and not create_db: self.get_sites() self.connection.rollback() # make sure any locks taken so far are released #end def __init__ diff --git a/pyfpdb/fpdb.pyw b/pyfpdb/fpdb.pyw index fe6e1124..ff9e7c45 100755 --- a/pyfpdb/fpdb.pyw +++ b/pyfpdb/fpdb.pyw @@ -880,7 +880,7 @@ class fpdb: self.sql = SQL.Sql(db_server = self.settings['db-server']) err_msg = None try: - self.db = Database.Database(self.config, sql = self.sql) + self.db = Database.Database(self.config, sql = self.sql, create_db=create_db) if self.db.get_backend_name() == 'SQLite': # tell sqlite users where the db file is print (_("Connected to SQLite: %s") % self.db.db_path) From 683d89389b641832bb92af900a57249aa6fee6ea Mon Sep 17 00:00:00 2001 From: Steffen Schaumburg Date: Sat, 25 Dec 2010 20:51:44 +0100 Subject: [PATCH 3/8] Revert "prevent crasher when connecting to empty mysql (presumably this bug also applied to postgres)" This reverts commit 2813bb7fe67358634d9107872891db2e6113fedb. --- pyfpdb/Database.py | 5 ++--- pyfpdb/fpdb.pyw | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/pyfpdb/Database.py b/pyfpdb/Database.py index 7caeaae8..b9786b16 100644 --- a/pyfpdb/Database.py +++ b/pyfpdb/Database.py @@ -244,9 +244,8 @@ class Database: # create index indexname on tablename (col); - def __init__(self, c, sql = None, autoconnect = True, create_db=False): + def __init__(self, c, sql = None, autoconnect = True): #log = Configuration.get_logger("logging.conf", "db", log_dir=c.dir_log) - print "create DB=",create_db log.debug(_("Creating Database instance, sql = %s") % sql) self.config = c self.__connected = False @@ -308,7 +307,7 @@ class Database: self.saveActions = False if self.import_options['saveActions'] == False else True - if self.is_connected() and not create_db: + if self.is_connected(): self.get_sites() self.connection.rollback() # make sure any locks taken so far are released #end def __init__ diff --git a/pyfpdb/fpdb.pyw b/pyfpdb/fpdb.pyw index ff9e7c45..fe6e1124 100755 --- a/pyfpdb/fpdb.pyw +++ b/pyfpdb/fpdb.pyw @@ -880,7 +880,7 @@ class fpdb: self.sql = SQL.Sql(db_server = self.settings['db-server']) err_msg = None try: - self.db = Database.Database(self.config, sql = self.sql, create_db=create_db) + self.db = Database.Database(self.config, sql = self.sql) if self.db.get_backend_name() == 'SQLite': # tell sqlite users where the db file is print (_("Connected to SQLite: %s") % self.db.db_path) From 563efc0335154347ab02ccec931e7cf40e417298 Mon Sep 17 00:00:00 2001 From: Steffen Schaumburg Date: Sat, 25 Dec 2010 20:54:25 +0100 Subject: [PATCH 4/8] better fix for prevention of the crasher --- pyfpdb/Database.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pyfpdb/Database.py b/pyfpdb/Database.py index b9786b16..fec54b92 100644 --- a/pyfpdb/Database.py +++ b/pyfpdb/Database.py @@ -308,7 +308,8 @@ class Database: self.saveActions = False if self.import_options['saveActions'] == False else True if self.is_connected(): - self.get_sites() + if not self.wrongDbVersion: + self.get_sites() self.connection.rollback() # make sure any locks taken so far are released #end def __init__ From eaaa6feb7835dfb430d6aa10a2895cdd3faad81f Mon Sep 17 00:00:00 2001 From: Steffen Schaumburg Date: Sun, 26 Dec 2010 17:55:41 +0100 Subject: [PATCH 5/8] make it repopulate config.sites after recreate --- pyfpdb/Database.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pyfpdb/Database.py b/pyfpdb/Database.py index fec54b92..6b45102a 100644 --- a/pyfpdb/Database.py +++ b/pyfpdb/Database.py @@ -1210,6 +1210,7 @@ class Database: self.create_tables() self.createAllIndexes() self.commit() + self.get_sites() print _("Finished recreating tables") log.info(_("Finished recreating tables")) #end def recreate_tables From b62a811e2342ba61f0bf7c88d6a5fc35c27c2a2a Mon Sep 17 00:00:00 2001 From: Steffen Schaumburg Date: Sun, 26 Dec 2010 19:09:36 +0100 Subject: [PATCH 6/8] add dependency to ebuild --- packaging/gentoo/current_testing.ebuild | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packaging/gentoo/current_testing.ebuild b/packaging/gentoo/current_testing.ebuild index 525200fb..67d55172 100644 --- a/packaging/gentoo/current_testing.ebuild +++ b/packaging/gentoo/current_testing.ebuild @@ -28,7 +28,8 @@ RDEPEND=" graph? ( dev-python/numpy dev-python/matplotlib[gtk] ) dev-python/python-xlib - dev-python/pytz" + dev-python/pytz + x11-apps/xwininfo" DEPEND="${RDEPEND}" src_install() { From dc28c31e02f9a55a8bae57431dbbd916e21c369b Mon Sep 17 00:00:00 2001 From: Steffen Schaumburg Date: Sun, 26 Dec 2010 19:16:38 +0100 Subject: [PATCH 7/8] Revert "Database: Disable alchemy pools" as that breaks the HUD (on PS at least) This reverts commit 797c126318b0658aa936343cb312ae93392f1a17. --- pyfpdb/Database.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/pyfpdb/Database.py b/pyfpdb/Database.py index 6b45102a..8ed0e3bc 100644 --- a/pyfpdb/Database.py +++ b/pyfpdb/Database.py @@ -60,14 +60,11 @@ import Configuration # Other library modules try: import sqlalchemy.pool as pool - #use_pool = True - # Forcing to False so we can use connection.row_factory - use_pool = False + use_pool = True except ImportError: log.info(_("Not using sqlalchemy connection pool.")) use_pool = False - try: from numpy import var use_numpy = True @@ -450,8 +447,7 @@ class Database: self.db_path = database log.info(_("Connecting to SQLite: %(database)s") % {'database':self.db_path}) if os.path.exists(database) or create: - self.connection = sqlite3.connect(self.db_path, detect_types=sqlite3.PARSE_DECLTYPES) - self.connection.row_factory = sqlite3.Row + self.connection = sqlite3.connect(self.db_path, detect_types=sqlite3.PARSE_DECLTYPES ) self.__connected = True sqlite3.register_converter("bool", lambda x: bool(int(x))) sqlite3.register_adapter(bool, lambda x: "1" if x else "0") From 3437f99db7caa73b0f5d2804663a00f866621824 Mon Sep 17 00:00:00 2001 From: gimick Date: Sun, 26 Dec 2010 21:42:16 +0000 Subject: [PATCH 8/8] HUD: First hand in database missing from HUD stats --- pyfpdb/SQL.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pyfpdb/SQL.py b/pyfpdb/SQL.py index 9429b910..6a87b433 100644 --- a/pyfpdb/SQL.py +++ b/pyfpdb/SQL.py @@ -1796,7 +1796,7 @@ class Sql: cast(hp2.street4Raises as integer) AS raise_4 FROM Hands h - INNER JOIN Hands h2 ON (h2.id > %s AND h2.tableName = h.tableName) + INNER JOIN Hands h2 ON (h2.id >= %s AND h2.tableName = h.tableName) INNER JOIN HandsPlayers hp ON (h.id = hp.handId) /* players in this hand */ INNER JOIN HandsPlayers hp2 ON (hp2.playerId+0 = hp.playerId+0 AND (hp2.handId = h2.id+0)) /* other hands by these players */ INNER JOIN Players p ON (p.id = hp2.PlayerId+0) @@ -1899,7 +1899,7 @@ class Sql: cast(hp2.street3Raises as integer) AS raise_3, cast(hp2.street4Raises as integer) AS raise_4 FROM Hands h /* this hand */ - INNER JOIN Hands h2 ON ( h2.id > %s /* other hands */ + INNER JOIN Hands h2 ON ( h2.id >= %s /* other hands */ AND h2.tableName = h.tableName) INNER JOIN HandsPlayers hp ON (h.id = hp.handId) /* players in this hand */ INNER JOIN HandsPlayers hp2 ON ( hp2.playerId+0 = hp.playerId+0 @@ -2004,7 +2004,7 @@ class Sql: cast(hp2.street3Raises as integer) AS raise_3, cast(hp2.street4Raises as integer) AS raise_4 FROM Hands h /* this hand */ - INNER JOIN Hands h2 ON ( h2.id > %s /* other hands */ + INNER JOIN Hands h2 ON ( h2.id >= %s /* other hands */ AND h2.tableName = h.tableName) INNER JOIN HandsPlayers hp ON (h.id = hp.handId) /* players in this hand */ INNER JOIN HandsPlayers hp2 ON ( hp2.playerId+0 = hp.playerId+0