From faee37e1013bf91a559bf66261b898aff73cb8fe Mon Sep 17 00:00:00 2001 From: steffen123 Date: Tue, 3 Aug 2010 22:25:49 +0200 Subject: [PATCH 1/4] set isKO to false when we know it's not a KO --- pyfpdb/PokerStarsToFpdb.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pyfpdb/PokerStarsToFpdb.py b/pyfpdb/PokerStarsToFpdb.py index 384f5082..86334bd5 100644 --- a/pyfpdb/PokerStarsToFpdb.py +++ b/pyfpdb/PokerStarsToFpdb.py @@ -262,6 +262,8 @@ class PokerStars(HandHistoryConverter): info['BOUNTY'] = info['BOUNTY'].strip(u'$€') # Strip here where it isn't 'None' hand.koBounty = int(100*Decimal(info['BOUNTY'])) hand.isKO = True + else: + hand.isKO = False info['BIRAKE'] = info['BIRAKE'].strip(u'$€') From 7f8243f19d58222d537433d66204069993cd434f Mon Sep 17 00:00:00 2001 From: steffen123 Date: Tue, 3 Aug 2010 22:32:31 +0200 Subject: [PATCH 2/4] remove some default values - if we don't know, don't just assume no/normal --- pyfpdb/Hand.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pyfpdb/Hand.py b/pyfpdb/Hand.py index e4965dab..ee6d0bf2 100644 --- a/pyfpdb/Hand.py +++ b/pyfpdb/Hand.py @@ -79,13 +79,13 @@ class Hand(object): self.fee = None # the Database code is looking for this one .. ? self.level = None self.mixed = None - self.speed = "Normal" - self.isRebuy = False - self.isAddOn = False - self.isKO = False + self.speed = None + self.isRebuy = None + self.isAddOn = None + self.isKO = None self.koBounty = None - self.isMatrix = False - self.isShootout = False + self.isMatrix = None + self.isShootout = None self.added = None self.addedCurrency = None self.tourneyComment = None From 2f9ded514175642da072000adddeb1788f0d5be5 Mon Sep 17 00:00:00 2001 From: steffen123 Date: Wed, 4 Aug 2010 17:39:45 +0200 Subject: [PATCH 3/4] fix pgsql index rebuilding --- pyfpdb/Database.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pyfpdb/Database.py b/pyfpdb/Database.py index ec3d9a4e..cf62dcad 100644 --- a/pyfpdb/Database.py +++ b/pyfpdb/Database.py @@ -1371,6 +1371,7 @@ class Database: # hmmm, tested by commenting out rollback in grapher. lock seems to work but # then drop still hangs :-( does work in some tests though?? # will leave code here for now pending further tests/enhancement ... + c.execute("BEGIN TRANSACTION") c.execute( "lock table %s in exclusive mode nowait" % (fk['fktab'],) ) #print "after lock, status:", c.statusmessage #print "alter table %s drop constraint %s_%s_fkey" % (fk['fktab'], fk['fktab'], fk['fkcol']) @@ -1381,6 +1382,7 @@ class Database: if "does not exist" not in str(sys.exc_value): print "warning: drop pg fk %s_%s_fkey failed: %s, continuing ..." \ % (fk['fktab'], fk['fkcol'], str(sys.exc_value).rstrip('\n') ) + c.execute("END TRANSACTION") except: print "warning: constraint %s_%s_fkey not dropped: %s, continuing ..." \ % (fk['fktab'],fk['fkcol'], str(sys.exc_value).rstrip('\n')) From 9f52867bf65261f0d760512418a9f8f25895826a Mon Sep 17 00:00:00 2001 From: steffen123 Date: Wed, 4 Aug 2010 23:41:50 +0200 Subject: [PATCH 4/4] add HP.wentAllInOnStreet field. explanation on wiki. --- pyfpdb/Database.py | 2 +- pyfpdb/SQL.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/pyfpdb/Database.py b/pyfpdb/Database.py index cf62dcad..7672d33c 100644 --- a/pyfpdb/Database.py +++ b/pyfpdb/Database.py @@ -74,7 +74,7 @@ except ImportError: use_numpy = False -DB_VERSION = 139 +DB_VERSION = 140 # Variance created as sqlite has a bunch of undefined aggregate functions. diff --git a/pyfpdb/SQL.py b/pyfpdb/SQL.py index 73505129..86eb3e95 100644 --- a/pyfpdb/SQL.py +++ b/pyfpdb/SQL.py @@ -543,6 +543,7 @@ class Sql: position CHAR(1), seatNo SMALLINT NOT NULL, sitout BOOLEAN NOT NULL, + wentAllInOnStreet SMALLINT, card1 smallint NOT NULL, /* 0=none, 1-13=2-Ah 14-26=2-Ad 27-39=2-Ac 40-52=2-As */ card2 smallint NOT NULL, @@ -659,6 +660,7 @@ class Sql: position CHAR(1), seatNo SMALLINT NOT NULL, sitout BOOLEAN NOT NULL, + wentAllInOnStreet SMALLINT, card1 smallint NOT NULL, /* 0=none, 1-13=2-Ah 14-26=2-Ad 27-39=2-Ac 40-52=2-As */ card2 smallint NOT NULL, @@ -774,6 +776,7 @@ class Sql: position TEXT, seatNo INT NOT NULL, sitout BOOLEAN NOT NULL, + wentAllInOnStreet INT, card1 INT NOT NULL, /* 0=none, 1-13=2-Ah 14-26=2-Ad 27-39=2-Ac 40-52=2-As */ card2 INT NOT NULL,