From 6bc3e741c6d592706c17519b7706b6977d9fbd8e Mon Sep 17 00:00:00 2001 From: steffen123 Date: Fri, 2 Jul 2010 19:39:02 +0200 Subject: [PATCH] removed TourneyTypes.headsUp --- pyfpdb/AlchemyMappings.py | 3 +-- pyfpdb/AlchemyTables.py | 3 +-- pyfpdb/Database.py | 18 +++++++++--------- pyfpdb/FulltiltToFpdb.py | 3 +-- pyfpdb/Hand.py | 1 - pyfpdb/SQL.py | 15 +++++---------- pyfpdb/Tourney.py | 2 -- 7 files changed, 17 insertions(+), 28 deletions(-) diff --git a/pyfpdb/AlchemyMappings.py b/pyfpdb/AlchemyMappings.py index dfb255b4..b20df11f 100644 --- a/pyfpdb/AlchemyMappings.py +++ b/pyfpdb/AlchemyMappings.py @@ -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] diff --git a/pyfpdb/AlchemyTables.py b/pyfpdb/AlchemyTables.py index d78fb160..d936ce46 100644 --- a/pyfpdb/AlchemyTables.py +++ b/pyfpdb/AlchemyTables.py @@ -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) diff --git a/pyfpdb/Database.py b/pyfpdb/Database.py index d43133cb..c74dafde 100644 --- a/pyfpdb/Database.py +++ b/pyfpdb/Database.py @@ -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) diff --git a/pyfpdb/FulltiltToFpdb.py b/pyfpdb/FulltiltToFpdb.py index 5ee24db0..b6935c0c 100755 --- a/pyfpdb/FulltiltToFpdb.py +++ b/pyfpdb/FulltiltToFpdb.py @@ -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 diff --git a/pyfpdb/Hand.py b/pyfpdb/Hand.py index e57a8ecc..24a6cfd0 100644 --- a/pyfpdb/Hand.py +++ b/pyfpdb/Hand.py @@ -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 diff --git a/pyfpdb/SQL.py b/pyfpdb/SQL.py index d624ee26..75355430 100644 --- a/pyfpdb/SQL.py +++ b/pyfpdb/SQL.py @@ -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, diff --git a/pyfpdb/Tourney.py b/pyfpdb/Tourney.py index ad1130c3..245ea697 100644 --- a/pyfpdb/Tourney.py +++ b/pyfpdb/Tourney.py @@ -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),