recognise and store knockout and bounty

This commit is contained in:
steffen123 2010-08-02 13:53:50 +02:00
parent 388097a412
commit 9ad275e11c
4 changed files with 9 additions and 6 deletions

View File

@ -1990,7 +1990,7 @@ class Database:
#print "the query:",self.sql.query['getTourneyTypeId'].replace('%s', self.sql.query['placeholder']) #print "the query:",self.sql.query['getTourneyTypeId'].replace('%s', self.sql.query['placeholder'])
cursor.execute (self.sql.query['getTourneyTypeId'].replace('%s', self.sql.query['placeholder']), cursor.execute (self.sql.query['getTourneyTypeId'].replace('%s', self.sql.query['placeholder']),
(hand.siteId, hand.buyinCurrency, hand.buyin, hand.fee, hand.gametype['category'], hand.gametype['limitType'], hand.isKO, (hand.siteId, hand.buyinCurrency, hand.buyin, hand.fee, hand.gametype['category'], hand.gametype['limitType'], hand.isKO,
hand.isRebuy, hand.isAddOn, hand.speed, hand.isShootout, hand.isMatrix) hand.isRebuy, hand.isAddOn, hand.speed, hand.isShootout, hand.isMatrix) #TODO: add koamount
) )
result=cursor.fetchone() result=cursor.fetchone()
#print "result of fetching TT by details:",result #print "result of fetching TT by details:",result
@ -1999,8 +1999,8 @@ class Database:
tourneyTypeId = result[0] tourneyTypeId = result[0]
except TypeError: #this means we need to create a new entry except TypeError: #this means we need to create a new entry
cursor.execute (self.sql.query['insertTourneyType'].replace('%s', self.sql.query['placeholder']), cursor.execute (self.sql.query['insertTourneyType'].replace('%s', self.sql.query['placeholder']),
(hand.siteId, hand.buyinCurrency, hand.buyin, hand.fee, hand.gametype['category'], hand.gametype['limitType'], hand.buyInChips, (hand.siteId, hand.buyinCurrency, hand.buyin, hand.fee, hand.gametype['category'], hand.gametype['limitType'],
hand.isKO, hand.isRebuy, hand.buyInChips, hand.isKO, hand.koBounty, hand.isRebuy,
hand.isAddOn, hand.speed, hand.isShootout, hand.isMatrix, hand.added, hand.addedCurrency) hand.isAddOn, hand.speed, hand.isShootout, hand.isMatrix, hand.added, hand.addedCurrency)
) )
tourneyTypeId = self.get_last_insert_id(cursor) tourneyTypeId = self.get_last_insert_id(cursor)

View File

@ -83,6 +83,7 @@ class Hand(object):
self.isRebuy = False self.isRebuy = False
self.isAddOn = False self.isAddOn = False
self.isKO = False self.isKO = False
self.koBounty = None
self.isMatrix = False self.isMatrix = False
self.isShootout = False self.isShootout = False
self.added = None self.added = None
@ -168,6 +169,7 @@ class Hand(object):
("IS REBUY", self.isRebuy), ("IS REBUY", self.isRebuy),
("IS ADDON", self.isAddOn), ("IS ADDON", self.isAddOn),
("IS KO", self.isKO), ("IS KO", self.isKO),
("KO BOUNTY", self.koBounty),
("IS MATRIX", self.isMatrix), ("IS MATRIX", self.isMatrix),
("IS SHOOTOUT", self.isShootout), ("IS SHOOTOUT", self.isShootout),
("TOURNEY COMMENT", self.tourneyComment), ("TOURNEY COMMENT", self.tourneyComment),

View File

@ -257,7 +257,8 @@ class PokerStars(HandHistoryConverter):
hand.fee = int(100*Decimal(info['BOUNTY'][1:])) hand.fee = int(100*Decimal(info['BOUNTY'][1:]))
else: else:
hand.fee = int(100*Decimal(info['BIRAKE'][1:])) hand.fee = int(100*Decimal(info['BIRAKE'][1:]))
# TODO: Bounty is in key 'BOUNTY' hand.isKO = True
hand.koBounty = int(100*Decimal(info['BOUNTY'][1:]))
else: else:
hand.buyin = int(Decimal(info[key][0:-3])) hand.buyin = int(Decimal(info[key][0:-3]))
hand.fee = 0 hand.fee = 0

View File

@ -3786,9 +3786,9 @@ class Sql:
""" """
self.query['insertTourneyType'] = """INSERT INTO TourneyTypes self.query['insertTourneyType'] = """INSERT INTO TourneyTypes
(siteId, currency, buyin, fee, category, limitType, buyInChips, knockout, rebuy, (siteId, currency, buyin, fee, category, limitType, buyInChips, knockout, koBounty, rebuy,
addOn ,speed, shootout, matrix, added, addedCurrency) addOn ,speed, shootout, matrix, added, addedCurrency)
VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)
""" """
self.query['getTourneyByTourneyNo'] = """SELECT t.* self.query['getTourneyByTourneyNo'] = """SELECT t.*