More fixing of import options.
This commit is contained in:
parent
e67f715f27
commit
8009281e5a
|
@ -32,6 +32,13 @@ import shutil
|
||||||
import xml.dom.minidom
|
import xml.dom.minidom
|
||||||
from xml.dom.minidom import Node
|
from xml.dom.minidom import Node
|
||||||
|
|
||||||
|
def fix_tf(x):
|
||||||
|
if x == "1" or x == 1 or string.lower(x) == "true" or string.lower(x) == "t":
|
||||||
|
return True
|
||||||
|
if x == "0" or x == 0 or string.lower(x) == "false" or string.lower(x) == "f":
|
||||||
|
return False
|
||||||
|
return False
|
||||||
|
|
||||||
class Layout:
|
class Layout:
|
||||||
def __init__(self, node):
|
def __init__(self, node):
|
||||||
|
|
||||||
|
@ -206,11 +213,11 @@ class Import:
|
||||||
self.callFpdbHud = node.getAttribute("callFpdbHud")
|
self.callFpdbHud = node.getAttribute("callFpdbHud")
|
||||||
self.hhArchiveBase = node.getAttribute("hhArchiveBase")
|
self.hhArchiveBase = node.getAttribute("hhArchiveBase")
|
||||||
if node.hasAttribute("saveActions"):
|
if node.hasAttribute("saveActions"):
|
||||||
self.saveActions = node.getAttribute("saveActions")
|
self.saveActions = fix_tf(node.getAttribute("saveActions"))
|
||||||
else:
|
else:
|
||||||
self.saveActions = True
|
self.saveActions = True
|
||||||
if node.hasAttribute("fastStoreHudCache"):
|
if node.hasAttribute("fastStoreHudCache"):
|
||||||
self.fastStoreHudCache = node.getAttribute("fastStoreHudCache")
|
self.fastStoreHudCache = fix_tf(node.getAttribute("fastStoreHudCache"))
|
||||||
else:
|
else:
|
||||||
self.fastStoreHudCache = False
|
self.fastStoreHudCache = False
|
||||||
|
|
||||||
|
|
|
@ -40,14 +40,8 @@ def ring_stud(config, backend, db, cursor, base, category, site_hand_no, gametyp
|
||||||
,seatNos):
|
,seatNos):
|
||||||
|
|
||||||
import_options = config.get_import_parameters()
|
import_options = config.get_import_parameters()
|
||||||
if import_options['saveActions'] == 'True':
|
saveActions = import_options['saveActions']
|
||||||
saveActions = True
|
fastStoreHudCache = import_options['fastStoreHudCache']
|
||||||
else:
|
|
||||||
saveActions = False
|
|
||||||
if import_options['fastStoreHudCache'] == 'True':
|
|
||||||
fastStoreHudCache = True
|
|
||||||
else:
|
|
||||||
fastStoreHudCache = False
|
|
||||||
|
|
||||||
fpdb_simple.fillCardArrays(len(names), base, category, card_values, card_suits)
|
fpdb_simple.fillCardArrays(len(names), base, category, card_values, card_suits)
|
||||||
|
|
||||||
|
@ -74,14 +68,8 @@ def ring_holdem_omaha(config, backend, db, cursor, base, category, site_hand_no,
|
||||||
"""stores a holdem/omaha hand into the database"""
|
"""stores a holdem/omaha hand into the database"""
|
||||||
|
|
||||||
import_options = config.get_import_parameters()
|
import_options = config.get_import_parameters()
|
||||||
if import_options['saveActions'] == 'True':
|
saveActions = import_options['saveActions']
|
||||||
saveActions = True
|
fastStoreHudCache = import_options['fastStoreHudCache']
|
||||||
else:
|
|
||||||
saveActions = False
|
|
||||||
if import_options['fastStoreHudCache'] == 'True':
|
|
||||||
fastStoreHudCache = True
|
|
||||||
else:
|
|
||||||
fastStoreHudCache = False
|
|
||||||
|
|
||||||
t0 = time()
|
t0 = time()
|
||||||
fpdb_simple.fillCardArrays(len(names), base, category, card_values, card_suits)
|
fpdb_simple.fillCardArrays(len(names), base, category, card_values, card_suits)
|
||||||
|
@ -121,14 +109,8 @@ def tourney_holdem_omaha(config, backend, db, cursor, base, category, siteTourne
|
||||||
"""stores a tourney holdem/omaha hand into the database"""
|
"""stores a tourney holdem/omaha hand into the database"""
|
||||||
|
|
||||||
import_options = config.get_import_parameters()
|
import_options = config.get_import_parameters()
|
||||||
if import_options['saveActions'] == 'True':
|
saveActions = import_options['saveActions']
|
||||||
saveActions = True
|
fastStoreHudCache = import_options['fastStoreHudCache']
|
||||||
else:
|
|
||||||
saveActions = False
|
|
||||||
if import_options['fastStoreHudCache'] == 'True':
|
|
||||||
fastStoreHudCache = True
|
|
||||||
else:
|
|
||||||
fastStoreHudCache = False
|
|
||||||
|
|
||||||
fpdb_simple.fillCardArrays(len(names), base, category, card_values, card_suits)
|
fpdb_simple.fillCardArrays(len(names), base, category, card_values, card_suits)
|
||||||
fpdb_simple.fill_board_cards(board_values, board_suits)
|
fpdb_simple.fill_board_cards(board_values, board_suits)
|
||||||
|
@ -164,14 +146,8 @@ def tourney_stud(config, backend, db, cursor, base, category, siteTourneyNo, buy
|
||||||
#stores a tourney stud/razz hand into the database
|
#stores a tourney stud/razz hand into the database
|
||||||
|
|
||||||
import_options = config.get_import_parameters()
|
import_options = config.get_import_parameters()
|
||||||
if import_options['saveActions'] == 'True':
|
saveActions = import_options['saveActions']
|
||||||
saveActions = True
|
fastStoreHudCache = import_options['fastStoreHudCache']
|
||||||
else:
|
|
||||||
saveActions = False
|
|
||||||
if import_options['fastStoreHudCache'] == 'True':
|
|
||||||
fastStoreHudCache = True
|
|
||||||
else:
|
|
||||||
fastStoreHudCache = False
|
|
||||||
|
|
||||||
fpdb_simple.fillCardArrays(len(names), base, category, cardValues, cardSuits)
|
fpdb_simple.fillCardArrays(len(names), base, category, cardValues, cardSuits)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user