p86 - ftp: read maxSeats rather than making an assumption. included new ebuild this time but obviously untried (can only try it after making the file release..). removed old ebuilds.
This commit is contained in:
+1
-1
@@ -407,7 +407,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: alpha3+, p84")
|
||||
self.window.set_title("Free Poker DB - version: alpha4, p86")
|
||||
self.window.set_border_width(1)
|
||||
self.window.set_size_request(1020,400)
|
||||
self.window.set_resizable(True)
|
||||
|
||||
@@ -93,11 +93,11 @@ def mainParser(db, cursor, site, category, hand):
|
||||
elif (lineTypes[i]=="ante"):
|
||||
fpdb_simple.parseAnteLine(hand[i], site, names, antes)
|
||||
elif (lineTypes[i]=="table"):
|
||||
tableResult=fpdb_simple.parseTableLine(site, hand[i])
|
||||
tableResult=fpdb_simple.parseTableLine(site, base, hand[i])
|
||||
else:
|
||||
raise fpdb_simple.FpdbError("unrecognised lineType:"+lineTypes[i])
|
||||
if site=="ftp":
|
||||
tableResult=fpdb_simple.parseTableLine(site, hand[0])
|
||||
tableResult=fpdb_simple.parseTableLine(site, base, hand[0])
|
||||
maxSeats=tableResult['maxSeats']
|
||||
tableName=tableResult['tableName']
|
||||
|
||||
|
||||
+14
-3
@@ -884,7 +884,7 @@ def parseSiteHandNo(topline):
|
||||
return topline[pos1:pos2]
|
||||
#end def parseSiteHandNo
|
||||
|
||||
def parseTableLine(site, line):
|
||||
def parseTableLine(site, base, line):
|
||||
"""returns a dictionary with maxSeats and tableName"""
|
||||
if site=="ps":
|
||||
pos1=line.find('\'')+1
|
||||
@@ -897,8 +897,19 @@ def parseTableLine(site, line):
|
||||
elif site=="ftp":
|
||||
pos1=line.find("Table ")+6
|
||||
pos2=line.find("-")-1
|
||||
#print "table:",line[pos1:pos2]+"end"
|
||||
return {'maxSeats':9, 'tableName':line[pos1:pos2]}
|
||||
if base=="hold":
|
||||
maxSeats=9
|
||||
elif base=="stud":
|
||||
maxSeats=8
|
||||
|
||||
if line.find("6 max")!=-1:
|
||||
maxSeats=6
|
||||
elif line.find("4 max")!=-1:
|
||||
maxSeats=4
|
||||
elif line.find("heads up")!=-1:
|
||||
maxSeats=2
|
||||
|
||||
return {'maxSeats':maxSeats, 'tableName':line[pos1:pos2]}
|
||||
else:
|
||||
raise FpdbError("invalid site ID")
|
||||
#end def parseTableLine
|
||||
|
||||
Reference in New Issue
Block a user