removed TourneyTypes.headsUp

This commit is contained in:
steffen123 2010-07-02 19:39:02 +02:00
parent d652eb5d3c
commit 6bc3e741c6
7 changed files with 17 additions and 28 deletions

View File

@ -154,7 +154,6 @@ class HandInternal(DerivedStats):
'knockout': 'isKO',
'rebuy': 'isRebuy',
'addOn': 'isAddOn',
'headsUp': 'isHU',
'shootout': 'isShootout',
'matrix': 'isMatrix',
'sng': 'isSNG',
@ -383,7 +382,7 @@ class TourneyType(MappedBase):
Required kwargs:
buyin fee speed maxSeats knockout
rebuy addOn headsUp shootout matrix sng currency
rebuy addOn shootout matrix sng currency
"""
return get_or_create(cls, session, **kwargs)[0]

View File

@ -383,7 +383,6 @@ tourney_types_table = Table('TourneyTypes', metadata,
Column('knockout', Boolean, nullable=False, default=False), # BOOLEAN NOT NULL DEFAULT False
Column('koBounty', Integer), # INT
Column('speed', String(10)), # varchar(10)
Column('headsUp', Boolean, nullable=False, default=False), # BOOLEAN NOT NULL DEFAULT False
Column('shootout', Boolean, nullable=False, default=False), # BOOLEAN NOT NULL DEFAULT False
Column('matrix', Boolean, nullable=False, default=False), # BOOLEAN NOT NULL DEFAULT False
Column('sng', Boolean, nullable=False, default=False), # BOOLEAN NOT NULL DEFAULT False
@ -396,7 +395,7 @@ tourney_types_table = Table('TourneyTypes', metadata,
Index('tourneyTypes_all',
tourney_types_table.c.siteId, tourney_types_table.c.buyin, tourney_types_table.c.fee,
tourney_types_table.c.maxSeats, tourney_types_table.c.knockout, tourney_types_table.c.rebuy,
tourney_types_table.c.addOn, tourney_types_table.c.speed, tourney_types_table.c.headsUp,
tourney_types_table.c.addOn, tourney_types_table.c.speed,
tourney_types_table.c.shootout, tourney_types_table.c.matrix, tourney_types_table.c.sng)

View File

@ -1358,16 +1358,16 @@ class Database:
c.execute("INSERT INTO Sites (name,code) VALUES ('PKR', 'PK')")
if self.backend == self.SQLITE:
c.execute("""INSERT INTO TourneyTypes (id, siteId, currency, buyin, fee, buyInChips, maxSeats, knockout,
rebuy, addOn, speed, headsUp, shootout, matrix)
VALUES (NULL, 1, 'USD', 0, 0, 0, 0, 0, 0, 0, NULL, 0, 0, 0);""")
rebuy, addOn, speed, shootout, matrix)
VALUES (NULL, 1, 'USD', 0, 0, 0, 0, 0, 0, 0, NULL, 0, 0);""")
elif self.backend == self.PGSQL:
c.execute("""insert into TourneyTypes(siteId, currency, buyin, fee, buyInChips, maxSeats, knockout
,rebuy, addOn, speed, headsUp, shootout, matrix)
values (1, 'USD', 0, 0, 0, 0, False, False, False, null, False, False, False);""")
,rebuy, addOn, speed, shootout, matrix)
values (1, 'USD', 0, 0, 0, 0, False, False, False, null, False, False);""")
elif self.backend == self.MYSQL_INNODB:
c.execute("""insert into TourneyTypes(id, siteId, currency, buyin, fee, buyInChips, maxSeats, knockout
,rebuy, addOn, speed, headsUp, shootout, matrix)
values (DEFAULT, 1, 'USD', 0, 0, 0, 0, False, False, False, null, False, False, False);""")
,rebuy, addOn, speed, shootout, matrix)
values (DEFAULT, 1, 'USD', 0, 0, 0, 0, False, False, False, null, False, False);""")
#end def fillDefaultData
def rebuild_indexes(self, start=None):
@ -1943,7 +1943,7 @@ class Database:
result=cursor.fetchone()
expectedValues = { 1 : "buyin", 2 : "fee", 4 : "isKO", 5 : "isRebuy", 6 : "speed",
7 : "isHU", 8 : "isShootout", 9 : "isMatrix" }
7 : "isShootout", 8 : "isMatrix" }
typeIdMatch = True
try:
@ -1965,7 +1965,7 @@ class Database:
log.debug("Searching for a TourneyTypeId matching TourneyType data")
cursor.execute (self.sql.query['getTourneyTypeId'].replace('%s', self.sql.query['placeholder']),
(tourney.siteId, tourney.buyin, tourney.fee, tourney.isKO,
tourney.isRebuy, tourney.speed, tourney.isHU, tourney.isShootout, tourney.isMatrix)
tourney.isRebuy, tourney.speed, tourney.isShootout, tourney.isMatrix)
)
result=cursor.fetchone()
@ -1977,7 +1977,7 @@ class Database:
log.debug("Tourney Type Id not found : create one")
cursor.execute (self.sql.query['insertTourneyTypes'].replace('%s', self.sql.query['placeholder']),
(tourney.siteId, tourney.buyin, tourney.fee, tourney.isKO, tourney.isRebuy,
tourney.speed, tourney.isHU, tourney.isShootout, tourney.isMatrix)
tourney.speed, tourney.isShootout, tourney.isMatrix)
)
typeId = self.get_last_insert_id(cursor)

View File

@ -231,7 +231,7 @@ class Fulltilt(HandHistoryConverter):
if special == "KO":
hand.isKO = True
if special == "Head's Up":
hand.isHU = True
hand.maxSeats = 2
if re.search("Matrix", special):
hand.isMatrix = True
if special == "Shootout":
@ -497,7 +497,6 @@ class Fulltilt(HandHistoryConverter):
if special == "KO":
tourney.isKO = True
if special == "Heads Up":
tourney.isHU = True
tourney.maxseats = 2
if re.search("Matrix", special):
tourney.isMatrix = True

View File

@ -79,7 +79,6 @@ class Hand(object):
self.speed = "Normal"
self.isRebuy = False
self.isKO = False
self.isHU = False
self.isMatrix = False
self.isShootout = False
self.tourneyComment = None

View File

@ -376,7 +376,6 @@ class Sql:
knockout BOOLEAN NOT NULL DEFAULT False,
koBounty INT,
speed varchar(10),
headsUp BOOLEAN NOT NULL DEFAULT False,
shootout BOOLEAN NOT NULL DEFAULT False,
matrix BOOLEAN NOT NULL DEFAULT False,
sng BOOLEAN NOT NULL DEFAULT False,
@ -402,7 +401,6 @@ class Sql:
knockout BOOLEAN NOT NULL DEFAULT False,
koBounty INT,
speed varchar(10),
headsUp BOOLEAN NOT NULL DEFAULT False,
shootout BOOLEAN NOT NULL DEFAULT False,
matrix BOOLEAN NOT NULL DEFAULT False,
sng BOOLEAN NOT NULL DEFAULT False,
@ -427,7 +425,6 @@ class Sql:
knockout BOOLEAN NOT NULL DEFAULT 0,
koBounty INT,
speed TEXT,
headsUp BOOLEAN NOT NULL DEFAULT 0,
shootout BOOLEAN NOT NULL DEFAULT 0,
matrix BOOLEAN NOT NULL DEFAULT 0,
sng BOOLEAN NOT NULL DEFAULT 0,
@ -1266,13 +1263,13 @@ class Sql:
if db_server == 'mysql':
self.query['addTTypesIndex'] = """ALTER TABLE TourneyTypes ADD UNIQUE INDEX tourneytypes_all(buyin, fee
, maxSeats, knockout, rebuy, addOn, speed, headsUp, shootout, matrix, sng)"""
, maxSeats, knockout, rebuy, addOn, speed, shootout, matrix, sng)"""
elif db_server == 'postgresql':
self.query['addTTypesIndex'] = """CREATE UNIQUE INDEX tourneyTypes_all ON TourneyTypes (buyin, fee
, maxSeats, knockout, rebuy, addOn, speed, headsUp, shootout, matrix, sng)"""
, maxSeats, knockout, rebuy, addOn, speed, shootout, matrix, sng)"""
elif db_server == 'sqlite':
self.query['addTTypesIndex'] = """CREATE UNIQUE INDEX tourneyTypes_all ON TourneyTypes (buyin, fee
, maxSeats, knockout, rebuy, addOn, speed, headsUp, shootout, matrix, sng)"""
, maxSeats, knockout, rebuy, addOn, speed, shootout, matrix, sng)"""
self.query['get_last_hand'] = "select max(id) from Hands"
@ -3592,7 +3589,6 @@ class Sql:
tt.rebuy,
tt.addOn,
tt.speed,
tt.headsUp,
tt.shootout,
tt.matrix
FROM TourneyTypes tt
@ -3609,15 +3605,14 @@ class Sql:
AND rebuy=%s
AND addOn=%s
AND speed=%s
AND headsUp=%s
AND shootout=%s
AND matrix=%s
"""
self.query['insertTourneyTypes'] = """INSERT INTO TourneyTypes
(siteId, buyin, fee, knockout, rebuy, addOn
,speed, headsUp, shootout, matrix)
VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s)
,speed, shootout, matrix)
VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s)
"""
self.query['getTourney'] = """SELECT t.id,

View File

@ -66,7 +66,6 @@ class Tourney(object):
self.mixed = None
self.isRebuy = False
self.isKO = False
self.isHU = False
self.isMatrix = False
self.isShootout = False
self.matrixMatchId = None # For Matrix tourneys : 1-4 => match tables (traditionnal), 0 => Positional winnings info
@ -117,7 +116,6 @@ class Tourney(object):
("MIXED", self.mixed),
("REBUY ADDON", self.isRebuy),
("KO", self.isKO),
("HU", self.isHU),
("MATRIX", self.isMatrix),
("SHOOTOUT", self.isShootout),
("MATRIX MATCH ID", self.matrixMatchId),