[NEWIMPORT] updateHudCache update.
Fix a couple of bugs: position != 2 its = 'M' actually commit changes to hud
This commit is contained in:
parent
a0475aa4db
commit
0adf0a7b18
|
@ -1569,7 +1569,8 @@ class Database:
|
|||
line[55] = gid # gametypeId
|
||||
line[56] = pids[p] # playerId
|
||||
line[57] = len(pids) # activeSeats
|
||||
line[58] = pdata[p]['position']
|
||||
pos = {-2:'B', -1:'S', 0:'D', 1:'C', 2:'M', 3:'M', 4:'M', 5:'E', 6:'E', 7:'E', 8:'E', 9:'E' }
|
||||
line[58] = pos[pdata[p]['position']]
|
||||
line[59] = pdata[p]['tourneyTypeId']
|
||||
line[60] = styleKey # styleKey
|
||||
inserts.append(line)
|
||||
|
@ -1580,6 +1581,7 @@ class Database:
|
|||
for row in inserts:
|
||||
# Try to do the update first:
|
||||
num = cursor.execute(update_hudcache, row)
|
||||
#print "DEBUG: values: %s" % row[-6:]
|
||||
# Test statusmessage to see if update worked, do insert if not
|
||||
# num is a cursor in sqlite
|
||||
if ((self.backend == self.PGSQL and cursor.statusmessage != "UPDATE 1")
|
||||
|
@ -1587,12 +1589,12 @@ class Database:
|
|||
or (self.backend == self.SQLITE and num.rowcount == 0)):
|
||||
#move the last 6 items in WHERE clause of row from the end of the array
|
||||
# to the beginning for the INSERT statement
|
||||
print "DEBUG: using INSERT: %s" % num
|
||||
#print "DEBUG: using INSERT: %s" % num
|
||||
row = row[-6:] + row[:-6]
|
||||
num = cursor.execute(insert_hudcache, row)
|
||||
print "DEBUG: Successfully(?: %s) updated HudCacho using INSERT" % num
|
||||
#print "DEBUG: Successfully(?: %s) updated HudCacho using INSERT" % num
|
||||
else:
|
||||
print "DEBUG: Successfully updated HudCacho using UPDATE"
|
||||
#print "DEBUG: Successfully updated HudCacho using UPDATE"
|
||||
pass
|
||||
|
||||
def isDuplicate(self, gametypeID, siteHandNo):
|
||||
|
|
|
@ -452,6 +452,7 @@ class Importer:
|
|||
# FIXME: Need to test for bulk import that isn't rebuilding the cache
|
||||
if self.callHud:
|
||||
hand.updateHudCache(self.database)
|
||||
self.database.commit()
|
||||
|
||||
#pipe the Hands.id out to the HUD
|
||||
for hid in to_hud:
|
||||
|
|
Loading…
Reference in New Issue
Block a user