From b546868e102c1549d4b52c76fc610108ef70e1d8 Mon Sep 17 00:00:00 2001 From: steffen123 Date: Mon, 18 Aug 2008 07:43:05 +0100 Subject: [PATCH] p55 - three bugfixes fixed bug that it filtered sitouts in tourneys fixed bug that it didnt handle if some joined (tourney) out of hand fixed bug that it didnt handle : in player name --- docs/known-bugs-and-planned-features.txt | 4 +--- pyfpdb/fpdb.py | 2 +- pyfpdb/fpdb_import.py | 6 ++++-- pyfpdb/fpdb_simple.py | 19 +++++++++++++------ 4 files changed, 19 insertions(+), 12 deletions(-) diff --git a/docs/known-bugs-and-planned-features.txt b/docs/known-bugs-and-planned-features.txt index e2efbe1d..87123cfa 100644 --- a/docs/known-bugs-and-planned-features.txt +++ b/docs/known-bugs-and-planned-features.txt @@ -53,15 +53,13 @@ implement error file in importer catch index error, type error, file not found error use different colours according to classification. -add stud, razz and tourney back to imp/tv but with less seperate codepathes +add stud, razz back to imp/tv but with less seperate codepathes move prepare-git.sh and create-release.sh to utils offer not storing db password change definition of bet to exclude bring in? in tv, select from hud table using named fields rather than the current * remove remains of mysql/myisam support. tourney bug: sometimes truncuates position on store -> possibly indicates much bigger problem -tourney bug: fails recognisePlayer -tourney bug: fails with tuple error in recogniseplayerid fix GUI's load profile HUD config wizard diff --git a/pyfpdb/fpdb.py b/pyfpdb/fpdb.py index d7fbaef8..e0e2c3f6 100755 --- a/pyfpdb/fpdb.py +++ b/pyfpdb/fpdb.py @@ -370,7 +370,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: alpha1+, p54") + self.window.set_title("Free Poker DB - version: alpha1+, p55") self.window.set_border_width(1) self.window.set_size_request(1020,400) self.window.set_resizable(True) diff --git a/pyfpdb/fpdb_import.py b/pyfpdb/fpdb_import.py index 5d89ac76..b6fcffd7 100755 --- a/pyfpdb/fpdb_import.py +++ b/pyfpdb/fpdb_import.py @@ -93,8 +93,10 @@ def import_file_dict(options): elif (cancelled or damaged): partial+=1 else: #normal processing - fpdb_simple.filterAnteBlindFold(site,hand) - hand=fpdb_simple.filterCrap(site, hand) + isTourney=fpdb_simple.isTourney(hand[0]) + if not isTourney: + fpdb_simple.filterAnteBlindFold(site,hand) + hand=fpdb_simple.filterCrap(site, hand, isTourney) try: if (category=="holdem" or category=="omahahi" or category=="omahahilo" or category=="razz" or category=="studhi" or category=="studhilo"): diff --git a/pyfpdb/fpdb_simple.py b/pyfpdb/fpdb_simple.py index bd329734..ef132da8 100644 --- a/pyfpdb/fpdb_simple.py +++ b/pyfpdb/fpdb_simple.py @@ -305,7 +305,7 @@ def filterAnteBlindFold(site,hand): #end def filterAnteFold #removes useless lines as well as trailing spaces -def filterCrap(site, hand): +def filterCrap(site, hand, isTourney): #remove one trailing space at end of line for i in range (len(hand)): if (hand[i][-1]==' '): @@ -317,6 +317,8 @@ def filterCrap(site, hand): for i in range (len(hand)): if (hand[i].startswith("Board [")): toRemove.append(hand[i]) + elif (hand[i].find(" out of hand ")!=-1): + hand[i]=hand[i][:-56] elif (hand[i]=="*** HOLE CARDS ***"): toRemove.append(hand[i]) elif (hand[i].endswith("has been disconnected")): @@ -374,10 +376,6 @@ def filterCrap(site, hand): toRemove.append(hand[i]) elif (hand[i].endswith("was removed from the table for failing to post")): toRemove.append(hand[i]) - elif (hand[i].endswith("is sitting out")): - toRemove.append(hand[i]) - elif (hand[i].endswith(": sits out")): - toRemove.append(hand[i]) elif (hand[i].find("joins the table at seat ")!=-1): toRemove.append(hand[i]) elif (hand[i].endswith(" sits down")): @@ -401,6 +399,15 @@ def filterCrap(site, hand): toRemove.append(hand[i]) elif (hand[i].find(": ")!=-1 and site=="ftp" and hand[i].find("Seat ")==-1 and hand[i].find(": Table")==-1): #filter ftp chat toRemove.append(hand[i]) + if isTourney: + if (hand[i].endswith(" is sitting out") and (not hand[i].startswith("Seat "))): + toRemove.append(hand[i]) + else: + if (hand[i].endswith(": sits out")): + toRemove.append(hand[i]) + elif (hand[i].endswith(" is sitting out")): + toRemove.append(hand[i]) + for i in range (len(toRemove)): #print "removing in filterCr:",toRemove[i] @@ -733,7 +740,7 @@ def parseCashesAndSeatNos(lines, site): cashes = [] seatNos = [] for i in range (len(lines)): - pos2=lines[i].rfind(":") + pos2=lines[i].find(":") seatNos.append(int(lines[i][5:pos2])) pos1=lines[i].rfind("($")+2