From 4e8a09ff84c113e6c930cbc41018c80a0e3758ac Mon Sep 17 00:00:00 2001 From: steffen123 Date: Mon, 22 Sep 2008 22:12:03 +0100 Subject: [PATCH] p93 - unbet now stores a negative amount since that's what it is --- docs/tabledesign.html | 2 +- pyfpdb/GuiGraphViewer.py | 4 ++-- pyfpdb/fpdb.py | 2 +- pyfpdb/fpdb_simple.py | 3 +++ 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/docs/tabledesign.html b/docs/tabledesign.html index 5411d230..8d283f64 100644 --- a/docs/tabledesign.html +++ b/docs/tabledesign.html @@ -744,7 +744,7 @@ The program itself is licensed under AGPLv3, see agpl-3.0.txt

action

char(5)

-

Bet stands for bring in, complete, bet, double bet, raise and double raise, since they all - technically - do the same thing. Unbet is used for when an uncalled bet is returned.

+

Bet stands for bring in, complete, bet, double bet, raise and double raise, since they all - technically - do the same thing. Unbet is used for when an uncalled bet is returned, this will have a negative value for amount.

Other valid values: blind call check fold

diff --git a/pyfpdb/GuiGraphViewer.py b/pyfpdb/GuiGraphViewer.py index f81d231d..3d4be24f 100644 --- a/pyfpdb/GuiGraphViewer.py +++ b/pyfpdb/GuiGraphViewer.py @@ -57,7 +57,7 @@ class GuiGraphViewer (threading.Thread): self.cursor.execute("""SELECT handId, winnings FROM HandsPlayers INNER JOIN Players ON HandsPlayers.playerId = Players.id INNER JOIN Hands ON Hands.id = HandsPlayers.handId - WHERE Players.name = %s AND Players.siteId = %s + WHERE Players.name = %s AND Players.siteId = %s AND tourneysPlayersId is NULL ORDER BY siteHandNo""", (name, site)) winnings = self.db.cursor.fetchall() @@ -66,7 +66,7 @@ class GuiGraphViewer (threading.Thread): self.cursor.execute("""SELECT SUM(amount) FROM HandsActions INNER JOIN HandsPlayers ON HandsActions.handPlayerId = HandsPlayers.id INNER JOIN Players ON HandsPlayers.playerId = Players.id - WHERE Players.name = %s AND HandsPlayers.handId = %s AND Players.siteId = %s""", (name, winnings[i][0], site)) + WHERE Players.name = %s AND HandsPlayers.handId = %s AND Players.siteId = %s AND tourneysPlayersId is NULL""", (name, winnings[i][0], site)) spent = self.db.cursor.fetchone() profit[i]=(i, winnings[i][1]-spent[0]) diff --git a/pyfpdb/fpdb.py b/pyfpdb/fpdb.py index dce926fa..fafa019d 100755 --- a/pyfpdb/fpdb.py +++ b/pyfpdb/fpdb.py @@ -417,7 +417,7 @@ This program is licensed under the AGPL3, see docs"""+os.sep+"agpl-3.0.txt") self.window = gtk.Window(gtk.WINDOW_TOPLEVEL) self.window.connect("delete_event", self.delete_event) self.window.connect("destroy", self.destroy) - self.window.set_title("Free Poker DB - version: alpha4+, p89 or higher") + self.window.set_title("Free Poker DB - version: alpha4+, p93 or higher") self.window.set_border_width(1) self.window.set_size_request(1020,400) self.window.set_resizable(True) diff --git a/pyfpdb/fpdb_simple.py b/pyfpdb/fpdb_simple.py index 80a75f64..f8fa6524 100644 --- a/pyfpdb/fpdb_simple.py +++ b/pyfpdb/fpdb_simple.py @@ -581,6 +581,9 @@ def parseActionAmount(line, atype, site): #print "pos:",pos #print "pos of 20:", line.find("20") amount=int(line[pos:]) + + if atype=="unbet": + amount*=-1 return amount #end def parseActionAmount