Import Hand.insert() work

storeHand updated, almost works, just violating some NOT NULL contraints
This commit is contained in:
Worros 2009-08-09 01:59:44 +08:00
parent a24fe93612
commit d6529ab42f
2 changed files with 12 additions and 4 deletions

View File

@ -28,6 +28,7 @@ import sys
import traceback
from datetime import datetime, date, time, timedelta
from time import time, strftime, sleep
from decimal import Decimal
import string
import re
import logging
@ -1127,6 +1128,7 @@ class Database:
sitehandno,
handstart,
importtime,
seats,
maxseats,
boardcard1,
boardcard2,
@ -1135,7 +1137,8 @@ class Database:
boardcard5
)
VALUES
(%s, %s, %s, %s, %s, %s, %s, %s, %s, %s)"""
(%s, %s, %s, %s, %s, %s, %s, %s, %s, %s,
%s, %s)"""
#--- texture,
#-- playersVpi,
#-- playersAtStreet1,
@ -1156,14 +1159,17 @@ class Database:
#-- seats,
q = q.replace('%s', self.sql.query['placeholder'])
print "DEBUG: p: %s" %p
print "DEBUG: gtid: %s" % p['gameTypeId']
self.cursor.execute(q, (
p['tableName'],
p['gameTypeId'],
p['siteHandNo'],
p['gametypeid'],
p['handStart'],
datetime.today(), #importtime
# len(p['names']), #seats
p['maxSeats'],
p['seats'],
p['boardcard1'],
p['boardcard2'],
p['boardcard3'],

View File

@ -197,10 +197,10 @@ db: a connected fpdb_db object"""
hilo = "s"
elif self.gametype['category'] in ['razz','27_3draw','badugi']:
hilo = "l"
#FIXME - the two zeros are small_bet and big_bet for limit
gtid = db.insertGameTypes( (self.siteId, self.gametype['type'], self.gametype['base'],
self.gametype['category'], self.gametype['limitType'], hilo,
self.gametype['sb'], self.gametype['bb'], 0, 0) )
int(Decimal(self.gametype['sb'])*100), int(Decimal(self.gametype['bb'])*100), 0, 0) )
# HudCache data to come from DerivedStats class
@ -210,9 +210,11 @@ db: a connected fpdb_db object"""
hh = {}
hh['siteHandNo'] = self.handid
hh['handStart'] = self.starttime
hh['gameTypeId'] = gtid[0]
# seats TINYINT NOT NULL,
hh['tableName'] = self.tablename
hh['maxSeats'] = self.maxseats
hh['seats'] = len(sqlids)
# boardcard1 smallint, /* 0=none, 1-13=2-Ah 14-26=2-Ad 27-39=2-Ac 40-52=2-As */
# boardcard2 smallint,
# boardcard3 smallint,