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
This commit is contained in:
eblade 2008-11-27 05:12:07 -05:00
parent 6e116f4b02
commit 274cecdc58
3 changed files with 11 additions and 4 deletions

View File

@ -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

View File

@ -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"

View File

@ -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