removed TourneyTypes.headsUp
This commit is contained in:
parent
d652eb5d3c
commit
6bc3e741c6
|
@ -154,7 +154,6 @@ class HandInternal(DerivedStats):
|
||||||
'knockout': 'isKO',
|
'knockout': 'isKO',
|
||||||
'rebuy': 'isRebuy',
|
'rebuy': 'isRebuy',
|
||||||
'addOn': 'isAddOn',
|
'addOn': 'isAddOn',
|
||||||
'headsUp': 'isHU',
|
|
||||||
'shootout': 'isShootout',
|
'shootout': 'isShootout',
|
||||||
'matrix': 'isMatrix',
|
'matrix': 'isMatrix',
|
||||||
'sng': 'isSNG',
|
'sng': 'isSNG',
|
||||||
|
@ -383,7 +382,7 @@ class TourneyType(MappedBase):
|
||||||
|
|
||||||
Required kwargs:
|
Required kwargs:
|
||||||
buyin fee speed maxSeats knockout
|
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]
|
return get_or_create(cls, session, **kwargs)[0]
|
||||||
|
|
||||||
|
|
|
@ -383,7 +383,6 @@ tourney_types_table = Table('TourneyTypes', metadata,
|
||||||
Column('knockout', Boolean, nullable=False, default=False), # BOOLEAN NOT NULL DEFAULT False
|
Column('knockout', Boolean, nullable=False, default=False), # BOOLEAN NOT NULL DEFAULT False
|
||||||
Column('koBounty', Integer), # INT
|
Column('koBounty', Integer), # INT
|
||||||
Column('speed', String(10)), # varchar(10)
|
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('shootout', Boolean, nullable=False, default=False), # BOOLEAN NOT NULL DEFAULT False
|
||||||
Column('matrix', 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
|
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',
|
Index('tourneyTypes_all',
|
||||||
tourney_types_table.c.siteId, tourney_types_table.c.buyin, tourney_types_table.c.fee,
|
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.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)
|
tourney_types_table.c.shootout, tourney_types_table.c.matrix, tourney_types_table.c.sng)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1358,16 +1358,16 @@ class Database:
|
||||||
c.execute("INSERT INTO Sites (name,code) VALUES ('PKR', 'PK')")
|
c.execute("INSERT INTO Sites (name,code) VALUES ('PKR', 'PK')")
|
||||||
if self.backend == self.SQLITE:
|
if self.backend == self.SQLITE:
|
||||||
c.execute("""INSERT INTO TourneyTypes (id, siteId, currency, buyin, fee, buyInChips, maxSeats, knockout,
|
c.execute("""INSERT INTO TourneyTypes (id, siteId, currency, buyin, fee, buyInChips, maxSeats, knockout,
|
||||||
rebuy, addOn, speed, headsUp, shootout, matrix)
|
rebuy, addOn, speed, shootout, matrix)
|
||||||
VALUES (NULL, 1, 'USD', 0, 0, 0, 0, 0, 0, 0, NULL, 0, 0, 0);""")
|
VALUES (NULL, 1, 'USD', 0, 0, 0, 0, 0, 0, 0, NULL, 0, 0);""")
|
||||||
elif self.backend == self.PGSQL:
|
elif self.backend == self.PGSQL:
|
||||||
c.execute("""insert into TourneyTypes(siteId, currency, buyin, fee, buyInChips, maxSeats, knockout
|
c.execute("""insert into TourneyTypes(siteId, currency, buyin, fee, buyInChips, maxSeats, knockout
|
||||||
,rebuy, addOn, speed, headsUp, shootout, matrix)
|
,rebuy, addOn, speed, shootout, matrix)
|
||||||
values (1, 'USD', 0, 0, 0, 0, False, False, False, null, False, False, False);""")
|
values (1, 'USD', 0, 0, 0, 0, False, False, False, null, False, False);""")
|
||||||
elif self.backend == self.MYSQL_INNODB:
|
elif self.backend == self.MYSQL_INNODB:
|
||||||
c.execute("""insert into TourneyTypes(id, siteId, currency, buyin, fee, buyInChips, maxSeats, knockout
|
c.execute("""insert into TourneyTypes(id, siteId, currency, buyin, fee, buyInChips, maxSeats, knockout
|
||||||
,rebuy, addOn, speed, headsUp, shootout, matrix)
|
,rebuy, addOn, speed, shootout, matrix)
|
||||||
values (DEFAULT, 1, 'USD', 0, 0, 0, 0, False, False, False, null, False, False, False);""")
|
values (DEFAULT, 1, 'USD', 0, 0, 0, 0, False, False, False, null, False, False);""")
|
||||||
#end def fillDefaultData
|
#end def fillDefaultData
|
||||||
|
|
||||||
def rebuild_indexes(self, start=None):
|
def rebuild_indexes(self, start=None):
|
||||||
|
@ -1943,7 +1943,7 @@ class Database:
|
||||||
result=cursor.fetchone()
|
result=cursor.fetchone()
|
||||||
|
|
||||||
expectedValues = { 1 : "buyin", 2 : "fee", 4 : "isKO", 5 : "isRebuy", 6 : "speed",
|
expectedValues = { 1 : "buyin", 2 : "fee", 4 : "isKO", 5 : "isRebuy", 6 : "speed",
|
||||||
7 : "isHU", 8 : "isShootout", 9 : "isMatrix" }
|
7 : "isShootout", 8 : "isMatrix" }
|
||||||
typeIdMatch = True
|
typeIdMatch = True
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
@ -1965,7 +1965,7 @@ class Database:
|
||||||
log.debug("Searching for a TourneyTypeId matching TourneyType data")
|
log.debug("Searching for a TourneyTypeId matching TourneyType data")
|
||||||
cursor.execute (self.sql.query['getTourneyTypeId'].replace('%s', self.sql.query['placeholder']),
|
cursor.execute (self.sql.query['getTourneyTypeId'].replace('%s', self.sql.query['placeholder']),
|
||||||
(tourney.siteId, tourney.buyin, tourney.fee, tourney.isKO,
|
(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()
|
result=cursor.fetchone()
|
||||||
|
|
||||||
|
@ -1977,7 +1977,7 @@ class Database:
|
||||||
log.debug("Tourney Type Id not found : create one")
|
log.debug("Tourney Type Id not found : create one")
|
||||||
cursor.execute (self.sql.query['insertTourneyTypes'].replace('%s', self.sql.query['placeholder']),
|
cursor.execute (self.sql.query['insertTourneyTypes'].replace('%s', self.sql.query['placeholder']),
|
||||||
(tourney.siteId, tourney.buyin, tourney.fee, tourney.isKO, tourney.isRebuy,
|
(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)
|
typeId = self.get_last_insert_id(cursor)
|
||||||
|
|
||||||
|
|
|
@ -231,7 +231,7 @@ class Fulltilt(HandHistoryConverter):
|
||||||
if special == "KO":
|
if special == "KO":
|
||||||
hand.isKO = True
|
hand.isKO = True
|
||||||
if special == "Head's Up":
|
if special == "Head's Up":
|
||||||
hand.isHU = True
|
hand.maxSeats = 2
|
||||||
if re.search("Matrix", special):
|
if re.search("Matrix", special):
|
||||||
hand.isMatrix = True
|
hand.isMatrix = True
|
||||||
if special == "Shootout":
|
if special == "Shootout":
|
||||||
|
@ -497,7 +497,6 @@ class Fulltilt(HandHistoryConverter):
|
||||||
if special == "KO":
|
if special == "KO":
|
||||||
tourney.isKO = True
|
tourney.isKO = True
|
||||||
if special == "Heads Up":
|
if special == "Heads Up":
|
||||||
tourney.isHU = True
|
|
||||||
tourney.maxseats = 2
|
tourney.maxseats = 2
|
||||||
if re.search("Matrix", special):
|
if re.search("Matrix", special):
|
||||||
tourney.isMatrix = True
|
tourney.isMatrix = True
|
||||||
|
|
|
@ -79,7 +79,6 @@ class Hand(object):
|
||||||
self.speed = "Normal"
|
self.speed = "Normal"
|
||||||
self.isRebuy = False
|
self.isRebuy = False
|
||||||
self.isKO = False
|
self.isKO = False
|
||||||
self.isHU = False
|
|
||||||
self.isMatrix = False
|
self.isMatrix = False
|
||||||
self.isShootout = False
|
self.isShootout = False
|
||||||
self.tourneyComment = None
|
self.tourneyComment = None
|
||||||
|
|
|
@ -376,7 +376,6 @@ class Sql:
|
||||||
knockout BOOLEAN NOT NULL DEFAULT False,
|
knockout BOOLEAN NOT NULL DEFAULT False,
|
||||||
koBounty INT,
|
koBounty INT,
|
||||||
speed varchar(10),
|
speed varchar(10),
|
||||||
headsUp BOOLEAN NOT NULL DEFAULT False,
|
|
||||||
shootout BOOLEAN NOT NULL DEFAULT False,
|
shootout BOOLEAN NOT NULL DEFAULT False,
|
||||||
matrix BOOLEAN NOT NULL DEFAULT False,
|
matrix BOOLEAN NOT NULL DEFAULT False,
|
||||||
sng BOOLEAN NOT NULL DEFAULT False,
|
sng BOOLEAN NOT NULL DEFAULT False,
|
||||||
|
@ -402,7 +401,6 @@ class Sql:
|
||||||
knockout BOOLEAN NOT NULL DEFAULT False,
|
knockout BOOLEAN NOT NULL DEFAULT False,
|
||||||
koBounty INT,
|
koBounty INT,
|
||||||
speed varchar(10),
|
speed varchar(10),
|
||||||
headsUp BOOLEAN NOT NULL DEFAULT False,
|
|
||||||
shootout BOOLEAN NOT NULL DEFAULT False,
|
shootout BOOLEAN NOT NULL DEFAULT False,
|
||||||
matrix BOOLEAN NOT NULL DEFAULT False,
|
matrix BOOLEAN NOT NULL DEFAULT False,
|
||||||
sng BOOLEAN NOT NULL DEFAULT False,
|
sng BOOLEAN NOT NULL DEFAULT False,
|
||||||
|
@ -427,7 +425,6 @@ class Sql:
|
||||||
knockout BOOLEAN NOT NULL DEFAULT 0,
|
knockout BOOLEAN NOT NULL DEFAULT 0,
|
||||||
koBounty INT,
|
koBounty INT,
|
||||||
speed TEXT,
|
speed TEXT,
|
||||||
headsUp BOOLEAN NOT NULL DEFAULT 0,
|
|
||||||
shootout BOOLEAN NOT NULL DEFAULT 0,
|
shootout BOOLEAN NOT NULL DEFAULT 0,
|
||||||
matrix BOOLEAN NOT NULL DEFAULT 0,
|
matrix BOOLEAN NOT NULL DEFAULT 0,
|
||||||
sng BOOLEAN NOT NULL DEFAULT 0,
|
sng BOOLEAN NOT NULL DEFAULT 0,
|
||||||
|
@ -1266,13 +1263,13 @@ class Sql:
|
||||||
|
|
||||||
if db_server == 'mysql':
|
if db_server == 'mysql':
|
||||||
self.query['addTTypesIndex'] = """ALTER TABLE TourneyTypes ADD UNIQUE INDEX tourneytypes_all(buyin, fee
|
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':
|
elif db_server == 'postgresql':
|
||||||
self.query['addTTypesIndex'] = """CREATE UNIQUE INDEX tourneyTypes_all ON TourneyTypes (buyin, fee
|
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':
|
elif db_server == 'sqlite':
|
||||||
self.query['addTTypesIndex'] = """CREATE UNIQUE INDEX tourneyTypes_all ON TourneyTypes (buyin, fee
|
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"
|
self.query['get_last_hand'] = "select max(id) from Hands"
|
||||||
|
|
||||||
|
@ -3592,7 +3589,6 @@ class Sql:
|
||||||
tt.rebuy,
|
tt.rebuy,
|
||||||
tt.addOn,
|
tt.addOn,
|
||||||
tt.speed,
|
tt.speed,
|
||||||
tt.headsUp,
|
|
||||||
tt.shootout,
|
tt.shootout,
|
||||||
tt.matrix
|
tt.matrix
|
||||||
FROM TourneyTypes tt
|
FROM TourneyTypes tt
|
||||||
|
@ -3609,15 +3605,14 @@ class Sql:
|
||||||
AND rebuy=%s
|
AND rebuy=%s
|
||||||
AND addOn=%s
|
AND addOn=%s
|
||||||
AND speed=%s
|
AND speed=%s
|
||||||
AND headsUp=%s
|
|
||||||
AND shootout=%s
|
AND shootout=%s
|
||||||
AND matrix=%s
|
AND matrix=%s
|
||||||
"""
|
"""
|
||||||
|
|
||||||
self.query['insertTourneyTypes'] = """INSERT INTO TourneyTypes
|
self.query['insertTourneyTypes'] = """INSERT INTO TourneyTypes
|
||||||
(siteId, buyin, fee, knockout, rebuy, addOn
|
(siteId, buyin, fee, knockout, rebuy, addOn
|
||||||
,speed, headsUp, shootout, matrix)
|
,speed, shootout, matrix)
|
||||||
VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s)
|
VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s)
|
||||||
"""
|
"""
|
||||||
|
|
||||||
self.query['getTourney'] = """SELECT t.id,
|
self.query['getTourney'] = """SELECT t.id,
|
||||||
|
|
|
@ -66,7 +66,6 @@ class Tourney(object):
|
||||||
self.mixed = None
|
self.mixed = None
|
||||||
self.isRebuy = False
|
self.isRebuy = False
|
||||||
self.isKO = False
|
self.isKO = False
|
||||||
self.isHU = False
|
|
||||||
self.isMatrix = False
|
self.isMatrix = False
|
||||||
self.isShootout = False
|
self.isShootout = False
|
||||||
self.matrixMatchId = None # For Matrix tourneys : 1-4 => match tables (traditionnal), 0 => Positional winnings info
|
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),
|
("MIXED", self.mixed),
|
||||||
("REBUY ADDON", self.isRebuy),
|
("REBUY ADDON", self.isRebuy),
|
||||||
("KO", self.isKO),
|
("KO", self.isKO),
|
||||||
("HU", self.isHU),
|
|
||||||
("MATRIX", self.isMatrix),
|
("MATRIX", self.isMatrix),
|
||||||
("SHOOTOUT", self.isShootout),
|
("SHOOTOUT", self.isShootout),
|
||||||
("MATRIX MATCH ID", self.matrixMatchId),
|
("MATRIX MATCH ID", self.matrixMatchId),
|
||||||
|
|
Loading…
Reference in New Issue
Block a user