Make new db insert code "usable"
Next step, make the players insert. Function doesn't exist at the moment and crashes when NEWIMPROT set to true
This commit is contained in:
parent
e113a1e692
commit
d546557ef7
|
@ -47,6 +47,8 @@ class HandHistoryConverter():
|
|||
|
||||
self.in_path = in_path
|
||||
self.out_path = out_path
|
||||
|
||||
self.processedHands = []
|
||||
|
||||
if in_path == '-':
|
||||
self.in_fh = sys.stdin
|
||||
|
@ -90,7 +92,7 @@ Otherwise, finish at eof.
|
|||
handsList = self.allHandsAsList()
|
||||
logging.info("Parsing %d hands" % len(handsList))
|
||||
for handText in handsList:
|
||||
self.processHand(handText)
|
||||
self.processedHands.append(self.processHand(handText))
|
||||
numHands= len(handsList)
|
||||
endtime = time.time()
|
||||
print "read %d hands in %.3f seconds" % (numHands, endtime - starttime)
|
||||
|
@ -200,6 +202,7 @@ which it expects to find at self.re_TailSplitHands -- see for e.g. Everleaf.py.
|
|||
if hand:
|
||||
# print hand
|
||||
hand.writeHand(self.out_fh)
|
||||
return hand
|
||||
else:
|
||||
logging.info("Unsupported game type: %s" % gametype)
|
||||
# TODO: pity we don't know the HID at this stage. Log the entire hand?
|
||||
|
@ -310,6 +313,7 @@ or None if we fail to get the info """
|
|||
self.filetype = filetype
|
||||
self.codepage = codepage
|
||||
|
||||
#This function doesn't appear to be used
|
||||
def splitFileIntoHands(self):
|
||||
hands = []
|
||||
self.obs = self.obs.strip()
|
||||
|
@ -347,6 +351,9 @@ or None if we fail to get the info """
|
|||
#TODO: Return a status of true if file processed ok
|
||||
return True
|
||||
|
||||
def getProcessedHands(self):
|
||||
return self.processedHands
|
||||
|
||||
def getProcessedFile(self):
|
||||
return self.out_path
|
||||
|
||||
|
|
|
@ -317,12 +317,12 @@ class Importer:
|
|||
(stored, duplicates, partial, errors, ttime) = self.import_fpdb_file(out_path, site)
|
||||
elif (conv.getStatus() and self.NEWIMPORT == True):
|
||||
#This code doesn't do anything yet
|
||||
handlist = hhc.getProcessedHands()
|
||||
self.pos_in_file[file] = hhc.getLastCharacterRead()
|
||||
handlist = conv.getProcessedHands()
|
||||
self.pos_in_file[file] = conv.getLastCharacterRead()
|
||||
|
||||
for hand in handlist:
|
||||
hand.prepInsert()
|
||||
hand.insert()
|
||||
hand.prepInsert(self.fdb)
|
||||
hand.insert(self.fdb)
|
||||
else:
|
||||
# conversion didn't work
|
||||
# TODO: appropriate response?
|
||||
|
|
Loading…
Reference in New Issue
Block a user