diff --git a/pyfpdb/Database.py b/pyfpdb/Database.py index c5cd156a..9d1f3f85 100644 --- a/pyfpdb/Database.py +++ b/pyfpdb/Database.py @@ -1867,8 +1867,10 @@ class Database: ,(name, site_id)) #Get last id might be faster here. #c.execute ("SELECT id FROM Players WHERE name=%s", (name,)) - tmp = [self.get_last_insert_id(c)] - return tmp[0] + result = self.get_last_insert_id(c) + else: + result = tmp[1] + return result def insertGameTypes(self, row): c = self.get_cursor() diff --git a/pyfpdb/DerivedStats.py b/pyfpdb/DerivedStats.py index 1064a600..1a34db1e 100644 --- a/pyfpdb/DerivedStats.py +++ b/pyfpdb/DerivedStats.py @@ -17,6 +17,7 @@ #fpdb modules import Card +from decimal import Decimal DEBUG = False @@ -43,9 +44,9 @@ class DerivedStats(): self.handsplayers[player[1]]['totalProfit'] = 0 self.handsplayers[player[1]]['street4Seen'] = False self.handsplayers[player[1]]['street4Aggr'] = False - self.handsplayers[player[1]]['wonWhenSeenStreet1'] = False + self.handsplayers[player[1]]['wonWhenSeenStreet1'] = 0.0 self.handsplayers[player[1]]['sawShowdown'] = False - self.handsplayers[player[1]]['wonAtSD'] = False + self.handsplayers[player[1]]['wonAtSD'] = 0.0 for i in range(5): self.handsplayers[player[1]]['street%dCalls' % i] = 0 self.handsplayers[player[1]]['street%dBets' % i] = 0 @@ -135,7 +136,7 @@ class DerivedStats(): #hand.players = [[seat, name, chips],[seat, name, chips]] for player in hand.players: self.handsplayers[player[1]]['seatNo'] = player[0] - self.handsplayers[player[1]]['startCash'] = player[2] + self.handsplayers[player[1]]['startCash'] = int(100 * Decimal(player[2])) for i, street in enumerate(hand.actionStreets[2:]): self.seen(self.hand, i+1) @@ -155,9 +156,9 @@ class DerivedStats(): # Should be fine for split-pots, but won't be accurate for multi-way pots self.handsplayers[player]['rake'] = int(100* hand.rake)/len(hand.collectees) if self.handsplayers[player]['street1Seen'] == True: - self.handsplayers[player]['wonWhenSeenStreet1'] = True + self.handsplayers[player]['wonWhenSeenStreet1'] = 1.0 if self.handsplayers[player]['sawShowdown'] == True: - self.handsplayers[player]['wonAtSD'] = True + self.handsplayers[player]['wonAtSD'] = 1.0 for player in hand.pot.committed: self.handsplayers[player]['totalProfit'] = int(self.handsplayers[player]['winnings'] - (100*hand.pot.committed[player])) diff --git a/pyfpdb/HUD_config.xml.example b/pyfpdb/HUD_config.xml.example index b0f26c53..b1ebd761 100644 --- a/pyfpdb/HUD_config.xml.example +++ b/pyfpdb/HUD_config.xml.example @@ -387,6 +387,18 @@ Left-Drag to Move" + + + + + + + + + + + + diff --git a/pyfpdb/SQL.py b/pyfpdb/SQL.py index 73d380c0..c0319dfe 100644 --- a/pyfpdb/SQL.py +++ b/pyfpdb/SQL.py @@ -2789,8 +2789,6 @@ class Sql: ,hp.tourneyTypeId ,date_format(h.handStart, 'd%y%m%d') """ -#>>>>>>> 28ca49d592c8e706ad6ee58dd26655bcc33fc5fb:pyfpdb/SQL.py -#""" elif db_server == 'postgresql': self.query['rebuildHudCache'] = """ INSERT INTO HudCache diff --git a/pyfpdb/fpdb_import.py b/pyfpdb/fpdb_import.py index dd46d7c6..3fc35339 100644 --- a/pyfpdb/fpdb_import.py +++ b/pyfpdb/fpdb_import.py @@ -442,6 +442,7 @@ class Importer: #pipe the Hands.id out to the HUD print "fpdb_import: sending hand to hud", hand.dbid_hands, "pipe =", self.caller.pipe_to_hud self.caller.pipe_to_hud.stdin.write("%s" % (hand.dbid_hands) + os.linesep) + self.database.commit() errors = getattr(hhc, 'numErrors') stored = getattr(hhc, 'numHands')