Last part of core tourney import
Database.py : tStoreTourneyPlayers and tUpdateTourneysHandsPlayers implemented HandHistoryConverter.py : fix for 0-byte summary files SQL.py : new queries Tourney.py : cleanup stdout
This commit is contained in:
+7
-5
@@ -151,7 +151,6 @@ class Tourney(object):
|
||||
pass
|
||||
|
||||
def insert(self, db):
|
||||
print "TODO: Insert Tourney in DB"
|
||||
# First : check all needed info is filled in the object, especially for the initial select
|
||||
|
||||
# Notes on DB Insert
|
||||
@@ -163,15 +162,18 @@ class Tourney(object):
|
||||
# Note: If the TourneyNo could be a unique id .... this would really be a relief to deal with matrix matches ==> Ask on the IRC / Ask Fulltilt ??
|
||||
|
||||
dbTourneyTypeId = db.tRecogniseTourneyType(self)
|
||||
print "Tourney Type ID = %d" % dbTourneyTypeId
|
||||
logging.debug("Tourney Type ID = %d" % dbTourneyTypeId)
|
||||
dbTourneyId = db.tRecognizeTourney(self, dbTourneyTypeId)
|
||||
print "Tourney ID = %d" % dbTourneyId
|
||||
logging.debug("Tourney ID = %d" % dbTourneyId)
|
||||
dbTourneysPlayersIds = db.tStoreTourneyPlayers(self, dbTourneyId)
|
||||
db.tCheckTourneysHandsPlayers(self, dbTourneysPlayersIds, dbTourneyTypeId)
|
||||
logging.debug("TourneysPlayersId = %s" % dbTourneysPlayersIds)
|
||||
db.tUpdateTourneysHandsPlayers(self, dbTourneysPlayersIds, dbTourneyTypeId)
|
||||
logging.debug("tUpdateTourneysHandsPlayers done")
|
||||
logging.debug("Tourney Insert done")
|
||||
|
||||
# TO DO : Return what has been done (tourney created, updated, nothing)
|
||||
# ?? stored = 1 if tourney is fully created / duplicates = 1, if everything was already here and correct / partial=1 if some things were already here (between tourney, tourneyPlayers and handsplayers)
|
||||
# if so, prototypes may need changes to know what has been done
|
||||
# if so, prototypes may need changes to know what has been done or make some kind of dict in Tourney object that could be updated during the insert process to store that information
|
||||
stored = 0
|
||||
duplicates = 0
|
||||
partial = 0
|
||||
|
||||
Reference in New Issue
Block a user