From 7ed7a2b88cff7a041cef97996f82ed267ee77ef9 Mon Sep 17 00:00:00 2001 From: steffen123 Date: Mon, 22 Sep 2008 03:31:33 +0100 Subject: [PATCH] p91 - patch to HUD table detection from carl --- docs/known-bugs-and-planned-features.txt | 3 ++- pyfpdb/GuiGraphViewer.py | 23 ++++------------------- pyfpdb/Tables.py | 2 +- 3 files changed, 7 insertions(+), 21 deletions(-) diff --git a/docs/known-bugs-and-planned-features.txt b/docs/known-bugs-and-planned-features.txt index f7bd5e19..c6959172 100644 --- a/docs/known-bugs-and-planned-features.txt +++ b/docs/known-bugs-and-planned-features.txt @@ -3,8 +3,9 @@ Please also see db-todo.txt alpha4 (release 25Sep-2Oct) ====== -graph: update dependencies.txt, select site from drop down, doesnt remove old graph on refresh +graph: update dependencies.txt, doesnt remove old graph on refresh print a "press any key" thing after we print the traceback. That way it is easy for them to see the error message. +pgsql recreate doesnt work, and it may not store version field on creation if using sql file with pgadmin. reading small blind wrong for PS 25/50ct check we're reading mucked cards from PS newsletter&mailing list diff --git a/pyfpdb/GuiGraphViewer.py b/pyfpdb/GuiGraphViewer.py index ccb8638f..f81d231d 100644 --- a/pyfpdb/GuiGraphViewer.py +++ b/pyfpdb/GuiGraphViewer.py @@ -50,12 +50,9 @@ class GuiGraphViewer (threading.Thread): else: print "invalid text in site selection in graph, defaulting to PS" site=1 - #print "site:", site self.fig = Figure(figsize=(5,4), dpi=100) self.ax = self.fig.add_subplot(111) -# x = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] -# y = [2.7, 2.8, 31.4, 38.1, 58.0, 76.2, 100.5, 130.0, 149.3, 180.0] self.cursor.execute("""SELECT handId, winnings FROM HandsPlayers INNER JOIN Players ON HandsPlayers.playerId = Players.id @@ -63,14 +60,7 @@ class GuiGraphViewer (threading.Thread): WHERE Players.name = %s AND Players.siteId = %s ORDER BY siteHandNo""", (name, site)) winnings = self.db.cursor.fetchall() - - - - - #print "winnings:",winnings - #print "" - #print "spent:",spent - + profit=range(len(winnings)) for i in profit: self.cursor.execute("""SELECT SUM(amount) FROM HandsActions @@ -78,11 +68,8 @@ class GuiGraphViewer (threading.Thread): 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)) spent = self.db.cursor.fetchone() - profit[i]=(i, winnings[i][1]-spent[0]) - -# x=map(lambda x:float(x[0]), results) y=map(lambda x:float(x[1]), profit) line = range(len(y)) @@ -94,13 +81,12 @@ class GuiGraphViewer (threading.Thread): self.canvas = FigureCanvas(self.fig) # a gtk.DrawingArea self.mainVBox.pack_start(self.canvas) self.canvas.show() + #end of def showClicked - - def __init__(self, db, settings, debug=True): - """Constructor for table_viewer""" + """Constructor for GraphViewer""" self.debug=debug - #print "start of table_viewer constructor" + #print "start of GraphViewer constructor" self.db=db self.cursor=db.cursor self.settings=settings @@ -136,5 +122,4 @@ class GuiGraphViewer (threading.Thread): self.showButton.connect("clicked", self.showClicked, "show clicked") self.settingsHBox.pack_start(self.showButton) self.showButton.show() - #end of GuiGraphViewer.__init__ diff --git a/pyfpdb/Tables.py b/pyfpdb/Tables.py index d7d9533d..41db0645 100644 --- a/pyfpdb/Tables.py +++ b/pyfpdb/Tables.py @@ -172,7 +172,7 @@ def pokerstars_decode_table(tw): tw.name = name else: tw.tournament = None - for pattern in [' no all-in', ' fast', ',']: + for pattern in [' no all-in', ' fast', ',', ' 50BB min']: name = re.sub(pattern, '', name) name = re.sub('\s+$', '', name) tw.name = name