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 # if not os.name == 'nt': # seems to be a bug in opacity on windows
self.window.set_opacity(parent.colors['hudopacity']) self.window.set_opacity(parent.colors['hudopacity'])
self.window.realize() # self.window.realize()
self.window.move(self.x, self.y) self.window.move(self.x, self.y)
# self.window.show_all() # self.window.show_all()
# set_keep_above(1) for windows # set_keep_above(1) for windows

View File

@ -248,14 +248,14 @@ class Importer:
duplicates+=1 duplicates+=1
except (ValueError), fe: except (ValueError), fe:
errors+=1 errors+=1
self.printEmailErrorMessage(errors, file, hand[0]) self.printEmailErrorMessage(errors, file, hand)
if (self.settings['failOnError']): if (self.settings['failOnError']):
self.db.commit() #dont remove this, in case hand processing was cancelled. self.db.commit() #dont remove this, in case hand processing was cancelled.
raise raise
except (fpdb_simple.FpdbError), fe: except (fpdb_simple.FpdbError), fe:
errors+=1 errors+=1
self.printEmailErrorMessage(errors, file, hand[0]) self.printEmailErrorMessage(errors, file, hand)
#fe.printStackTrace() #todo: get stacktrace #fe.printStackTrace() #todo: get stacktrace
self.db.rollback() self.db.rollback()
@ -302,7 +302,12 @@ class Importer:
print "Filename:", filename print "Filename:", filename
print "Here is the first line so you can identify it. Please mention that the error was a ValueError:" print "Here is the first line so you can identify it. Please mention that the error was a ValueError:"
print self.hand[0] 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__": if __name__ == "__main__":
print "CLI for fpdb_import is now available as CliFpdb.py" 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 smallBlindLine=0
for i in range(len(hand)): 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].find("posts small blind")!=-1 or hand[i].find("posts the small blind")!=-1:
if hand[i][-2:] == "$0":
continue
smallBlindLine=i smallBlindLine=i
#print "found small blind line:",smallBlindLine #print "found small blind line:",smallBlindLine
break break