From 274cecdc58fcf4df08a098c1747ef1dc6e9363f1 Mon Sep 17 00:00:00 2001 From: eblade Date: Thu, 27 Nov 2008 05:12:07 -0500 Subject: [PATCH] stat windows no longer call realize() as that is done automatically by gtk when needed importer dumps bad hands to hand-errors.txt after printing the normal email message parse_logic should ignore lines where small blind is found to be "$0", however, it's still causing errors --- pyfpdb/Hud.py | 2 +- pyfpdb/fpdb_import.py | 11 ++++++++--- pyfpdb/fpdb_parse_logic.py | 2 ++ 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/pyfpdb/Hud.py b/pyfpdb/Hud.py index cf9ab622..92a84723 100644 --- a/pyfpdb/Hud.py +++ b/pyfpdb/Hud.py @@ -375,7 +375,7 @@ class Stat_Window: # if not os.name == 'nt': # seems to be a bug in opacity on windows self.window.set_opacity(parent.colors['hudopacity']) - self.window.realize() +# self.window.realize() self.window.move(self.x, self.y) # self.window.show_all() # set_keep_above(1) for windows diff --git a/pyfpdb/fpdb_import.py b/pyfpdb/fpdb_import.py index 8f815a3c..854877ba 100755 --- a/pyfpdb/fpdb_import.py +++ b/pyfpdb/fpdb_import.py @@ -248,14 +248,14 @@ class Importer: duplicates+=1 except (ValueError), fe: errors+=1 - self.printEmailErrorMessage(errors, file, hand[0]) + self.printEmailErrorMessage(errors, file, hand) if (self.settings['failOnError']): self.db.commit() #dont remove this, in case hand processing was cancelled. raise except (fpdb_simple.FpdbError), fe: errors+=1 - self.printEmailErrorMessage(errors, file, hand[0]) + self.printEmailErrorMessage(errors, file, hand) #fe.printStackTrace() #todo: get stacktrace self.db.rollback() @@ -302,7 +302,12 @@ class Importer: print "Filename:", filename print "Here is the first line so you can identify it. Please mention that the error was a ValueError:" print self.hand[0] - + print "Hand logged to hand-errors.txt" + logfile = open('hand-errors.txt', 'a') + for s in self.hand: + logfile.write(str(s) + "\n") + logfile.write("\n") + logfile.close() if __name__ == "__main__": print "CLI for fpdb_import is now available as CliFpdb.py" diff --git a/pyfpdb/fpdb_parse_logic.py b/pyfpdb/fpdb_parse_logic.py index ec9a53f6..370a0fc0 100644 --- a/pyfpdb/fpdb_parse_logic.py +++ b/pyfpdb/fpdb_parse_logic.py @@ -42,6 +42,8 @@ def mainParser(db, cursor, site, category, hand): smallBlindLine=0 for i in range(len(hand)): if hand[i].find("posts small blind")!=-1 or hand[i].find("posts the small blind")!=-1: + if hand[i][-2:] == "$0": + continue smallBlindLine=i #print "found small blind line:",smallBlindLine break