Merge branch 'next'
Conflicts: pyfpdb/Configuration.py pyfpdb/locale/de/LC_MESSAGES/fpdb.mo pyfpdb/locale/es/LC_MESSAGES/fpdb.mo pyfpdb/locale/fpdb-de_DE.po pyfpdb/locale/fpdb-en_GB.pot pyfpdb/locale/fpdb-es_ES.po pyfpdb/locale/fpdb-fr_FR.po pyfpdb/locale/fpdb-hu_HU.po pyfpdb/locale/fpdb-it_IT.po pyfpdb/locale/fpdb-pl_PL.po pyfpdb/locale/fpdb-pt_BR.po pyfpdb/locale/fpdb-ru_RU.po pyfpdb/locale/fpdb-zh_CN.po pyfpdb/locale/fr/LC_MESSAGES/fpdb.mo pyfpdb/locale/hu/LC_MESSAGES/fpdb.mo pyfpdb/locale/it/LC_MESSAGES/fpdb.mo pyfpdb/locale/pl/LC_MESSAGES/fpdb.mo pyfpdb/locale/pt/LC_MESSAGES/fpdb.mo pyfpdb/locale/ru/LC_MESSAGES/fpdb.mo pyfpdb/locale/zh/LC_MESSAGES/fpdb.mo
This commit is contained in:
commit
28dead2905
|
@ -321,11 +321,7 @@ class Absolute(HandHistoryConverter):
|
||||||
hand.involved = False
|
hand.involved = False
|
||||||
|
|
||||||
def readStudPlayerCards(self, hand, street):
|
def readStudPlayerCards(self, hand, street):
|
||||||
# lol. see Plymouth.txt
|
logging.warning(_("%s cannot read all stud/razz hands yet.") % hand.sitename)
|
||||||
logging.warning(_("Absolute readStudPlayerCards is only a stub."))
|
|
||||||
#~ if street in ('THIRD', 'FOURTH', 'FIFTH', 'SIXTH'):
|
|
||||||
#~ hand.addPlayerCards(player = player.group('PNAME'), street = street, closed = [], open = [])
|
|
||||||
|
|
||||||
|
|
||||||
def readAction(self, hand, street):
|
def readAction(self, hand, street):
|
||||||
logging.debug("readAction (%s)" % street)
|
logging.debug("readAction (%s)" % street)
|
||||||
|
@ -349,7 +345,7 @@ class Absolute(HandHistoryConverter):
|
||||||
bet = action.group('BET').replace(',', '')
|
bet = action.group('BET').replace(',', '')
|
||||||
hand.addComplete( street, action.group('PNAME'), bet)
|
hand.addComplete( street, action.group('PNAME'), bet)
|
||||||
else:
|
else:
|
||||||
logging.debug(_("Unimplemented readAction: '%s' '%s'") % (action.group('PNAME'), action.group('ATYPE')))
|
logging.debug(_("Unimplemented %s: '%s' '%s'") % ("readAction", action.group('PNAME'), action.group('ATYPE')))
|
||||||
|
|
||||||
|
|
||||||
def readShowdownActions(self, hand):
|
def readShowdownActions(self, hand):
|
||||||
|
|
|
@ -196,7 +196,7 @@ class Betfair(HandHistoryConverter):
|
||||||
elif action.group('ATYPE') == 'checks':
|
elif action.group('ATYPE') == 'checks':
|
||||||
hand.addCheck( street, action.group('PNAME'))
|
hand.addCheck( street, action.group('PNAME'))
|
||||||
else:
|
else:
|
||||||
sys.stderr.write(_("DEBUG: ") + _("Unimplemented readAction: '%s' '%s'") % (action.group('PNAME'), action.group('ATYPE')))
|
sys.stderr.write(_("DEBUG:") + " " + _("Unimplemented %s: '%s' '%s'") % ("readAction", action.group('PNAME'), action.group('ATYPE')))
|
||||||
|
|
||||||
|
|
||||||
def readShowdownActions(self, hand):
|
def readShowdownActions(self, hand):
|
||||||
|
|
|
@ -264,7 +264,7 @@ or None if we fail to get the info """
|
||||||
elif action.group('ATYPE') == 'ALL_IN':
|
elif action.group('ATYPE') == 'ALL_IN':
|
||||||
hand.addAllIn(street, player, action.group('BET'))
|
hand.addAllIn(street, player, action.group('BET'))
|
||||||
else:
|
else:
|
||||||
logging.debug(_("Unimplemented readAction: '%s' '%s'") % (action.group('PSEAT'), action.group('ATYPE')))
|
logging.debug(_("Unimplemented %s: '%s' '%s'") % ("readAction", action.group('PSEAT'), action.group('ATYPE')))
|
||||||
|
|
||||||
def readShowdownActions(self, hand):
|
def readShowdownActions(self, hand):
|
||||||
for shows in self.re_ShowdownAction.finditer(hand.handText):
|
for shows in self.re_ShowdownAction.finditer(hand.handText):
|
||||||
|
|
|
@ -40,10 +40,10 @@ def to_utf8(s):
|
||||||
_out = unicode(s, Configuration.LOCALE_ENCODING).encode('utf-8')
|
_out = unicode(s, Configuration.LOCALE_ENCODING).encode('utf-8')
|
||||||
return _out
|
return _out
|
||||||
except UnicodeDecodeError:
|
except UnicodeDecodeError:
|
||||||
sys.stderr.write(_('Could not convert: "%s"\n') % s)
|
sys.stderr.write(_('Could not convert: "%s"') % (s+"\n"))
|
||||||
raise
|
raise
|
||||||
except UnicodeEncodeError:
|
except UnicodeEncodeError:
|
||||||
sys.stderr.write(_('Could not encode: "%s"\n') % s)
|
sys.stderr.write(_('Could not encode: "%s"') % (s+"\n"))
|
||||||
raise
|
raise
|
||||||
except TypeError: # TypeError is raised when we give unicode() an already encoded string
|
except TypeError: # TypeError is raised when we give unicode() an already encoded string
|
||||||
return s
|
return s
|
||||||
|
@ -55,10 +55,10 @@ def to_db_utf8(s):
|
||||||
(_out, _len) = encoder_to_utf.encode(unicode(s))
|
(_out, _len) = encoder_to_utf.encode(unicode(s))
|
||||||
return _out
|
return _out
|
||||||
except UnicodeDecodeError:
|
except UnicodeDecodeError:
|
||||||
sys.stderr.write(_('Could not convert: "%s"\n') % s)
|
sys.stderr.write(_('Could not convert: "%s"') % (s+"\n"))
|
||||||
raise
|
raise
|
||||||
except UnicodeEncodeError:
|
except UnicodeEncodeError:
|
||||||
sys.stderr.write(_('Could not encode: "%s"\n') % s)
|
sys.stderr.write(_('Could not encode: "%s"') % (s+"\n"))
|
||||||
raise
|
raise
|
||||||
|
|
||||||
def to_gui(s):
|
def to_gui(s):
|
||||||
|
@ -70,8 +70,8 @@ def to_gui(s):
|
||||||
(_out, _len) = encoder_to_sys.encode(s, 'replace')
|
(_out, _len) = encoder_to_sys.encode(s, 'replace')
|
||||||
return _out
|
return _out
|
||||||
except UnicodeDecodeError:
|
except UnicodeDecodeError:
|
||||||
sys.stderr.write(_('Could not convert: "%s"\n') % s)
|
sys.stderr.write(_('Could not convert: "%s"') % (s+"\n"))
|
||||||
raise
|
raise
|
||||||
except UnicodeEncodeError:
|
except UnicodeEncodeError:
|
||||||
sys.stderr.write(_('Could not encode: "%s"\n') % s)
|
sys.stderr.write(_('Could not encode: "%s"') % (s+"\n"))
|
||||||
raise
|
raise
|
||||||
|
|
|
@ -114,14 +114,14 @@ def get_config(file_name, fallback = True):
|
||||||
try:
|
try:
|
||||||
shutil.copyfile(example_path, config_path)
|
shutil.copyfile(example_path, config_path)
|
||||||
example_copy = True
|
example_copy = True
|
||||||
msg = _("Config file has been created at %s.\n") % config_path
|
msg = _("Config file has been created at %s.") % (config_path+"\n")
|
||||||
logging.info(msg)
|
logging.info(msg)
|
||||||
except IOError:
|
except IOError:
|
||||||
try:
|
try:
|
||||||
example_path = file_name + '.example'
|
example_path = file_name + '.example'
|
||||||
shutil.copyfile(example_path, config_path)
|
shutil.copyfile(example_path, config_path)
|
||||||
example_copy = True
|
example_copy = True
|
||||||
msg = _("Config file has been created at %s.\n") % config_path
|
msg = _("Config file has been created at %s.") % (config_path+"\n")
|
||||||
logging.info(msg)
|
logging.info(msg)
|
||||||
except IOError:
|
except IOError:
|
||||||
pass
|
pass
|
||||||
|
@ -135,18 +135,18 @@ def get_config(file_name, fallback = True):
|
||||||
if not config_found and fallback:
|
if not config_found and fallback:
|
||||||
shutil.copyfile(example_path, config_path)
|
shutil.copyfile(example_path, config_path)
|
||||||
example_copy = True
|
example_copy = True
|
||||||
msg = _("No %s found\n in %s\n or %s\n") % (file_name, exec_dir, default_dir) \
|
msg = _("No %s found\n in %s\n or %s") % (file_name, exec_dir, default_dir) \
|
||||||
+ _("Config file has been created at %s.\n") % config_path
|
+ " " + _("Config file has been created at %s.") % (config_path+"\n")
|
||||||
print msg
|
print msg
|
||||||
logging.info(msg)
|
logging.info(msg)
|
||||||
except:
|
except:
|
||||||
print _("Error copying .example config file, cannot fall back. Exiting.\n")
|
print _("Error copying .example config file, cannot fall back. Exiting."), "\n"
|
||||||
sys.stderr.write(_("Error copying .example config file, cannot fall back. Exiting.\n"))
|
sys.stderr.write(_("Error copying .example config file, cannot fall back. Exiting.")+"\n")
|
||||||
sys.stderr.write( str(sys.exc_info()) )
|
sys.stderr.write( str(sys.exc_info()) )
|
||||||
sys.exit()
|
sys.exit()
|
||||||
elif fallback:
|
elif fallback:
|
||||||
print _("No %s found, cannot fall back. Exiting.\n") % file_name
|
print _("No %s found, cannot fall back. Exiting.") % file_name, "\n"
|
||||||
sys.stderr.write(_("No %s found, cannot fall back. Exiting.\n") % file_name)
|
sys.stderr.write((_("No %s found, cannot fall back. Exiting.") % file_name) + "\n")
|
||||||
sys.exit()
|
sys.exit()
|
||||||
|
|
||||||
#print "get_config: returning "+str( (config_path,example_copy,example_path) )
|
#print "get_config: returning "+str( (config_path,example_copy,example_path) )
|
||||||
|
@ -215,8 +215,9 @@ DATABASE_TYPES = (
|
||||||
|
|
||||||
LOCALE_ENCODING = locale.getpreferredencoding()
|
LOCALE_ENCODING = locale.getpreferredencoding()
|
||||||
if LOCALE_ENCODING in ("US-ASCII", "", None):
|
if LOCALE_ENCODING in ("US-ASCII", "", None):
|
||||||
print _("Default encoding set to US-ASCII, defaulting to CP1252 instead -- If you're not on a Mac, please report this problem.")
|
|
||||||
LOCALE_ENCODING = "cp1252"
|
LOCALE_ENCODING = "cp1252"
|
||||||
|
if (os.uname()[0]!="Darwin"):
|
||||||
|
print _("Default encoding set to US-ASCII, defaulting to CP1252 instead."), _("Please report this problem.")
|
||||||
|
|
||||||
|
|
||||||
# needs LOCALE_ENCODING (above), imported for sqlite setup in Config class below
|
# needs LOCALE_ENCODING (above), imported for sqlite setup in Config class below
|
||||||
|
@ -995,6 +996,12 @@ class Config:
|
||||||
location_node.setAttribute("y", str( locations[i-1][1] ))
|
location_node.setAttribute("y", str( locations[i-1][1] ))
|
||||||
self.supported_sites[site_name].layout[max].location[i] = ( locations[i-1][0], locations[i-1][1] )
|
self.supported_sites[site_name].layout[max].location[i] = ( locations[i-1][0], locations[i-1][1] )
|
||||||
|
|
||||||
|
def edit_site(self, site_name, enabled, screen_name, history_path):
|
||||||
|
site_node = self.get_site_node(site_name)
|
||||||
|
site_node.setAttribute("enabled", enabled)
|
||||||
|
site_node.setAttribute("screen_name", screen_name)
|
||||||
|
site_node.setAttribute("HH_path", history_path)
|
||||||
|
|
||||||
def editStats(self, gameName, statArray):
|
def editStats(self, gameName, statArray):
|
||||||
"""replaces stat selection for the given gameName with the given statArray"""
|
"""replaces stat selection for the given gameName with the given statArray"""
|
||||||
gameNode = self.getGameNode(gameName)
|
gameNode = self.getGameNode(gameName)
|
||||||
|
@ -1035,7 +1042,7 @@ class Config:
|
||||||
newStat.setAttribute("tip", "tip1")
|
newStat.setAttribute("tip", "tip1")
|
||||||
|
|
||||||
gameNode.appendChild(newStat)
|
gameNode.appendChild(newStat)
|
||||||
statNodes = gameNode.getElementsByTagName("stat")
|
statNodes = gameNode.getElementsByTagName("stat") #TODO remove this line?
|
||||||
#end def editStats
|
#end def editStats
|
||||||
|
|
||||||
def edit_aux_layout(self, aux_name, max, width = None, height = None, locations = None):
|
def edit_aux_layout(self, aux_name, max, width = None, height = None, locations = None):
|
||||||
|
|
147
pyfpdb/Database.py
Normal file → Executable file
147
pyfpdb/Database.py
Normal file → Executable file
|
@ -503,9 +503,9 @@ class Database:
|
||||||
self.check_version(database=database, create=create)
|
self.check_version(database=database, create=create)
|
||||||
|
|
||||||
def get_sites(self):
|
def get_sites(self):
|
||||||
self.cursor.execute("SELECT name,id FROM Sites")
|
self.cursor.execute("SELECT name,id FROM Sites")
|
||||||
sites = self.cursor.fetchall()
|
sites = self.cursor.fetchall()
|
||||||
self.config.set_site_ids(sites)
|
self.config.set_site_ids(sites)
|
||||||
|
|
||||||
def add_site(self, site, site_code):
|
def add_site(self, site, site_code):
|
||||||
self.cursor.execute("INSERT INTO Sites "
|
self.cursor.execute("INSERT INTO Sites "
|
||||||
|
@ -765,7 +765,7 @@ class Database:
|
||||||
if row and row[0]:
|
if row and row[0]:
|
||||||
self.date_nhands_ago[str(playerid)] = row[0]
|
self.date_nhands_ago[str(playerid)] = row[0]
|
||||||
c.close()
|
c.close()
|
||||||
print _("Database: date n hands ago = ") + self.date_nhands_ago[str(playerid)] + "(playerid "+str(playerid)+")"
|
print _("Database: n hands ago the date was:") + " " + self.date_nhands_ago[str(playerid)] + " (playerid "+str(playerid)+")"
|
||||||
except:
|
except:
|
||||||
err = traceback.extract_tb(sys.exc_info()[2])[-1]
|
err = traceback.extract_tb(sys.exc_info()[2])[-1]
|
||||||
print _("*** Database Error: ")+err[2]+"("+str(err[1])+"): "+str(sys.exc_info()[1])
|
print _("*** Database Error: ")+err[2]+"("+str(err[1])+"): "+str(sys.exc_info()[1])
|
||||||
|
@ -1070,14 +1070,15 @@ class Database:
|
||||||
cons = c.fetchone()
|
cons = c.fetchone()
|
||||||
#print "preparebulk find fk: cons=", cons
|
#print "preparebulk find fk: cons=", cons
|
||||||
if cons:
|
if cons:
|
||||||
print "dropping mysql fk", cons[0], fk['fktab'], fk['fkcol']
|
print _("Dropping foreign key:"), cons[0], fk['fktab'], fk['fkcol']
|
||||||
try:
|
try:
|
||||||
c.execute("alter table " + fk['fktab'] + " drop foreign key " + cons[0])
|
c.execute("alter table " + fk['fktab'] + " drop foreign key " + cons[0])
|
||||||
except:
|
except:
|
||||||
print " drop failed: " + str(sys.exc_info())
|
print _("Warning:"), _("Drop foreign key %s_%s_fkey failed: %s, continuing ...") \
|
||||||
|
% (fk['fktab'], fk['fkcol'], str(sys.exc_value).rstrip('\n') )
|
||||||
elif self.backend == self.PGSQL:
|
elif self.backend == self.PGSQL:
|
||||||
# DON'T FORGET TO RECREATE THEM!!
|
# DON'T FORGET TO RECREATE THEM!!
|
||||||
print "dropping pg fk", fk['fktab'], fk['fkcol']
|
print _("Dropping foreign key:"), fk['fktab'], fk['fkcol']
|
||||||
try:
|
try:
|
||||||
# try to lock table to see if index drop will work:
|
# try to lock table to see if index drop will work:
|
||||||
# hmmm, tested by commenting out rollback in grapher. lock seems to work but
|
# hmmm, tested by commenting out rollback in grapher. lock seems to work but
|
||||||
|
@ -1089,14 +1090,14 @@ class Database:
|
||||||
#print "alter table %s drop constraint %s_%s_fkey" % (fk['fktab'], fk['fktab'], fk['fkcol'])
|
#print "alter table %s drop constraint %s_%s_fkey" % (fk['fktab'], fk['fktab'], fk['fkcol'])
|
||||||
try:
|
try:
|
||||||
c.execute("alter table %s drop constraint %s_%s_fkey" % (fk['fktab'], fk['fktab'], fk['fkcol']))
|
c.execute("alter table %s drop constraint %s_%s_fkey" % (fk['fktab'], fk['fktab'], fk['fkcol']))
|
||||||
print "dropped pg fk pg fk %s_%s_fkey, continuing ..." % (fk['fktab'], fk['fkcol'])
|
print _("dropped foreign key %s_%s_fkey, continuing ...") % (fk['fktab'], fk['fkcol'])
|
||||||
except:
|
except:
|
||||||
if "does not exist" not in str(sys.exc_value):
|
if "does not exist" not in str(sys.exc_value):
|
||||||
print _("warning: drop pg fk %s_%s_fkey failed: %s, continuing ...") \
|
print _("Warning:"), _("Drop foreign key %s_%s_fkey failed: %s, continuing ...") \
|
||||||
% (fk['fktab'], fk['fkcol'], str(sys.exc_value).rstrip('\n') )
|
% (fk['fktab'], fk['fkcol'], str(sys.exc_value).rstrip('\n') )
|
||||||
c.execute("END TRANSACTION")
|
c.execute("END TRANSACTION")
|
||||||
except:
|
except:
|
||||||
print _("warning: constraint %s_%s_fkey not dropped: %s, continuing ...") \
|
print _("Warning:"), _("constraint %s_%s_fkey not dropped: %s, continuing ...") \
|
||||||
% (fk['fktab'],fk['fkcol'], str(sys.exc_value).rstrip('\n'))
|
% (fk['fktab'],fk['fkcol'], str(sys.exc_value).rstrip('\n'))
|
||||||
else:
|
else:
|
||||||
return -1
|
return -1
|
||||||
|
@ -1104,18 +1105,18 @@ class Database:
|
||||||
for idx in self.indexes[self.backend]:
|
for idx in self.indexes[self.backend]:
|
||||||
if idx['drop'] == 1:
|
if idx['drop'] == 1:
|
||||||
if self.backend == self.MYSQL_INNODB:
|
if self.backend == self.MYSQL_INNODB:
|
||||||
print _("dropping mysql index "), idx['tab'], idx['col']
|
print _("Dropping index:"), idx['tab'], idx['col']
|
||||||
try:
|
try:
|
||||||
# apparently nowait is not implemented in mysql so this just hangs if there are locks
|
# apparently nowait is not implemented in mysql so this just hangs if there are locks
|
||||||
# preventing the index drop :-(
|
# preventing the index drop :-(
|
||||||
c.execute( "alter table %s drop index %s;", (idx['tab'],idx['col']) )
|
c.execute( "alter table %s drop index %s;", (idx['tab'],idx['col']) )
|
||||||
except:
|
except:
|
||||||
print _(" drop index failed: ") + str(sys.exc_info())
|
print _("Drop index failed:"), str(sys.exc_info())
|
||||||
# ALTER TABLE `fpdb`.`handsplayers` DROP INDEX `playerId`;
|
# ALTER TABLE `fpdb`.`handsplayers` DROP INDEX `playerId`;
|
||||||
# using: 'HandsPlayers' drop index 'playerId'
|
# using: 'HandsPlayers' drop index 'playerId'
|
||||||
elif self.backend == self.PGSQL:
|
elif self.backend == self.PGSQL:
|
||||||
# DON'T FORGET TO RECREATE THEM!!
|
# DON'T FORGET TO RECREATE THEM!!
|
||||||
print _("dropping pg index "), idx['tab'], idx['col']
|
print _("Dropping index:"), idx['tab'], idx['col']
|
||||||
try:
|
try:
|
||||||
# try to lock table to see if index drop will work:
|
# try to lock table to see if index drop will work:
|
||||||
c.execute("BEGIN TRANSACTION")
|
c.execute("BEGIN TRANSACTION")
|
||||||
|
@ -1128,11 +1129,11 @@ class Database:
|
||||||
#print "dropped pg index ", idx['tab'], idx['col']
|
#print "dropped pg index ", idx['tab'], idx['col']
|
||||||
except:
|
except:
|
||||||
if "does not exist" not in str(sys.exc_value):
|
if "does not exist" not in str(sys.exc_value):
|
||||||
print _("warning: drop index %s_%s_idx failed: %s, continuing ...") \
|
print _("Warning:"), _("drop index %s_%s_idx failed: %s, continuing ...") \
|
||||||
% (idx['tab'],idx['col'], str(sys.exc_value).rstrip('\n'))
|
% (idx['tab'],idx['col'], str(sys.exc_value).rstrip('\n'))
|
||||||
c.execute("END TRANSACTION")
|
c.execute("END TRANSACTION")
|
||||||
except:
|
except:
|
||||||
print _("warning: index %s_%s_idx not dropped %s, continuing ...") \
|
print _("Warning:"), _("index %s_%s_idx not dropped: %s, continuing ...") \
|
||||||
% (idx['tab'],idx['col'], str(sys.exc_value).rstrip('\n'))
|
% (idx['tab'],idx['col'], str(sys.exc_value).rstrip('\n'))
|
||||||
else:
|
else:
|
||||||
return -1
|
return -1
|
||||||
|
@ -1172,43 +1173,43 @@ class Database:
|
||||||
if cons:
|
if cons:
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
print _("Creating foreign key "), fk['fktab'], fk['fkcol'], "->", fk['rtab'], fk['rcol']
|
print _("Creating foreign key:"), fk['fktab'], fk['fkcol'], "->", fk['rtab'], fk['rcol']
|
||||||
try:
|
try:
|
||||||
c.execute("alter table " + fk['fktab'] + " add foreign key ("
|
c.execute("alter table " + fk['fktab'] + " add foreign key ("
|
||||||
+ fk['fkcol'] + ") references " + fk['rtab'] + "("
|
+ fk['fkcol'] + ") references " + fk['rtab'] + "("
|
||||||
+ fk['rcol'] + ")")
|
+ fk['rcol'] + ")")
|
||||||
except:
|
except:
|
||||||
print _("Create foreign key failed: ") + str(sys.exc_info())
|
print _("Create foreign key failed:"), str(sys.exc_info())
|
||||||
elif self.backend == self.PGSQL:
|
elif self.backend == self.PGSQL:
|
||||||
print _("Creating foreign key "), fk['fktab'], fk['fkcol'], "->", fk['rtab'], fk['rcol']
|
print _("Creating foreign key:"), fk['fktab'], fk['fkcol'], "->", fk['rtab'], fk['rcol']
|
||||||
try:
|
try:
|
||||||
c.execute("alter table " + fk['fktab'] + " add constraint "
|
c.execute("alter table " + fk['fktab'] + " add constraint "
|
||||||
+ fk['fktab'] + '_' + fk['fkcol'] + '_fkey'
|
+ fk['fktab'] + '_' + fk['fkcol'] + '_fkey'
|
||||||
+ " foreign key (" + fk['fkcol']
|
+ " foreign key (" + fk['fkcol']
|
||||||
+ ") references " + fk['rtab'] + "(" + fk['rcol'] + ")")
|
+ ") references " + fk['rtab'] + "(" + fk['rcol'] + ")")
|
||||||
except:
|
except:
|
||||||
print _("Create foreign key failed: ") + str(sys.exc_info())
|
print _("Create foreign key failed:"), str(sys.exc_info())
|
||||||
else:
|
else:
|
||||||
return -1
|
return -1
|
||||||
|
|
||||||
for idx in self.indexes[self.backend]:
|
for idx in self.indexes[self.backend]:
|
||||||
if idx['drop'] == 1:
|
if idx['drop'] == 1:
|
||||||
if self.backend == self.MYSQL_INNODB:
|
if self.backend == self.MYSQL_INNODB:
|
||||||
print _("Creating MySQL index %s %s") % (idx['tab'], idx['col'])
|
print _("Creating index %s %s") % (idx['tab'], idx['col'])
|
||||||
try:
|
try:
|
||||||
s = "alter table %s add index %s(%s)" % (idx['tab'],idx['col'],idx['col'])
|
s = "alter table %s add index %s(%s)" % (idx['tab'],idx['col'],idx['col'])
|
||||||
c.execute(s)
|
c.execute(s)
|
||||||
except:
|
except:
|
||||||
print _("Create foreign key failed: ") + str(sys.exc_info())
|
print _("Create foreign key failed:"), str(sys.exc_info())
|
||||||
elif self.backend == self.PGSQL:
|
elif self.backend == self.PGSQL:
|
||||||
# pass
|
# pass
|
||||||
# mod to use tab_col for index name?
|
# mod to use tab_col for index name?
|
||||||
print _("Creating PostgreSQL index "), idx['tab'], idx['col']
|
print _("Creating index %s %s") % (idx['tab'], idx['col'])
|
||||||
try:
|
try:
|
||||||
s = "create index %s_%s_idx on %s(%s)" % (idx['tab'], idx['col'], idx['tab'], idx['col'])
|
s = "create index %s_%s_idx on %s(%s)" % (idx['tab'], idx['col'], idx['tab'], idx['col'])
|
||||||
c.execute(s)
|
c.execute(s)
|
||||||
except:
|
except:
|
||||||
print _("Create index failed: ") + str(sys.exc_info())
|
print _("Create index failed:"), str(sys.exc_info())
|
||||||
else:
|
else:
|
||||||
return -1
|
return -1
|
||||||
|
|
||||||
|
@ -1299,7 +1300,7 @@ class Database:
|
||||||
except:
|
except:
|
||||||
#print "Error creating tables: ", str(sys.exc_value)
|
#print "Error creating tables: ", str(sys.exc_value)
|
||||||
err = traceback.extract_tb(sys.exc_info()[2])[-1]
|
err = traceback.extract_tb(sys.exc_info()[2])[-1]
|
||||||
print _("***Error creating tables: ")+err[2]+"("+str(err[1])+"): "+str(sys.exc_info()[1])
|
print _("***Error creating tables:"), err[2]+"("+str(err[1])+"): "+str(sys.exc_info()[1])
|
||||||
self.rollback()
|
self.rollback()
|
||||||
raise
|
raise
|
||||||
#end def disconnect
|
#end def disconnect
|
||||||
|
@ -1321,7 +1322,7 @@ class Database:
|
||||||
c.execute(self.sql.query['drop_table'] + table[0])
|
c.execute(self.sql.query['drop_table'] + table[0])
|
||||||
except:
|
except:
|
||||||
err = traceback.extract_tb(sys.exc_info()[2])[-1]
|
err = traceback.extract_tb(sys.exc_info()[2])[-1]
|
||||||
print _("***Error dropping tables: ")+err[2]+"("+str(err[1])+"): "+str(sys.exc_info()[1])
|
print _("***Error dropping tables:"), +err[2]+"("+str(err[1])+"): "+str(sys.exc_info()[1])
|
||||||
self.rollback()
|
self.rollback()
|
||||||
elif backend == 'PostgreSQL':
|
elif backend == 'PostgreSQL':
|
||||||
try:
|
try:
|
||||||
|
@ -1332,7 +1333,7 @@ class Database:
|
||||||
c.execute(self.sql.query['drop_table'] + table[0] + ' cascade')
|
c.execute(self.sql.query['drop_table'] + table[0] + ' cascade')
|
||||||
except:
|
except:
|
||||||
err = traceback.extract_tb(sys.exc_info()[2])[-1]
|
err = traceback.extract_tb(sys.exc_info()[2])[-1]
|
||||||
print _("***Error dropping tables: ")+err[2]+"("+str(err[1])+"): "+str(sys.exc_info()[1])
|
print _("***Error dropping tables:"), err[2]+"("+str(err[1])+"): "+str(sys.exc_info()[1])
|
||||||
self.rollback()
|
self.rollback()
|
||||||
elif backend == 'SQLite':
|
elif backend == 'SQLite':
|
||||||
try:
|
try:
|
||||||
|
@ -1342,14 +1343,14 @@ class Database:
|
||||||
c.execute(self.sql.query['drop_table'] + table[0])
|
c.execute(self.sql.query['drop_table'] + table[0])
|
||||||
except:
|
except:
|
||||||
err = traceback.extract_tb(sys.exc_info()[2])[-1]
|
err = traceback.extract_tb(sys.exc_info()[2])[-1]
|
||||||
print _("***Error dropping tables: ")+err[2]+"("+str(err[1])+"): "+str(sys.exc_info()[1])
|
print _("***Error dropping tables:"), err[2]+"("+str(err[1])+"): "+str(sys.exc_info()[1])
|
||||||
self.rollback()
|
self.rollback()
|
||||||
try:
|
try:
|
||||||
self.commit()
|
self.commit()
|
||||||
except:
|
except:
|
||||||
print _("*** Error in committing table drop")
|
print _("*** Error in committing table drop")
|
||||||
err = traceback.extract_tb(sys.exc_info()[2])[-1]
|
err = traceback.extract_tb(sys.exc_info()[2])[-1]
|
||||||
print _("***Error dropping tables: ")+err[2]+"("+str(err[1])+"): "+str(sys.exc_info()[1])
|
print _("***Error dropping tables:"), err[2]+"("+str(err[1])+"): "+str(sys.exc_info()[1])
|
||||||
self.rollback()
|
self.rollback()
|
||||||
#end def drop_tables
|
#end def drop_tables
|
||||||
|
|
||||||
|
@ -1361,38 +1362,37 @@ class Database:
|
||||||
self.connection.set_isolation_level(0) # allow table/index operations to work
|
self.connection.set_isolation_level(0) # allow table/index operations to work
|
||||||
for idx in self.indexes[self.backend]:
|
for idx in self.indexes[self.backend]:
|
||||||
if self.backend == self.MYSQL_INNODB:
|
if self.backend == self.MYSQL_INNODB:
|
||||||
print _("Creating mysql index %s %s") %(idx['tab'], idx['col'])
|
print _("Creating index %s %s") %(idx['tab'], idx['col'])
|
||||||
log.debug(_("Creating mysql index %s %s") %(idx['tab'], idx['col']))
|
log.debug(_("Creating index %s %s") %(idx['tab'], idx['col']))
|
||||||
try:
|
try:
|
||||||
s = "create index %s on %s(%s)" % (idx['col'],idx['tab'],idx['col'])
|
s = "create index %s on %s(%s)" % (idx['col'],idx['tab'],idx['col'])
|
||||||
self.get_cursor().execute(s)
|
self.get_cursor().execute(s)
|
||||||
except:
|
except:
|
||||||
print _("Create index failed: ") + str(sys.exc_info())
|
print _("Create index failed:"), str(sys.exc_info())
|
||||||
elif self.backend == self.PGSQL:
|
elif self.backend == self.PGSQL:
|
||||||
# mod to use tab_col for index name?
|
# mod to use tab_col for index name?
|
||||||
print _("Creating pgsql index %s %s") %(idx['tab'], idx['col'])
|
print _("Creating index %s %s") %(idx['tab'], idx['col'])
|
||||||
log.debug(_("Creating pgsql index %s %s") %(idx['tab'], idx['col']))
|
log.debug(_("Creating index %s %s") %(idx['tab'], idx['col']))
|
||||||
try:
|
try:
|
||||||
s = "create index %s_%s_idx on %s(%s)" % (idx['tab'], idx['col'], idx['tab'], idx['col'])
|
s = "create index %s_%s_idx on %s(%s)" % (idx['tab'], idx['col'], idx['tab'], idx['col'])
|
||||||
self.get_cursor().execute(s)
|
self.get_cursor().execute(s)
|
||||||
except:
|
except:
|
||||||
print _("Create index failed: ") + str(sys.exc_info())
|
print _("Create index failed:"), str(sys.exc_info())
|
||||||
elif self.backend == self.SQLITE:
|
elif self.backend == self.SQLITE:
|
||||||
print _("Creating sqlite index %s %s") %(idx['tab'], idx['col'])
|
print _("Creating index %s %s") %(idx['tab'], idx['col'])
|
||||||
log.debug(_("Creating sqlite index %s %s") %(idx['tab'], idx['col']))
|
log.debug(_("Creating index %s %s") %(idx['tab'], idx['col']))
|
||||||
try:
|
try:
|
||||||
s = "create index %s_%s_idx on %s(%s)" % (idx['tab'], idx['col'], idx['tab'], idx['col'])
|
s = "create index %s_%s_idx on %s(%s)" % (idx['tab'], idx['col'], idx['tab'], idx['col'])
|
||||||
self.get_cursor().execute(s)
|
self.get_cursor().execute(s)
|
||||||
except:
|
except:
|
||||||
log.debug(_("Create index failed: ") + str(sys.exc_info()))
|
log.debug(_("Create index failed:"), str(sys.exc_info()))
|
||||||
else:
|
else:
|
||||||
print _("Unknown database: MySQL, Postgres and SQLite supported")
|
|
||||||
return -1
|
return -1
|
||||||
if self.backend == self.PGSQL:
|
if self.backend == self.PGSQL:
|
||||||
self.connection.set_isolation_level(1) # go back to normal isolation level
|
self.connection.set_isolation_level(1) # go back to normal isolation level
|
||||||
except:
|
except:
|
||||||
print _("Error creating indexes: ") + str(sys.exc_value)
|
print _("Error creating indexes:"), str(sys.exc_value)
|
||||||
raise FpdbError("Error creating indexes: " + str(sys.exc_value) )
|
raise FpdbError("Error creating indexes:" + " " + str(sys.exc_value) )
|
||||||
#end def createAllIndexes
|
#end def createAllIndexes
|
||||||
|
|
||||||
def dropAllIndexes(self):
|
def dropAllIndexes(self):
|
||||||
|
@ -1403,29 +1403,28 @@ class Database:
|
||||||
self.connection.set_isolation_level(0) # allow table/index operations to work
|
self.connection.set_isolation_level(0) # allow table/index operations to work
|
||||||
for idx in self.indexes[self.backend]:
|
for idx in self.indexes[self.backend]:
|
||||||
if self.backend == self.MYSQL_INNODB:
|
if self.backend == self.MYSQL_INNODB:
|
||||||
print _("dropping mysql index "), idx['tab'], idx['col']
|
print (_("Dropping index:"), idx['tab'], idx['col'])
|
||||||
try:
|
try:
|
||||||
self.get_cursor().execute( "alter table %s drop index %s"
|
self.get_cursor().execute( "alter table %s drop index %s"
|
||||||
, (idx['tab'], idx['col']) )
|
, (idx['tab'], idx['col']) )
|
||||||
except:
|
except:
|
||||||
print _(" drop index failed: ") + str(sys.exc_info())
|
print _("Drop index failed:"), str(sys.exc_info())
|
||||||
elif self.backend == self.PGSQL:
|
elif self.backend == self.PGSQL:
|
||||||
print _("dropping pg index "), idx['tab'], idx['col']
|
print (_("Dropping index:"), idx['tab'], idx['col'])
|
||||||
# mod to use tab_col for index name?
|
# mod to use tab_col for index name?
|
||||||
try:
|
try:
|
||||||
self.get_cursor().execute( "drop index %s_%s_idx"
|
self.get_cursor().execute( "drop index %s_%s_idx"
|
||||||
% (idx['tab'],idx['col']) )
|
% (idx['tab'],idx['col']) )
|
||||||
except:
|
except:
|
||||||
print _(" drop index failed: ") + str(sys.exc_info())
|
print (_("Drop index failed:"), str(sys.exc_info()))
|
||||||
elif self.backend == self.SQLITE:
|
elif self.backend == self.SQLITE:
|
||||||
print _("Dropping sqlite index "), idx['tab'], idx['col']
|
print (_("Dropping index:"), idx['tab'], idx['col'])
|
||||||
try:
|
try:
|
||||||
self.get_cursor().execute( "drop index %s_%s_idx"
|
self.get_cursor().execute( "drop index %s_%s_idx"
|
||||||
% (idx['tab'],idx['col']) )
|
% (idx['tab'],idx['col']) )
|
||||||
except:
|
except:
|
||||||
print _(" drop index failed: ") + str(sys.exc_info())
|
print _("Drop index failed:"), str(sys.exc_info())
|
||||||
else:
|
else:
|
||||||
print _("Fpdb only supports MySQL, Postgres and SQLITE, what are you trying to use?")
|
|
||||||
return -1
|
return -1
|
||||||
if self.backend == self.PGSQL:
|
if self.backend == self.PGSQL:
|
||||||
self.connection.set_isolation_level(1) # go back to normal isolation level
|
self.connection.set_isolation_level(1) # go back to normal isolation level
|
||||||
|
@ -1439,7 +1438,7 @@ class Database:
|
||||||
self.connection.set_isolation_level(0) # allow table/index operations to work
|
self.connection.set_isolation_level(0) # allow table/index operations to work
|
||||||
c = self.get_cursor()
|
c = self.get_cursor()
|
||||||
except:
|
except:
|
||||||
print _(" set_isolation_level failed: ") + str(sys.exc_info())
|
print _("set_isolation_level failed:"), str(sys.exc_info())
|
||||||
|
|
||||||
for fk in self.foreignKeys[self.backend]:
|
for fk in self.foreignKeys[self.backend]:
|
||||||
if self.backend == self.MYSQL_INNODB:
|
if self.backend == self.MYSQL_INNODB:
|
||||||
|
@ -1456,30 +1455,30 @@ class Database:
|
||||||
if cons:
|
if cons:
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
print _("Creating foreign key "), fk['fktab'], fk['fkcol'], "->", fk['rtab'], fk['rcol']
|
print _("Creating foreign key:"), fk['fktab'], fk['fkcol'], "->", fk['rtab'], fk['rcol']
|
||||||
try:
|
try:
|
||||||
c.execute("alter table " + fk['fktab'] + " add foreign key ("
|
c.execute("alter table " + fk['fktab'] + " add foreign key ("
|
||||||
+ fk['fkcol'] + ") references " + fk['rtab'] + "("
|
+ fk['fkcol'] + ") references " + fk['rtab'] + "("
|
||||||
+ fk['rcol'] + ")")
|
+ fk['rcol'] + ")")
|
||||||
except:
|
except:
|
||||||
print _("Create foreign key failed: ") + str(sys.exc_info())
|
print _("Create foreign key failed:"), str(sys.exc_info())
|
||||||
elif self.backend == self.PGSQL:
|
elif self.backend == self.PGSQL:
|
||||||
print _("Creating foreign key "), fk['fktab'], fk['fkcol'], "->", fk['rtab'], fk['rcol']
|
print _("Creating foreign key:"), fk['fktab'], fk['fkcol'], "->", fk['rtab'], fk['rcol']
|
||||||
try:
|
try:
|
||||||
c.execute("alter table " + fk['fktab'] + " add constraint "
|
c.execute("alter table " + fk['fktab'] + " add constraint "
|
||||||
+ fk['fktab'] + '_' + fk['fkcol'] + '_fkey'
|
+ fk['fktab'] + '_' + fk['fkcol'] + '_fkey'
|
||||||
+ " foreign key (" + fk['fkcol']
|
+ " foreign key (" + fk['fkcol']
|
||||||
+ ") references " + fk['rtab'] + "(" + fk['rcol'] + ")")
|
+ ") references " + fk['rtab'] + "(" + fk['rcol'] + ")")
|
||||||
except:
|
except:
|
||||||
print _("Create foreign key failed: ") + str(sys.exc_info())
|
print _("Create foreign key failed:"), str(sys.exc_info())
|
||||||
else:
|
else:
|
||||||
print _("Only MySQL and Postgres supported so far")
|
pass
|
||||||
|
|
||||||
try:
|
try:
|
||||||
if self.backend == self.PGSQL:
|
if self.backend == self.PGSQL:
|
||||||
self.connection.set_isolation_level(1) # go back to normal isolation level
|
self.connection.set_isolation_level(1) # go back to normal isolation level
|
||||||
except:
|
except:
|
||||||
print _(" set_isolation_level failed: ") + str(sys.exc_info())
|
print _("set_isolation_level failed:"), str(sys.exc_info())
|
||||||
#end def createAllForeignKeys
|
#end def createAllForeignKeys
|
||||||
|
|
||||||
def dropAllForeignKeys(self):
|
def dropAllForeignKeys(self):
|
||||||
|
@ -1503,14 +1502,15 @@ class Database:
|
||||||
cons = c.fetchone()
|
cons = c.fetchone()
|
||||||
#print "preparebulk find fk: cons=", cons
|
#print "preparebulk find fk: cons=", cons
|
||||||
if cons:
|
if cons:
|
||||||
print _("dropping mysql foreign key"), cons[0], fk['fktab'], fk['fkcol']
|
print _("Dropping foreign key:"), cons[0], fk['fktab'], fk['fkcol']
|
||||||
try:
|
try:
|
||||||
c.execute("alter table " + fk['fktab'] + " drop foreign key " + cons[0])
|
c.execute("alter table " + fk['fktab'] + " drop foreign key " + cons[0])
|
||||||
except:
|
except:
|
||||||
print _(" drop failed: ") + str(sys.exc_info())
|
print _("Warning:"), _("Drop foreign key %s_%s_fkey failed: %s, continuing ...") \
|
||||||
|
% (fk['fktab'], fk['fkcol'], str(sys.exc_value).rstrip('\n') )
|
||||||
elif self.backend == self.PGSQL:
|
elif self.backend == self.PGSQL:
|
||||||
# DON'T FORGET TO RECREATE THEM!!
|
# DON'T FORGET TO RECREATE THEM!!
|
||||||
print _("dropping pg foreign key"), fk['fktab'], fk['fkcol']
|
print _("Dropping foreign key:"), fk['fktab'], fk['fkcol']
|
||||||
try:
|
try:
|
||||||
# try to lock table to see if index drop will work:
|
# try to lock table to see if index drop will work:
|
||||||
# hmmm, tested by commenting out rollback in grapher. lock seems to work but
|
# hmmm, tested by commenting out rollback in grapher. lock seems to work but
|
||||||
|
@ -1522,17 +1522,18 @@ class Database:
|
||||||
#print "alter table %s drop constraint %s_%s_fkey" % (fk['fktab'], fk['fktab'], fk['fkcol'])
|
#print "alter table %s drop constraint %s_%s_fkey" % (fk['fktab'], fk['fktab'], fk['fkcol'])
|
||||||
try:
|
try:
|
||||||
c.execute("alter table %s drop constraint %s_%s_fkey" % (fk['fktab'], fk['fktab'], fk['fkcol']))
|
c.execute("alter table %s drop constraint %s_%s_fkey" % (fk['fktab'], fk['fktab'], fk['fkcol']))
|
||||||
print _("dropped pg foreign key %s_%s_fkey, continuing ...") % (fk['fktab'], fk['fkcol'])
|
print _("dropped foreign key %s_%s_fkey, continuing ...") % (fk['fktab'], fk['fkcol'])
|
||||||
except:
|
except:
|
||||||
if "does not exist" not in str(sys.exc_value):
|
if "does not exist" not in str(sys.exc_value):
|
||||||
print _("warning: drop pg fk %s_%s_fkey failed: %s, continuing ...") \
|
print _("Warning:"), _("Drop foreign key %s_%s_fkey failed: %s, continuing ...") \
|
||||||
% (fk['fktab'], fk['fkcol'], str(sys.exc_value).rstrip('\n') )
|
% (fk['fktab'], fk['fkcol'], str(sys.exc_value).rstrip('\n') )
|
||||||
c.execute("END TRANSACTION")
|
c.execute("END TRANSACTION")
|
||||||
except:
|
except:
|
||||||
print _("warning: constraint %s_%s_fkey not dropped: %s, continuing ...") \
|
print _("Warning:"), _("constraint %s_%s_fkey not dropped: %s, continuing ...") \
|
||||||
% (fk['fktab'],fk['fkcol'], str(sys.exc_value).rstrip('\n'))
|
% (fk['fktab'],fk['fkcol'], str(sys.exc_value).rstrip('\n'))
|
||||||
else:
|
else:
|
||||||
print _("Only MySQL and Postgres supported so far")
|
#print _("Only MySQL and Postgres supported so far")
|
||||||
|
pass
|
||||||
|
|
||||||
if self.backend == self.PGSQL:
|
if self.backend == self.PGSQL:
|
||||||
self.connection.set_isolation_level(1) # go back to normal isolation level
|
self.connection.set_isolation_level(1) # go back to normal isolation level
|
||||||
|
@ -2639,7 +2640,7 @@ class Database:
|
||||||
print _("queue empty too long - writer stopping ...")
|
print _("queue empty too long - writer stopping ...")
|
||||||
break
|
break
|
||||||
except:
|
except:
|
||||||
print _("writer stopping, error reading queue: ") + str(sys.exc_info())
|
print _("writer stopping, error reading queue:"), str(sys.exc_info())
|
||||||
break
|
break
|
||||||
#print "got hand", str(h.get_finished())
|
#print "got hand", str(h.get_finished())
|
||||||
|
|
||||||
|
@ -2669,11 +2670,11 @@ class Database:
|
||||||
wait = wait + wait
|
wait = wait + wait
|
||||||
again = True
|
again = True
|
||||||
else:
|
else:
|
||||||
print _("too many deadlocks - failed to store hand ") + h.get_siteHandNo()
|
print _("Too many deadlocks - failed to store hand"), h.get_siteHandNo()
|
||||||
if not again:
|
if not again:
|
||||||
fails = fails + 1
|
fails = fails + 1
|
||||||
err = traceback.extract_tb(sys.exc_info()[2])[-1]
|
err = traceback.extract_tb(sys.exc_info()[2])[-1]
|
||||||
print _("***Error storing hand: ")+err[2]+"("+str(err[1])+"): "+str(sys.exc_info()[1])
|
print _("***Error storing hand:"), err[2]+"("+str(err[1])+"): "+str(sys.exc_info()[1])
|
||||||
# finished trying to store hand
|
# finished trying to store hand
|
||||||
|
|
||||||
# always reduce q count, whether or not this hand was saved ok
|
# always reduce q count, whether or not this hand was saved ok
|
||||||
|
@ -2693,7 +2694,7 @@ class Database:
|
||||||
q.put(h)
|
q.put(h)
|
||||||
except:
|
except:
|
||||||
err = traceback.extract_tb(sys.exc_info()[2])[-1]
|
err = traceback.extract_tb(sys.exc_info()[2])[-1]
|
||||||
print _("***Error sending finish: ")+err[2]+"("+str(err[1])+"): "+str(sys.exc_info()[1])
|
print _("***Error sending finish:"), err[2]+"("+str(err[1])+"): "+str(sys.exc_info()[1])
|
||||||
# end def send_finish_msg():
|
# end def send_finish_msg():
|
||||||
|
|
||||||
def createTourneyType(self, hand):#note: this method is used on Hand and TourneySummary objects
|
def createTourneyType(self, hand):#note: this method is used on Hand and TourneySummary objects
|
||||||
|
@ -2779,7 +2780,7 @@ class Database:
|
||||||
(hand.tourneyTypeId, hand.tourNo, hand.entries, hand.prizepool, hand.startTime,
|
(hand.tourneyTypeId, hand.tourNo, hand.entries, hand.prizepool, hand.startTime,
|
||||||
hand.endTime, hand.tourneyName, hand.matrixIdProcessed, hand.totalRebuyCount, hand.totalAddOnCount))
|
hand.endTime, hand.tourneyName, hand.matrixIdProcessed, hand.totalRebuyCount, hand.totalAddOnCount))
|
||||||
else:
|
else:
|
||||||
raise FpdbParseError(_("invalid source in Database.createOrUpdateTourney"))
|
raise FpdbParseError(_("invalid source in %s") % Database.createOrUpdateTourney)
|
||||||
tourneyId = self.get_last_insert_id(cursor)
|
tourneyId = self.get_last_insert_id(cursor)
|
||||||
return tourneyId
|
return tourneyId
|
||||||
#end def createOrUpdateTourney
|
#end def createOrUpdateTourney
|
||||||
|
@ -2792,7 +2793,7 @@ class Database:
|
||||||
elif source=="HHC":
|
elif source=="HHC":
|
||||||
playerId = hand.dbid_pids[player[1]]
|
playerId = hand.dbid_pids[player[1]]
|
||||||
else:
|
else:
|
||||||
raise FpdbParseError(_("invalid source in Database.createOrUpdateTourneysPlayers"))
|
raise FpdbParseError(_("invalid source in %s") % Database.createOrUpdateTourneysPlayers)
|
||||||
|
|
||||||
cursor = self.get_cursor()
|
cursor = self.get_cursor()
|
||||||
cursor.execute (self.sql.query['getTourneysPlayersByIds'].replace('%s', self.sql.query['placeholder']),
|
cursor.execute (self.sql.query['getTourneysPlayersByIds'].replace('%s', self.sql.query['placeholder']),
|
||||||
|
@ -2928,7 +2929,7 @@ class HandToWrite:
|
||||||
self.tableName = None
|
self.tableName = None
|
||||||
self.seatNos = None
|
self.seatNos = None
|
||||||
except:
|
except:
|
||||||
print _("HandToWrite.init error: ") + str(sys.exc_info())
|
print _("%s error: %s") % ("HandToWrite.init", str(sys.exc_info()))
|
||||||
raise
|
raise
|
||||||
# end def __init__
|
# end def __init__
|
||||||
|
|
||||||
|
@ -2978,7 +2979,7 @@ class HandToWrite:
|
||||||
self.tableName = tableName
|
self.tableName = tableName
|
||||||
self.seatNos = seatNos
|
self.seatNos = seatNos
|
||||||
except:
|
except:
|
||||||
print _("HandToWrite.set_all error: ") + str(sys.exc_info())
|
print _("%s error: %s") % ("HandToWrite.set_all", str(sys.exc_info()))
|
||||||
raise
|
raise
|
||||||
# end def set_hand
|
# end def set_hand
|
||||||
|
|
||||||
|
@ -3009,7 +3010,7 @@ if __name__=="__main__":
|
||||||
|
|
||||||
hero = db_connection.get_player_id(c, 'PokerStars', 'nutOmatic')
|
hero = db_connection.get_player_id(c, 'PokerStars', 'nutOmatic')
|
||||||
if hero:
|
if hero:
|
||||||
print _("nutOmatic is id_player = %d") % hero
|
print "nutOmatic player_id", hero
|
||||||
|
|
||||||
# example of displaying query plan in sqlite:
|
# example of displaying query plan in sqlite:
|
||||||
if db_connection.backend == 4:
|
if db_connection.backend == 4:
|
||||||
|
@ -3017,7 +3018,7 @@ if __name__=="__main__":
|
||||||
c = db_connection.get_cursor()
|
c = db_connection.get_cursor()
|
||||||
c.execute('explain query plan '+sql.query['get_table_name'], (h, ))
|
c.execute('explain query plan '+sql.query['get_table_name'], (h, ))
|
||||||
for row in c.fetchall():
|
for row in c.fetchall():
|
||||||
print _("query plan: "), row
|
print "Query plan:", row
|
||||||
print
|
print
|
||||||
|
|
||||||
t0 = time()
|
t0 = time()
|
||||||
|
@ -3029,9 +3030,9 @@ if __name__=="__main__":
|
||||||
print _("cards ="), db_connection.get_cards(u'1')
|
print _("cards ="), db_connection.get_cards(u'1')
|
||||||
db_connection.close_connection
|
db_connection.close_connection
|
||||||
|
|
||||||
print _("get_stats took: %4.3f seconds") % (t1-t0)
|
print _("get_stats took: %4.3f seconds") % (t1-t0)
|
||||||
|
|
||||||
print _("press enter to continue")
|
print _("Press ENTER to continue.")
|
||||||
sys.stdin.readline()
|
sys.stdin.readline()
|
||||||
|
|
||||||
#Code borrowed from http://push.cx/2008/caching-dictionaries-in-python-vs-ruby
|
#Code borrowed from http://push.cx/2008/caching-dictionaries-in-python-vs-ruby
|
||||||
|
|
|
@ -105,7 +105,7 @@ class Everest(HandHistoryConverter):
|
||||||
if not m2:
|
if not m2:
|
||||||
tmp = handText[0:100]
|
tmp = handText[0:100]
|
||||||
log.error("determineGameType: " + _("Raising FpdbParseError"))
|
log.error("determineGameType: " + _("Raising FpdbParseError"))
|
||||||
raise FpdbParseError(_("Unable to recognise handinfo from: '%s'") % tmp)
|
raise FpdbParseError(_("Unable to recognise hand info from: '%s'") % tmp)
|
||||||
|
|
||||||
self.info = {}
|
self.info = {}
|
||||||
mg = m.groupdict()
|
mg = m.groupdict()
|
||||||
|
@ -231,8 +231,8 @@ class Everest(HandHistoryConverter):
|
||||||
elif action.group('ATYPE') in ('FOLD', 'SIT_OUT'):
|
elif action.group('ATYPE') in ('FOLD', 'SIT_OUT'):
|
||||||
hand.addFold(street, player)
|
hand.addFold(street, player)
|
||||||
else:
|
else:
|
||||||
print (_("Unimplemented readAction: '%s' '%s'") % (action.group('PSEAT'), action.group('ATYPE')))
|
print (_("Unimplemented %s: '%s' '%s'") % ("readAction", action.group('PSEAT'), action.group('ATYPE')))
|
||||||
logging.debug(_("Unimplemented readAction: '%s' '%s'") % (action.group('PSEAT'), action.group('ATYPE')))
|
logging.debug(_("Unimplemented %s: '%s' '%s'") % ("readAction", action.group('PSEAT'), action.group('ATYPE')))
|
||||||
|
|
||||||
def readShowdownActions(self, hand):
|
def readShowdownActions(self, hand):
|
||||||
for shows in self.re_ShowdownAction.finditer(hand.handText):
|
for shows in self.re_ShowdownAction.finditer(hand.handText):
|
||||||
|
|
|
@ -271,7 +271,7 @@ or None if we fail to get the info """
|
||||||
|
|
||||||
|
|
||||||
def readStudPlayerCards(self, hand, street):
|
def readStudPlayerCards(self, hand, street):
|
||||||
logging.warning(_("Everleaf readStudPlayerCards is only a stub."))
|
logging.warning(_("%s cannot read all stud/razz hands yet.") % hand.sitename)
|
||||||
|
|
||||||
|
|
||||||
def readAction(self, hand, street):
|
def readAction(self, hand, street):
|
||||||
|
@ -292,7 +292,7 @@ or None if we fail to get the info """
|
||||||
elif action.group('ATYPE') == ' complete to':
|
elif action.group('ATYPE') == ' complete to':
|
||||||
hand.addComplete( street, action.group('PNAME'), action.group('BET'))
|
hand.addComplete( street, action.group('PNAME'), action.group('BET'))
|
||||||
else:
|
else:
|
||||||
logging.debug(_("Unimplemented readAction: '%s' '%s'") % (action.group('PNAME'), action.group('ATYPE')))
|
logging.debug(_("Unimplemented %s: '%s' '%s'") % ("readAction", action.group('PNAME'), action.group('ATYPE')))
|
||||||
|
|
||||||
|
|
||||||
def readShowdownActions(self, hand):
|
def readShowdownActions(self, hand):
|
||||||
|
@ -301,7 +301,7 @@ or None if we fail to get the info """
|
||||||
for shows in self.re_ShowdownAction.finditer(hand.handText):
|
for shows in self.re_ShowdownAction.finditer(hand.handText):
|
||||||
cards = shows.group('CARDS')
|
cards = shows.group('CARDS')
|
||||||
cards = cards.split(', ')
|
cards = cards.split(', ')
|
||||||
logging.debug(_("readShowdownActions %s %s") % (cards, shows.group('PNAME')))
|
logging.debug("readShowdownActions %s %s" % (cards, shows.group('PNAME')))
|
||||||
hand.addShownCards(cards, shows.group('PNAME'))
|
hand.addShownCards(cards, shows.group('PNAME'))
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -77,7 +77,7 @@ class Filters(threading.Thread):
|
||||||
self.mainVBox = gtk.VBox(False, 0)
|
self.mainVBox = gtk.VBox(False, 0)
|
||||||
self.sw.add_with_viewport(self.mainVBox)
|
self.sw.add_with_viewport(self.mainVBox)
|
||||||
self.sw.show()
|
self.sw.show()
|
||||||
print(_("DEBUG: ") + _("New packing box created!"))
|
#print(_("DEBUG:") + _("New packing box created!"))
|
||||||
|
|
||||||
self.found = {'nl':False, 'fl':False, 'pl':False, 'cn':False, 'ring':False, 'tour':False}
|
self.found = {'nl':False, 'fl':False, 'pl':False, 'cn':False, 'ring':False, 'tour':False}
|
||||||
self.label = {}
|
self.label = {}
|
||||||
|
@ -1046,7 +1046,7 @@ class Filters(threading.Thread):
|
||||||
btn_end.set_image(gtk.image_new_from_stock(gtk.STOCK_INDEX, gtk.ICON_SIZE_BUTTON))
|
btn_end.set_image(gtk.image_new_from_stock(gtk.STOCK_INDEX, gtk.ICON_SIZE_BUTTON))
|
||||||
btn_end.connect('clicked', self.__calendar_dialog, self.end_date)
|
btn_end.connect('clicked', self.__calendar_dialog, self.end_date)
|
||||||
|
|
||||||
btn_clear = gtk.Button(label=_(' Clear Dates '))
|
btn_clear = gtk.Button(label=_('Clear Dates'))
|
||||||
btn_clear.connect('clicked', self.__clear_dates)
|
btn_clear.connect('clicked', self.__clear_dates)
|
||||||
|
|
||||||
hbox.pack_start(lbl_end, expand=False, padding=3)
|
hbox.pack_start(lbl_end, expand=False, padding=3)
|
||||||
|
|
|
@ -282,9 +282,9 @@ class Fulltilt(HandHistoryConverter):
|
||||||
m = self.re_HandInfo.search(hand.handText)
|
m = self.re_HandInfo.search(hand.handText)
|
||||||
if m is None:
|
if m is None:
|
||||||
tmp = hand.handText[0:100]
|
tmp = hand.handText[0:100]
|
||||||
log.error(_("Unable to recognise handinfo from: '%s'") % tmp)
|
log.error(_("Unable to recognise hand info from: '%s'") % tmp)
|
||||||
log.error("readHandInfo: " + _("Raising FpdbParseError"))
|
log.error("readHandInfo: " + _("Raising FpdbParseError"))
|
||||||
raise FpdbParseError(_("Unable to recognise handinfo from: '%s'"))
|
raise FpdbParseError(_("Unable to recognise hand info from: '%s'"))
|
||||||
|
|
||||||
#print "DEBUG: m.groupdict: %s" % m.groupdict()
|
#print "DEBUG: m.groupdict: %s" % m.groupdict()
|
||||||
hand.handid = m.group('HID')
|
hand.handid = m.group('HID')
|
||||||
|
@ -467,7 +467,7 @@ class Fulltilt(HandHistoryConverter):
|
||||||
hand.buttonpos = int(self.re_Button.search(hand.handText).group('BUTTON'))
|
hand.buttonpos = int(self.re_Button.search(hand.handText).group('BUTTON'))
|
||||||
except AttributeError, e:
|
except AttributeError, e:
|
||||||
# FTP has no indication that a hand is cancelled.
|
# FTP has no indication that a hand is cancelled.
|
||||||
raise FpdbParseError(_("readButton: Failed to detect button (hand #%s cancelled?)") % hand.handid)
|
raise FpdbParseError(_("%s Failed to detect button (hand #%s cancelled?)") % ("readButton:", hand.handid))
|
||||||
|
|
||||||
def readHeroCards(self, hand):
|
def readHeroCards(self, hand):
|
||||||
# streets PREFLOP, PREDRAW, and THIRD are special cases beacause
|
# streets PREFLOP, PREDRAW, and THIRD are special cases beacause
|
||||||
|
@ -525,7 +525,7 @@ class Fulltilt(HandHistoryConverter):
|
||||||
elif action.group('ATYPE') == ' stands pat':
|
elif action.group('ATYPE') == ' stands pat':
|
||||||
hand.addStandsPat( street, action.group('PNAME'), action.group('CARDS'))
|
hand.addStandsPat( street, action.group('PNAME'), action.group('CARDS'))
|
||||||
else:
|
else:
|
||||||
print (_("DEBUG: ") + " " + _("Unimplemented readAction: '%s' '%s'") % (action.group('PNAME'), action.group('ATYPE')))
|
print (_("DEBUG:") + " " + _("Unimplemented %s: '%s' '%s'") % ("readAction", action.group('PNAME'), action.group('ATYPE')))
|
||||||
|
|
||||||
|
|
||||||
def readShowdownActions(self, hand):
|
def readShowdownActions(self, hand):
|
||||||
|
@ -689,18 +689,18 @@ class Fulltilt(HandHistoryConverter):
|
||||||
tourney.buyin = 100*Decimal(clearMoneyString(mg['BUYIN']))
|
tourney.buyin = 100*Decimal(clearMoneyString(mg['BUYIN']))
|
||||||
else :
|
else :
|
||||||
if 100*Decimal(clearMoneyString(mg['BUYIN'])) != tourney.buyin:
|
if 100*Decimal(clearMoneyString(mg['BUYIN'])) != tourney.buyin:
|
||||||
log.error(_("Conflict between buyins read in topline (%s) and in BuyIn field (%s)") % (tourney.buyin, 100*Decimal(re.sub(u',', u'', "%s" % mg['BUYIN']))) )
|
log.error(_("Conflict between buyins read in top line (%s) and in BuyIn field (%s)") % (tourney.buyin, 100*Decimal(re.sub(u',', u'', "%s" % mg['BUYIN']))) )
|
||||||
tourney.subTourneyBuyin = 100*Decimal(clearMoneyString(mg['BUYIN']))
|
tourney.subTourneyBuyin = 100*Decimal(clearMoneyString(mg['BUYIN']))
|
||||||
if mg['FEE'] is not None:
|
if mg['FEE'] is not None:
|
||||||
if tourney.fee is None:
|
if tourney.fee is None:
|
||||||
tourney.fee = 100*Decimal(clearMoneyString(mg['FEE']))
|
tourney.fee = 100*Decimal(clearMoneyString(mg['FEE']))
|
||||||
else :
|
else :
|
||||||
if 100*Decimal(clearMoneyString(mg['FEE'])) != tourney.fee:
|
if 100*Decimal(clearMoneyString(mg['FEE'])) != tourney.fee:
|
||||||
log.error(_("Conflict between fees read in topline (%s) and in BuyIn field (%s)") % (tourney.fee, 100*Decimal(clearMoneyString(mg['FEE']))) )
|
log.error(_("Conflict between fees read in top line (%s) and in BuyIn field (%s)") % (tourney.fee, 100*Decimal(clearMoneyString(mg['FEE']))) )
|
||||||
tourney.subTourneyFee = 100*Decimal(clearMoneyString(mg['FEE']))
|
tourney.subTourneyFee = 100*Decimal(clearMoneyString(mg['FEE']))
|
||||||
|
|
||||||
if tourney.buyin is None:
|
if tourney.buyin is None:
|
||||||
log.info(_("Unable to affect a buyin to this tournament : assume it's a freeroll"))
|
log.info(_("Unable to detect a buyin to this tournament : assume it's a freeroll"))
|
||||||
tourney.buyin = 0
|
tourney.buyin = 0
|
||||||
tourney.fee = 0
|
tourney.fee = 0
|
||||||
else:
|
else:
|
||||||
|
@ -810,9 +810,9 @@ class Fulltilt(HandHistoryConverter):
|
||||||
tourney.hero = heroName
|
tourney.hero = heroName
|
||||||
# Is this really useful ?
|
# Is this really useful ?
|
||||||
if heroName not in tourney.ranks:
|
if heroName not in tourney.ranks:
|
||||||
print (_("%s not found in tourney.ranks ...") % heroName)
|
print (_("%s not found in %s...") % ("tourney.ranks", heroName))
|
||||||
elif (tourney.ranks[heroName] != Decimal(n.group('HERO_FINISHING_POS'))):
|
elif (tourney.ranks[heroName] != Decimal(n.group('HERO_FINISHING_POS'))):
|
||||||
print (_("Bad parsing : finish position incoherent : %s / %s") % (tourney.ranks[heroName], n.group('HERO_FINISHING_POS')))
|
print (_("Error:")+ _("Parsed finish position incoherent : %s / %s") % (tourney.ranks[heroName], n.group('HERO_FINISHING_POS')))
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
|
@ -118,7 +118,7 @@ class GuiAutoImport (threading.Thread):
|
||||||
hbox.pack_start(lbl1, expand=True, fill=False)
|
hbox.pack_start(lbl1, expand=True, fill=False)
|
||||||
|
|
||||||
self.doAutoImportBool = False
|
self.doAutoImportBool = False
|
||||||
self.startButton = gtk.ToggleButton(_(" Start _Auto Import "))
|
self.startButton = gtk.ToggleButton(_("Start _Auto Import"))
|
||||||
self.startButton.connect("clicked", self.startClicked, "start clicked")
|
self.startButton.connect("clicked", self.startClicked, "start clicked")
|
||||||
hbox.pack_start(self.startButton, expand=False, fill=False)
|
hbox.pack_start(self.startButton, expand=False, fill=False)
|
||||||
|
|
||||||
|
@ -177,7 +177,7 @@ class GuiAutoImport (threading.Thread):
|
||||||
def do_import(self):
|
def do_import(self):
|
||||||
"""Callback for timer to do an import iteration."""
|
"""Callback for timer to do an import iteration."""
|
||||||
if self.doAutoImportBool:
|
if self.doAutoImportBool:
|
||||||
self.startButton.set_label(_(u' _Auto Import Running '))
|
self.startButton.set_label(_(u'_Auto Import Running'))
|
||||||
self.importer.runUpdated()
|
self.importer.runUpdated()
|
||||||
self.addText(".")
|
self.addText(".")
|
||||||
#sys.stdout.write(".")
|
#sys.stdout.write(".")
|
||||||
|
@ -188,9 +188,9 @@ class GuiAutoImport (threading.Thread):
|
||||||
|
|
||||||
def reset_startbutton(self):
|
def reset_startbutton(self):
|
||||||
if self.pipe_to_hud is not None:
|
if self.pipe_to_hud is not None:
|
||||||
self.startButton.set_label(_(u' Stop _Auto Import '))
|
self.startButton.set_label(_(u'Stop _Auto Import'))
|
||||||
else:
|
else:
|
||||||
self.startButton.set_label(_(u' Start _Auto Import '))
|
self.startButton.set_label(_(u'Start _Auto Import'))
|
||||||
|
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
@ -200,7 +200,7 @@ class GuiAutoImport (threading.Thread):
|
||||||
for site in the_sites:
|
for site in the_sites:
|
||||||
params = self.config.get_site_parameters(site)
|
params = self.config.get_site_parameters(site)
|
||||||
if params['enabled'] == True:
|
if params['enabled'] == True:
|
||||||
print (_("DEBUG: ") + _("Detecting hh directory for site: '%s'") % site)
|
print (_("DEBUG:") + " " + _("Detecting hand history directory for site: '%s'") % site)
|
||||||
if os.name == 'posix':
|
if os.name == 'posix':
|
||||||
if self.posix_detect_hh_dirs(site):
|
if self.posix_detect_hh_dirs(site):
|
||||||
#data[1].set_text(dia_chooser.get_filename())
|
#data[1].set_text(dia_chooser.get_filename())
|
||||||
|
@ -240,9 +240,9 @@ class GuiAutoImport (threading.Thread):
|
||||||
# - Ideally we want to release the lock if the auto-import is killed by some
|
# - Ideally we want to release the lock if the auto-import is killed by some
|
||||||
# kind of exception - is this possible?
|
# kind of exception - is this possible?
|
||||||
if self.settings['global_lock'].acquire(wait=False, source="AutoImport"): # returns false immediately if lock not acquired
|
if self.settings['global_lock'].acquire(wait=False, source="AutoImport"): # returns false immediately if lock not acquired
|
||||||
self.addText(_("\nGlobal lock taken ... Auto Import Started.\n"))
|
self.addText("\n" + _("Global lock taken ... Auto Import Started.")+"\n")
|
||||||
self.doAutoImportBool = True
|
self.doAutoImportBool = True
|
||||||
self.startButton.set_label(_(u' _Stop Auto Import '))
|
self.startButton.set_label(_(u'Stop _Auto Import'))
|
||||||
while gtk.events_pending(): # change the label NOW don't wait for the pipe to open
|
while gtk.events_pending(): # change the label NOW don't wait for the pipe to open
|
||||||
gtk.main_iteration(False)
|
gtk.main_iteration(False)
|
||||||
if self.pipe_to_hud is None:
|
if self.pipe_to_hud is None:
|
||||||
|
@ -276,7 +276,7 @@ class GuiAutoImport (threading.Thread):
|
||||||
except:
|
except:
|
||||||
err = traceback.extract_tb(sys.exc_info()[2])[-1]
|
err = traceback.extract_tb(sys.exc_info()[2])[-1]
|
||||||
#self.addText( "\n*** GuiAutoImport Error opening pipe: " + err[2] + "(" + str(err[1]) + "): " + str(sys.exc_info()[1]))
|
#self.addText( "\n*** GuiAutoImport Error opening pipe: " + err[2] + "(" + str(err[1]) + "): " + str(sys.exc_info()[1]))
|
||||||
self.addText(_("\n*** GuiAutoImport Error opening pipe: ") + traceback.format_exc() )
|
self.addText("\n" + _("*** GuiAutoImport Error opening pipe:") + " " + traceback.format_exc() )
|
||||||
else:
|
else:
|
||||||
for site in self.input_settings:
|
for site in self.input_settings:
|
||||||
self.importer.addImportDirectory(self.input_settings[site][0], True, site, self.input_settings[site][1])
|
self.importer.addImportDirectory(self.input_settings[site][0], True, site, self.input_settings[site][1])
|
||||||
|
|
|
@ -341,10 +341,8 @@ def main(argv=None):
|
||||||
|
|
||||||
parser = OptionParser()
|
parser = OptionParser()
|
||||||
parser.add_option("-f", "--file", dest="filename", metavar="FILE", default=None,
|
parser.add_option("-f", "--file", dest="filename", metavar="FILE", default=None,
|
||||||
help=_("Input file in quiet mode"))
|
help=_("Input file"))
|
||||||
parser.add_option("-q", "--quiet", action="store_false", dest="gui", default=True,
|
parser.add_option("-c", "--convert", dest="filtername", default=None, metavar="FILTER",
|
||||||
help=_("don't start gui; deprecated (just give a filename with -f)."))
|
|
||||||
parser.add_option("-c", "--convert", dest="filtername", default="PokerStars", metavar="FILTER",
|
|
||||||
help=_("Conversion filter (*Full Tilt Poker, PokerStars, Everleaf, Absolute)"))
|
help=_("Conversion filter (*Full Tilt Poker, PokerStars, Everleaf, Absolute)"))
|
||||||
parser.add_option("-x", "--failOnError", action="store_true", default=False,
|
parser.add_option("-x", "--failOnError", action="store_true", default=False,
|
||||||
help=_("If this option is passed it quits when it encounters any error"))
|
help=_("If this option is passed it quits when it encounters any error"))
|
||||||
|
@ -378,9 +376,6 @@ def main(argv=None):
|
||||||
settings.update(config.get_import_parameters())
|
settings.update(config.get_import_parameters())
|
||||||
settings.update(config.get_default_paths())
|
settings.update(config.get_default_paths())
|
||||||
|
|
||||||
if not options.gui:
|
|
||||||
print _('-q is deprecated. Just use "-f filename" instead')
|
|
||||||
# This is because -q on its own causes an error, so -f is necessary and sufficient for cmd line use
|
|
||||||
if not options.filename:
|
if not options.filename:
|
||||||
i = GuiBulkImport(settings, config, None)
|
i = GuiBulkImport(settings, config, None)
|
||||||
main_window = gtk.Window()
|
main_window = gtk.Window()
|
||||||
|
@ -389,6 +384,8 @@ def main(argv=None):
|
||||||
main_window.show()
|
main_window.show()
|
||||||
gtk.main()
|
gtk.main()
|
||||||
else:
|
else:
|
||||||
|
if not options.filtername:
|
||||||
|
print _("You have to select a site with the -c parameter. E.g.:"), "Everleaf converter: ./GuiBulkImport.py -c Everleaf -f filename"
|
||||||
#Do something useful
|
#Do something useful
|
||||||
importer = fpdb_import.Importer(False,settings, config, None)
|
importer = fpdb_import.Importer(False,settings, config, None)
|
||||||
# importer.setDropIndexes("auto")
|
# importer.setDropIndexes("auto")
|
||||||
|
|
|
@ -134,7 +134,7 @@ class GuiPositionalStats (threading.Thread):
|
||||||
def toggleCallback(self, widget, data=None):
|
def toggleCallback(self, widget, data=None):
|
||||||
# print "%s was toggled %s" % (data, ("OFF", "ON")[widget.get_active()])
|
# print "%s was toggled %s" % (data, ("OFF", "ON")[widget.get_active()])
|
||||||
self.activesite = data
|
self.activesite = data
|
||||||
print (_("DEBUG: ") + _("activesite set to %s") % (self.activesite))
|
print (_("DEBUG:") + " " + _("activesite set to %s") % (self.activesite))
|
||||||
|
|
||||||
def refreshStats(self, widget, data):
|
def refreshStats(self, widget, data):
|
||||||
try: self.stats_vbox.destroy()
|
try: self.stats_vbox.destroy()
|
||||||
|
|
|
@ -175,12 +175,12 @@ if __name__=="__main__":
|
||||||
config = Configuration.Config()
|
config = Configuration.Config()
|
||||||
|
|
||||||
win = gtk.Window(gtk.WINDOW_TOPLEVEL)
|
win = gtk.Window(gtk.WINDOW_TOPLEVEL)
|
||||||
win.set_title(_("Test Preferences Dialog"))
|
win.set_title(_("Advanced Preferences Dialog"))
|
||||||
win.set_border_width(1)
|
win.set_border_width(1)
|
||||||
win.set_default_size(600, 500)
|
win.set_default_size(600, 500)
|
||||||
win.set_resizable(True)
|
win.set_resizable(True)
|
||||||
|
|
||||||
dia = gtk.Dialog(_("Preferences"),
|
dia = gtk.Dialog(_("Advanced Preferences"),
|
||||||
win,
|
win,
|
||||||
gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT,
|
gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT,
|
||||||
(gtk.STOCK_CANCEL, gtk.RESPONSE_REJECT,
|
(gtk.STOCK_CANCEL, gtk.RESPONSE_REJECT,
|
||||||
|
|
|
@ -218,25 +218,25 @@ Against the range: {
|
||||||
self.outputlabel.set_text(string)
|
self.outputlabel.set_text(string)
|
||||||
|
|
||||||
def set_board_flop(self, caller, widget):
|
def set_board_flop(self, caller, widget):
|
||||||
print (_("DEBUG: ") + _("called set_board_flop: '%s' '%s'") % (caller ,widget))
|
print (_("DEBUG:") + " " + _("called") + " set_board_flop: '%s' '%s'" % (caller ,widget))
|
||||||
self.boardtext = widget.get_text()
|
self.boardtext = widget.get_text()
|
||||||
|
|
||||||
def set_hero_cards_flop(self, caller, widget):
|
def set_hero_cards_flop(self, caller, widget):
|
||||||
print (_("DEBUG: ") + _("called set_hero_cards_flop"))
|
print (_("DEBUG:") + " " + _("called") + " set_hero_cards_flop")
|
||||||
self.herorange = widget.get_text()
|
self.herorange = widget.get_text()
|
||||||
|
|
||||||
def set_villain_cards_flop(self, caller, widget):
|
def set_villain_cards_flop(self, caller, widget):
|
||||||
print (_("DEBUG: ") + _("called set_villain_cards_flop"))
|
print (_("DEBUG:") + " " + _("called") + " set_villain_cards_flop")
|
||||||
self.villainrange = widget.get_text()
|
self.villainrange = widget.get_text()
|
||||||
|
|
||||||
def update_flop_output_pane(self, caller, widget):
|
def update_flop_output_pane(self, caller, widget):
|
||||||
print (_("DEBUG: ") + _("called update_flop_output_pane"))
|
print (_("DEBUG:") + " " + _("called") + " update_flop_output_pane")
|
||||||
self.stove.set_board_string(self.boardtext)
|
self.stove.set_board_string(self.boardtext)
|
||||||
self.stove.set_hero_cards_string(self.herorange)
|
self.stove.set_hero_cards_string(self.herorange)
|
||||||
self.stove.set_villain_range_string(self.villainrange)
|
self.stove.set_villain_range_string(self.villainrange)
|
||||||
print (_("DEBUG: ") + ("odds_for_range"))
|
print (_("DEBUG:") + ("odds_for_range"))
|
||||||
self.ev = Stove.odds_for_range(self.stove)
|
self.ev = Stove.odds_for_range(self.stove)
|
||||||
print (_("DEBUG: ") + ("set_output_label"))
|
print (_("DEBUG:") + " " + ("set_output_label"))
|
||||||
self.set_output_label(self.ev.output)
|
self.set_output_label(self.ev.output)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -259,14 +259,14 @@ Left-Drag to Move"
|
||||||
</layout>
|
</layout>
|
||||||
</site>
|
</site>
|
||||||
|
|
||||||
<site HH_path="C:\Users\WindowsUserName\Documents\EverleafSiteName\HandHistory\PlayerName"
|
<site HH_path="C:\Users\WindowsUserName\Documents\EverleafSiteName\HandHistory\YOUR SCREEN NAME HERE"
|
||||||
bgcolor="#000000"
|
bgcolor="#000000"
|
||||||
converter="EverleafToFpdb"
|
converter="EverleafToFpdb"
|
||||||
decoder="everleaf_decode_table"
|
decoder="everleaf_decode_table"
|
||||||
enabled="True"
|
enabled="True"
|
||||||
fgcolor="#EEEEEE"
|
fgcolor="#EEEEEE"
|
||||||
hudopacity="0.75"
|
hudopacity="0.75"
|
||||||
screen_name="PlayerName"
|
screen_name="YOUR SCREEN NAME HERE"
|
||||||
site_name="Everleaf"
|
site_name="Everleaf"
|
||||||
site_path="C:\Users\WindowsUserName\AppData\Roaming\EverleafSiteName\"
|
site_path="C:\Users\WindowsUserName\AppData\Roaming\EverleafSiteName\"
|
||||||
supported_games="holdem,omahahi,omahahilo"
|
supported_games="holdem,omahahi,omahahilo"
|
||||||
|
|
|
@ -491,8 +491,8 @@ If a player has None chips he won't be added."""
|
||||||
|
|
||||||
def checkPlayerExists(self,player):
|
def checkPlayerExists(self,player):
|
||||||
if player not in [p[1] for p in self.players]:
|
if player not in [p[1] for p in self.players]:
|
||||||
print (_("DEBUG: ") + _("checkPlayerExists: %s fail on hand number %s") % (player, self.handid))
|
print (_("DEBUG:") + " checkPlayerExists: " + _("%s fail on hand number %s") % (player, self.handid))
|
||||||
raise FpdbParseError(_("checkPlayerExists: %s fail on hand number %s") % (player, self.handid))
|
raise FpdbParseError("checkPlayerExists: " + _("%s fail on hand number %s") % (player, self.handid))
|
||||||
|
|
||||||
def setCommunityCards(self, street, cards):
|
def setCommunityCards(self, street, cards):
|
||||||
log.debug("setCommunityCards %s %s" %(street, cards))
|
log.debug("setCommunityCards %s %s" %(street, cards))
|
||||||
|
@ -1717,7 +1717,7 @@ class Pot(object):
|
||||||
if self.sym is None:
|
if self.sym is None:
|
||||||
self.sym = "C"
|
self.sym = "C"
|
||||||
if self.total is None:
|
if self.total is None:
|
||||||
print (_("DEBUG: ") + _("call Pot.end() before printing pot total"))
|
print (_("DEBUG:") + " " + _("call Pot.end() before printing pot total"))
|
||||||
# NB if I'm sure end() is idempotent, call it here.
|
# NB if I'm sure end() is idempotent, call it here.
|
||||||
raise FpdbParseError(_("Error in printing Hand object"))
|
raise FpdbParseError(_("Error in printing Hand object"))
|
||||||
|
|
||||||
|
|
|
@ -597,8 +597,8 @@ class Hud:
|
||||||
if adj[j] > self.max:
|
if adj[j] > self.max:
|
||||||
adj[j] = adj[j] - self.max
|
adj[j] = adj[j] - self.max
|
||||||
except Exception, inst:
|
except Exception, inst:
|
||||||
sys.stderr.write(_("exception in Hud.adj_seats\n\n"))
|
sys.stderr.write(_("Exception in Hud.adj_seats\n\n"))
|
||||||
sys.stderr.write(_("error is %s") % inst) # __str__ allows args to printed directly
|
sys.stderr.write(_("Error is %s") % inst) # __str__ allows args to printed directly
|
||||||
return adj
|
return adj
|
||||||
|
|
||||||
def get_actual_seat(self, name):
|
def get_actual_seat(self, name):
|
||||||
|
|
|
@ -41,7 +41,7 @@ def splitPokerStarsSummaries(summaryText): #TODO: this needs to go to PSS.py
|
||||||
splitSummaries = re.split(re_SplitTourneys, summaryText)
|
splitSummaries = re.split(re_SplitTourneys, summaryText)
|
||||||
|
|
||||||
if len(splitSummaries) <= 1:
|
if len(splitSummaries) <= 1:
|
||||||
print (_("DEBUG: ") + _("re_SplitTourneys isn't matching"))
|
print (_("DEBUG:") + " " + _("re_SplitTourneys isn't matching"))
|
||||||
|
|
||||||
return splitSummaries
|
return splitSummaries
|
||||||
|
|
||||||
|
@ -50,7 +50,7 @@ def splitFullTiltSummaries(summaryText):#TODO: this needs to go to FTPS.py
|
||||||
splitSummaries = re.split(re_SplitTourneys, summaryText)
|
splitSummaries = re.split(re_SplitTourneys, summaryText)
|
||||||
|
|
||||||
if len(splitSummaries) <= 1:
|
if len(splitSummaries) <= 1:
|
||||||
print(_("DEBUG: ") + _("re_SplitTourneys isn't matching"))
|
print(_("DEBUG:") + " " + _("re_SplitTourneys isn't matching"))
|
||||||
|
|
||||||
return splitSummaries
|
return splitSummaries
|
||||||
|
|
||||||
|
|
|
@ -213,8 +213,8 @@ class OnGame(HandHistoryConverter):
|
||||||
tzoffset = a.group('OFFSET')
|
tzoffset = a.group('OFFSET')
|
||||||
else:
|
else:
|
||||||
datetimestr = "2010/Jan/01 01:01:01"
|
datetimestr = "2010/Jan/01 01:01:01"
|
||||||
log.error(_("readHandInfo: DATETIME not matched: '%s'") % info[key])
|
log.error("readHandInfo: " + _("DATETIME not matched: '%s'") % info[key])
|
||||||
print (_("DEBUG: ") + _("readHandInfo: DATETIME not matched: '%s'") % info[key])
|
print (_("DEBUG:") + " readHandInfo: " + _("DATETIME not matched: '%s'") % info[key])
|
||||||
# TODO: Manually adjust time against OFFSET
|
# TODO: Manually adjust time against OFFSET
|
||||||
hand.startTime = datetime.datetime.strptime(datetimestr, "%Y/%b/%d %H:%M:%S") # also timezone at end, e.g. " ET"
|
hand.startTime = datetime.datetime.strptime(datetimestr, "%Y/%b/%d %H:%M:%S") # also timezone at end, e.g. " ET"
|
||||||
hand.startTime = HandHistoryConverter.changeTimezone(hand.startTime, tzoffset, "UTC")
|
hand.startTime = HandHistoryConverter.changeTimezone(hand.startTime, tzoffset, "UTC")
|
||||||
|
@ -345,7 +345,7 @@ class OnGame(HandHistoryConverter):
|
||||||
elif action.group('ATYPE') == ' stands pat':
|
elif action.group('ATYPE') == ' stands pat':
|
||||||
hand.addStandsPat( street, action.group('PNAME'))
|
hand.addStandsPat( street, action.group('PNAME'))
|
||||||
else:
|
else:
|
||||||
print (_("DEBUG: ") + _("Unimplemented readAction: '%s' '%s'") % (action.group('PNAME'), action.group('ATYPE')))
|
print (_("DEBUG:") + " " + _("Unimplemented %s: '%s' '%s'") % ("readAction", action.group('PNAME'), action.group('ATYPE')))
|
||||||
|
|
||||||
def readShowdownActions(self, hand):
|
def readShowdownActions(self, hand):
|
||||||
for shows in self.re_ShowdownAction.finditer(hand.handText):
|
for shows in self.re_ShowdownAction.finditer(hand.handText):
|
||||||
|
|
|
@ -426,7 +426,7 @@ class PacificPoker(HandHistoryConverter):
|
||||||
elif action.group('ATYPE') == ' stands pat':
|
elif action.group('ATYPE') == ' stands pat':
|
||||||
hand.addStandsPat( street, action.group('PNAME'))
|
hand.addStandsPat( street, action.group('PNAME'))
|
||||||
else:
|
else:
|
||||||
print (_("DEBUG: ") + _("Unimplemented readAction: '%s' '%s'") % (action.group('PNAME'), action.group('ATYPE')))
|
print (_("DEBUG:") + " " + _("Unimplemented %s: '%s' '%s'") % ("readAction", action.group('PNAME'), action.group('ATYPE')))
|
||||||
|
|
||||||
|
|
||||||
def readShowdownActions(self, hand):
|
def readShowdownActions(self, hand):
|
||||||
|
|
|
@ -532,7 +532,7 @@ class PartyPoker(HandHistoryConverter):
|
||||||
elif actionType == 'checks':
|
elif actionType == 'checks':
|
||||||
hand.addCheck( street, playerName )
|
hand.addCheck( street, playerName )
|
||||||
else:
|
else:
|
||||||
raise FpdbParseError(_("Unimplemented readAction: '%s' '%s'") % (playerName,actionType), hid = hand.hid)
|
raise FpdbParseError(_("Unimplemented %s: '%s' '%s'") % ("readAction", playerName,actionType), hid = hand.hid)
|
||||||
|
|
||||||
def readShowdownActions(self, hand):
|
def readShowdownActions(self, hand):
|
||||||
# all action in readShownCards
|
# all action in readShownCards
|
||||||
|
|
|
@ -348,7 +348,7 @@ class Pkr(HandHistoryConverter):
|
||||||
elif action.group('ATYPE') == ' stands pat':
|
elif action.group('ATYPE') == ' stands pat':
|
||||||
hand.addStandsPat( street, action.group('PNAME'))
|
hand.addStandsPat( street, action.group('PNAME'))
|
||||||
else:
|
else:
|
||||||
print (_("DEBUG: ") + _("Unimplemented readAction: '%s' '%s'") % (action.group('PNAME'), action.group('ATYPE')))
|
print (_("DEBUG:") + _("Unimplemented %s: '%s' '%s'") % ("readAction", action.group('PNAME'), action.group('ATYPE')))
|
||||||
|
|
||||||
|
|
||||||
def readShowdownActions(self, hand):
|
def readShowdownActions(self, hand):
|
||||||
|
|
|
@ -444,7 +444,7 @@ class PokerStars(HandHistoryConverter):
|
||||||
elif action.group('ATYPE') == ' stands pat':
|
elif action.group('ATYPE') == ' stands pat':
|
||||||
hand.addStandsPat( street, action.group('PNAME'), action.group('CARDS'))
|
hand.addStandsPat( street, action.group('PNAME'), action.group('CARDS'))
|
||||||
else:
|
else:
|
||||||
print (_("DEBUG: ") + _("Unimplemented readAction: '%s' '%s'") % (action.group('PNAME'), action.group('ATYPE')))
|
print (_("DEBUG:") + " " + _("Unimplemented %s: '%s' '%s'") % ("readAction", action.group('PNAME'), action.group('ATYPE')))
|
||||||
|
|
||||||
|
|
||||||
def readShowdownActions(self, hand):
|
def readShowdownActions(self, hand):
|
||||||
|
|
|
@ -292,7 +292,7 @@ class Win2day(HandHistoryConverter):
|
||||||
|
|
||||||
def readStudPlayerCards(self, hand, street):
|
def readStudPlayerCards(self, hand, street):
|
||||||
# See comments of reference implementation in FullTiltToFpdb.py
|
# See comments of reference implementation in FullTiltToFpdb.py
|
||||||
logging.debug("readStudPlayerCards")
|
# logging.debug("readStudPlayerCards")
|
||||||
m = self.re_HeroCards.finditer(hand.streets[street])
|
m = self.re_HeroCards.finditer(hand.streets[street])
|
||||||
for player in m:
|
for player in m:
|
||||||
#~ logging.debug(player.groupdict())
|
#~ logging.debug(player.groupdict())
|
||||||
|
@ -345,7 +345,7 @@ class Win2day(HandHistoryConverter):
|
||||||
elif action.group('ATYPE') == 'ACTION_STAND':
|
elif action.group('ATYPE') == 'ACTION_STAND':
|
||||||
hand.addStandsPat( street, action.group('PNAME'))
|
hand.addStandsPat( street, action.group('PNAME'))
|
||||||
else:
|
else:
|
||||||
print (_("DEBUG: ") + _("Unimplemented readAction: '%s' '%s'") % (action.group('PNAME'), action.group('ATYPE')))
|
print (_("DEBUG:") + _("Unimplemented %s: '%s' '%s'") % ("readAction", action.group('PNAME'), action.group('ATYPE')))
|
||||||
|
|
||||||
|
|
||||||
def readShowdownActions(self, hand):
|
def readShowdownActions(self, hand):
|
||||||
|
|
|
@ -403,7 +403,7 @@ class Winamax(HandHistoryConverter):
|
||||||
elif action.group('ATYPE') == ' stands pat':
|
elif action.group('ATYPE') == ' stands pat':
|
||||||
hand.addStandsPat( street, action.group('PNAME'))
|
hand.addStandsPat( street, action.group('PNAME'))
|
||||||
else:
|
else:
|
||||||
log.fatal(_("DEBUG: ") + _("Unimplemented readAction: '%s' '%s'") % (action.group('PNAME'), action.group('ATYPE')))
|
log.fatal(_("DEBUG:") + _("Unimplemented %s: '%s' '%s'") % ("readAction", action.group('PNAME'), action.group('ATYPE')))
|
||||||
# print "Processed %s"%acts
|
# print "Processed %s"%acts
|
||||||
# print "committed=",hand.pot.committed
|
# print "committed=",hand.pot.committed
|
||||||
|
|
||||||
|
|
202
pyfpdb/fpdb.pyw
202
pyfpdb/fpdb.pyw
|
@ -310,8 +310,8 @@ class fpdb:
|
||||||
for t in self.threads:
|
for t in self.threads:
|
||||||
log.debug("........." + str(t.__class__))
|
log.debug("........." + str(t.__class__))
|
||||||
|
|
||||||
def dia_preferences(self, widget, data=None):
|
def dia_advanced_preferences(self, widget, data=None):
|
||||||
dia = gtk.Dialog(_("Preferences"),
|
dia = gtk.Dialog(_("Advanced Preferences"),
|
||||||
self.window,
|
self.window,
|
||||||
gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT,
|
gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT,
|
||||||
(gtk.STOCK_CANCEL, gtk.RESPONSE_REJECT,
|
(gtk.STOCK_CANCEL, gtk.RESPONSE_REJECT,
|
||||||
|
@ -323,13 +323,7 @@ class fpdb:
|
||||||
if response == gtk.RESPONSE_ACCEPT:
|
if response == gtk.RESPONSE_ACCEPT:
|
||||||
# save updated config
|
# save updated config
|
||||||
self.config.save()
|
self.config.save()
|
||||||
if len(self.nb_tab_names) == 1:
|
self.reload_config(dia)
|
||||||
# only main tab open, reload profile
|
|
||||||
self.load_profile()
|
|
||||||
dia.destroy()
|
|
||||||
else:
|
|
||||||
dia.destroy() # destroy prefs before raising warning, otherwise parent is dia rather than self.window
|
|
||||||
self.warning_box(_("Updated preferences have not been loaded because windows are open. Re-start fpdb to load them."))
|
|
||||||
else:
|
else:
|
||||||
dia.destroy()
|
dia.destroy()
|
||||||
|
|
||||||
|
@ -371,24 +365,29 @@ class fpdb:
|
||||||
diatitle=_("Database Statistics"))
|
diatitle=_("Database Statistics"))
|
||||||
#end def dia_database_stats
|
#end def dia_database_stats
|
||||||
|
|
||||||
def diaHudConfigurator(self, widget, data=None):
|
def dia_hud_preferences(self, widget, data=None):
|
||||||
"""Opens dialog to set parameters (game category, row count, column count for HUD stat configurator"""
|
"""Opens dialog to set parameters (game category, row count, column count) for HUD preferences"""
|
||||||
self.hudConfiguratorRows = None
|
#Note: No point in working on this until the new HUD configuration system is in place
|
||||||
self.hudConfiguratorColumns = None
|
self.hud_preferences_rows = None
|
||||||
self.hudConfiguratorGame = None
|
self.hud_preferences_columns = None
|
||||||
|
self.hud_preferences_game = None
|
||||||
|
|
||||||
diaSelections = gtk.Dialog(_("HUD Configurator - choose category"),
|
diaSelections = gtk.Dialog(_("HUD Preferences - choose category"),
|
||||||
self.window,
|
self.window,
|
||||||
gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT,
|
gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT,
|
||||||
(gtk.STOCK_OK, gtk.RESPONSE_ACCEPT,
|
(gtk.STOCK_OK, gtk.RESPONSE_ACCEPT,
|
||||||
gtk.STOCK_CANCEL, gtk.RESPONSE_REJECT))
|
gtk.STOCK_CANCEL, gtk.RESPONSE_REJECT))
|
||||||
|
|
||||||
|
label = gtk.Label(_("Note that this does not existing settings, but overwrites them."))
|
||||||
|
diaSelections.vbox.add(label)
|
||||||
|
label.show()
|
||||||
|
|
||||||
label = gtk.Label(_("Please select the game category for which you want to configure HUD stats:"))
|
label = gtk.Label(_("Please select the game category for which you want to configure HUD stats:"))
|
||||||
diaSelections.vbox.add(label)
|
diaSelections.vbox.add(label)
|
||||||
label.show()
|
label.show()
|
||||||
|
|
||||||
comboGame = gtk.combo_box_new_text()
|
comboGame = gtk.combo_box_new_text()
|
||||||
comboGame.connect("changed", self.hudConfiguratorComboSelection)
|
comboGame.connect("changed", self.hud_preferences_combo_selection)
|
||||||
diaSelections.vbox.add(comboGame)
|
diaSelections.vbox.add(comboGame)
|
||||||
games = self.config.get_supported_games()
|
games = self.config.get_supported_games()
|
||||||
for game in games:
|
for game in games:
|
||||||
|
@ -397,7 +396,7 @@ class fpdb:
|
||||||
comboGame.show()
|
comboGame.show()
|
||||||
|
|
||||||
comboRows = gtk.combo_box_new_text()
|
comboRows = gtk.combo_box_new_text()
|
||||||
comboRows.connect("changed", self.hudConfiguratorComboSelection)
|
comboRows.connect("changed", self.hud_preferences_combo_selection)
|
||||||
diaSelections.vbox.add(comboRows)
|
diaSelections.vbox.add(comboRows)
|
||||||
for i in range(1, 8):
|
for i in range(1, 8):
|
||||||
comboRows.append_text(str(i) + " rows")
|
comboRows.append_text(str(i) + " rows")
|
||||||
|
@ -405,7 +404,7 @@ class fpdb:
|
||||||
comboRows.show()
|
comboRows.show()
|
||||||
|
|
||||||
comboColumns = gtk.combo_box_new_text()
|
comboColumns = gtk.combo_box_new_text()
|
||||||
comboColumns.connect("changed", self.hudConfiguratorComboSelection)
|
comboColumns.connect("changed", self.hud_preferences_combo_selection)
|
||||||
diaSelections.vbox.add(comboColumns)
|
diaSelections.vbox.add(comboColumns)
|
||||||
for i in range(1, 8):
|
for i in range(1, 8):
|
||||||
comboColumns.append_text(str(i) + " columns")
|
comboColumns.append_text(str(i) + " columns")
|
||||||
|
@ -416,29 +415,27 @@ class fpdb:
|
||||||
diaSelections.destroy()
|
diaSelections.destroy()
|
||||||
|
|
||||||
if (response == gtk.RESPONSE_ACCEPT and
|
if (response == gtk.RESPONSE_ACCEPT and
|
||||||
self.hudConfiguratorRows != None and
|
self.hud_preferences_rows != None and
|
||||||
self.hudConfiguratorColumns != None and
|
self.hud_preferences_columns != None and
|
||||||
self.hudConfiguratorGame != None):
|
self.hud_preferences_game != None):
|
||||||
#print "clicked ok and selected:", self.hudConfiguratorGame,"with", str(self.hudConfiguratorRows), "rows and", str(self.hudConfiguratorColumns), "columns"
|
self.dia_hud_preferences_table()
|
||||||
self.diaHudConfiguratorTable()
|
#end def dia_hud_preferences
|
||||||
#end def diaHudConfigurator
|
|
||||||
|
|
||||||
def hudConfiguratorComboSelection(self, widget):
|
def hud_preferences_combo_selection(self, widget):
|
||||||
#TODO: remove this and handle it directly in diaHudConfigurator
|
#TODO: remove this and handle it directly in dia_hud_preferences
|
||||||
result = widget.get_active_text()
|
result = widget.get_active_text()
|
||||||
if result.endswith(" rows"):
|
if result.endswith(" rows"):
|
||||||
self.hudConfiguratorRows = int(result[0])
|
self.hud_preferences_rows = int(result[0])
|
||||||
elif result.endswith(" columns"):
|
elif result.endswith(" columns"):
|
||||||
self.hudConfiguratorColumns = int(result[0])
|
self.hud_preferences_columns = int(result[0])
|
||||||
else:
|
else:
|
||||||
self.hudConfiguratorGame = result
|
self.hud_preferences_game = result
|
||||||
#end def hudConfiguratorComboSelection
|
#end def hud_preferences_combo_selection
|
||||||
|
|
||||||
def diaHudConfiguratorTable(self):
|
def dia_hud_preferences_table(self):
|
||||||
"""shows dialogue with Table of ComboBoxes to allow choosing of HUD stats"""
|
"""shows dialogue with Table of ComboBoxes to allow choosing of HUD stats"""
|
||||||
#TODO: add notices to hud configurator: no duplicates, no empties, display options
|
|
||||||
#TODO: show explanation of what each stat means
|
#TODO: show explanation of what each stat means
|
||||||
diaHudTable = gtk.Dialog(_("HUD Configurator - please choose your stats"),
|
diaHudTable = gtk.Dialog(_("HUD Preferences - please choose your stats"),
|
||||||
self.window,
|
self.window,
|
||||||
gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT,
|
gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT,
|
||||||
(gtk.STOCK_SAVE, gtk.RESPONSE_ACCEPT,
|
(gtk.STOCK_SAVE, gtk.RESPONSE_ACCEPT,
|
||||||
|
@ -456,12 +453,12 @@ class fpdb:
|
||||||
diaHudTable.vbox.add(label)
|
diaHudTable.vbox.add(label)
|
||||||
label.show()
|
label.show()
|
||||||
|
|
||||||
label = gtk.Label(_("To configure things like colouring you will still have to use the Preferences dialogue or manually edit your HUD_config.xml."))
|
label = gtk.Label(_("To configure things like colouring you will still have to use the Advanced Preferences dialogue or manually edit your HUD_config.xml."))
|
||||||
diaHudTable.vbox.add(label)
|
diaHudTable.vbox.add(label)
|
||||||
label.show()
|
label.show()
|
||||||
|
|
||||||
self.hudConfiguratorTableContents = []
|
self.hud_preferences_table_contents = []
|
||||||
table = gtk.Table(rows=self.hudConfiguratorRows + 1, columns=self.hudConfiguratorColumns + 1, homogeneous=True)
|
table = gtk.Table(rows=self.hud_preferences_rows + 1, columns=self.hud_preferences_columns + 1, homogeneous=True)
|
||||||
|
|
||||||
statDir = dir(Stats)
|
statDir = dir(Stats)
|
||||||
statDict = {}
|
statDict = {}
|
||||||
|
@ -474,9 +471,9 @@ class fpdb:
|
||||||
continue
|
continue
|
||||||
statDict[attr] = eval("Stats.%s.__doc__" % (attr))
|
statDict[attr] = eval("Stats.%s.__doc__" % (attr))
|
||||||
|
|
||||||
for rowNumber in range(self.hudConfiguratorRows + 1):
|
for rowNumber in range(self.hud_preferences_rows + 1):
|
||||||
newRow = []
|
newRow = []
|
||||||
for columnNumber in range(self.hudConfiguratorColumns + 1):
|
for columnNumber in range(self.hud_preferences_columns + 1):
|
||||||
if rowNumber == 0:
|
if rowNumber == 0:
|
||||||
if columnNumber == 0:
|
if columnNumber == 0:
|
||||||
pass
|
pass
|
||||||
|
@ -509,7 +506,7 @@ class fpdb:
|
||||||
|
|
||||||
comboBox.show()
|
comboBox.show()
|
||||||
if rowNumber != 0:
|
if rowNumber != 0:
|
||||||
self.hudConfiguratorTableContents.append(newRow)
|
self.hud_preferences_table_contents.append(newRow)
|
||||||
diaHudTable.vbox.add(table)
|
diaHudTable.vbox.add(table)
|
||||||
table.show()
|
table.show()
|
||||||
|
|
||||||
|
@ -518,20 +515,20 @@ class fpdb:
|
||||||
|
|
||||||
if response == gtk.RESPONSE_ACCEPT:
|
if response == gtk.RESPONSE_ACCEPT:
|
||||||
self.storeNewHudStatConfig()
|
self.storeNewHudStatConfig()
|
||||||
#end def diaHudConfiguratorTable
|
#end def dia_hud_preferences_table
|
||||||
|
|
||||||
def storeNewHudStatConfig(self):
|
def storeNewHudStatConfig(self):
|
||||||
"""stores selections made in diaHudConfiguratorTable"""
|
"""stores selections made in dia_hud_preferences_table"""
|
||||||
self.obtain_global_lock("diaHudConfiguratorTable")
|
self.obtain_global_lock("dia_hud_preferences")
|
||||||
statTable = []
|
statTable = []
|
||||||
for row in self.hudConfiguratorTableContents:
|
for row in self.hud_preferences_table_contents:
|
||||||
newRow = []
|
newRow = []
|
||||||
for column in row:
|
for column in row:
|
||||||
newField = column.get_active_text()
|
newField = column.get_active_text()
|
||||||
newRow.append(newField)
|
newRow.append(newField)
|
||||||
statTable.append(newRow)
|
statTable.append(newRow)
|
||||||
|
|
||||||
self.config.editStats(self.hudConfiguratorGame, statTable)
|
self.config.editStats(self.hud_preferences_game, statTable)
|
||||||
self.config.save() # TODO: make it not store in horrible formatting
|
self.config.save() # TODO: make it not store in horrible formatting
|
||||||
self.release_global_lock()
|
self.release_global_lock()
|
||||||
#end def storeNewHudStatConfig
|
#end def storeNewHudStatConfig
|
||||||
|
@ -545,29 +542,6 @@ class fpdb:
|
||||||
dumpFile.close()
|
dumpFile.close()
|
||||||
#end def dia_database_stats
|
#end def dia_database_stats
|
||||||
|
|
||||||
def dia_load_profile(self, widget, data=None):
|
|
||||||
"""Dialogue to select a file to load a profile from"""
|
|
||||||
if self.obtain_global_lock("fpdb.dia_load_profile"): # returns true if successful
|
|
||||||
#try:
|
|
||||||
# chooser = gtk.FileChooserDialog(title="Please select a profile file to load",
|
|
||||||
# action=gtk.FILE_CHOOSER_ACTION_OPEN,
|
|
||||||
# buttons=(gtk.STOCK_CANCEL,gtk.RESPONSE_CANCEL,gtk.STOCK_OPEN,gtk.RESPONSE_OK))
|
|
||||||
# chooser.set_filename(self.profile)
|
|
||||||
|
|
||||||
# response = chooser.run()
|
|
||||||
# chooser.destroy()
|
|
||||||
# if response == gtk.RESPONSE_OK:
|
|
||||||
# self.load_profile(chooser.get_filename())
|
|
||||||
# elif response == gtk.RESPONSE_CANCEL:
|
|
||||||
# print 'User cancelled loading profile'
|
|
||||||
#except:
|
|
||||||
# pass
|
|
||||||
#try:
|
|
||||||
self.load_profile()
|
|
||||||
#except:
|
|
||||||
# pass
|
|
||||||
self.release_global_lock()
|
|
||||||
|
|
||||||
def dia_recreate_tables(self, widget, data=None):
|
def dia_recreate_tables(self, widget, data=None):
|
||||||
"""Dialogue that asks user to confirm that he wants to delete and recreate the tables"""
|
"""Dialogue that asks user to confirm that he wants to delete and recreate the tables"""
|
||||||
if self.obtain_global_lock("fpdb.dia_recreate_tables"): # returns true if successful
|
if self.obtain_global_lock("fpdb.dia_recreate_tables"): # returns true if successful
|
||||||
|
@ -723,6 +697,78 @@ class fpdb:
|
||||||
#if lock_set:
|
#if lock_set:
|
||||||
# self.release_global_lock()
|
# self.release_global_lock()
|
||||||
|
|
||||||
|
def dia_site_preferences(self, widget, data=None):
|
||||||
|
dia = gtk.Dialog(_("Site Preferences"), self.window,
|
||||||
|
gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT,
|
||||||
|
(gtk.STOCK_SAVE, gtk.RESPONSE_ACCEPT, gtk.STOCK_CANCEL, gtk.RESPONSE_REJECT))
|
||||||
|
label = gtk.Label(_("Please select which sites you play on and enter your usernames."))
|
||||||
|
dia.vbox.add(label)
|
||||||
|
|
||||||
|
site_names = self.config.site_ids
|
||||||
|
available_site_names=[]
|
||||||
|
for site_name in site_names:
|
||||||
|
try:
|
||||||
|
tmp = self.config.supported_sites[site_name].enabled
|
||||||
|
available_site_names.append(site_name)
|
||||||
|
except KeyError:
|
||||||
|
pass
|
||||||
|
|
||||||
|
label = gtk.Label(_(" "))
|
||||||
|
dia.vbox.add(label)
|
||||||
|
|
||||||
|
column_headers=[_("Site"), _("Screen Name"), _("History Path")] #TODO , _("Summary Path"), _("HUD")]
|
||||||
|
#HUD column will contain a button that shows favseat and HUD locations. Make it possible to load screenshot to arrange HUD windowlets.
|
||||||
|
table = gtk.Table(rows=len(available_site_names)+1, columns=len(column_headers), homogeneous=False)
|
||||||
|
dia.vbox.add(table)
|
||||||
|
|
||||||
|
for header_number in range (0, len(column_headers)):
|
||||||
|
label = gtk.Label(column_headers[header_number])
|
||||||
|
table.attach(label, header_number, header_number+1, 0, 1)
|
||||||
|
|
||||||
|
check_buttons=[]
|
||||||
|
screen_names=[]
|
||||||
|
history_paths=[]
|
||||||
|
y_pos=1
|
||||||
|
for site_number in range(0, len(available_site_names)):
|
||||||
|
check_button = gtk.CheckButton(label=available_site_names[site_number])
|
||||||
|
check_button.set_active(self.config.supported_sites[available_site_names[site_number]].enabled)
|
||||||
|
table.attach(check_button, 0, 1, y_pos, y_pos+1)
|
||||||
|
check_buttons.append(check_button)
|
||||||
|
|
||||||
|
entry = gtk.Entry()
|
||||||
|
entry.set_text(self.config.supported_sites[available_site_names[site_number]].screen_name)
|
||||||
|
table.attach(entry, 1, 2, y_pos, y_pos+1)
|
||||||
|
screen_names.append(entry)
|
||||||
|
|
||||||
|
entry = gtk.Entry()
|
||||||
|
entry.set_text(self.config.supported_sites[available_site_names[site_number]].HH_path)
|
||||||
|
table.attach(entry, 2, 3, y_pos, y_pos+1)
|
||||||
|
history_paths.append(entry)
|
||||||
|
|
||||||
|
y_pos+=1
|
||||||
|
|
||||||
|
dia.show_all()
|
||||||
|
response = dia.run()
|
||||||
|
if (response == gtk.RESPONSE_ACCEPT):
|
||||||
|
for site_number in range(0, len(available_site_names)):
|
||||||
|
#print "site %s enabled=%s name=%s" % (available_site_names[site_number], check_buttons[site_number].get_active(), screen_names[site_number].get_text(), history_paths[site_number].get_text())
|
||||||
|
self.config.edit_site(available_site_names[site_number], str(check_buttons[site_number].get_active()), screen_names[site_number].get_text(), history_paths[site_number].get_text())
|
||||||
|
|
||||||
|
self.config.save()
|
||||||
|
self.reload_config(dia)
|
||||||
|
|
||||||
|
dia.destroy()
|
||||||
|
|
||||||
|
def reload_config(self, dia):
|
||||||
|
if len(self.nb_tab_names) == 1:
|
||||||
|
# only main tab open, reload profile
|
||||||
|
self.load_profile()
|
||||||
|
dia.destroy() # destroy prefs before raising warning, otherwise parent is dia rather than self.window
|
||||||
|
self.warning_box(_("If you had previously opened any tabs they cannot use the new settings without restart.")+" "+_("Re-start fpdb to load them."))
|
||||||
|
else:
|
||||||
|
dia.destroy() # destroy prefs before raising warning, otherwise parent is dia rather than self.window
|
||||||
|
self.warning_box(_("Updated preferences have not been loaded because windows are open.")+" "+_("Re-start fpdb to load them."))
|
||||||
|
|
||||||
def addLogText(self, text):
|
def addLogText(self, text):
|
||||||
end_iter = self.logbuffer.get_end_iter()
|
end_iter = self.logbuffer.get_end_iter()
|
||||||
self.logbuffer.insert(end_iter, text)
|
self.logbuffer.insert(end_iter, text)
|
||||||
|
@ -792,10 +838,10 @@ class fpdb:
|
||||||
<ui>
|
<ui>
|
||||||
<menubar name="MenuBar">
|
<menubar name="MenuBar">
|
||||||
<menu action="main">
|
<menu action="main">
|
||||||
<menuitem action="LoadProf"/>
|
|
||||||
<menuitem action="SaveProf"/>
|
<menuitem action="SaveProf"/>
|
||||||
<menuitem action="hudConfigurator"/>
|
<menuitem action="site_preferences"/>
|
||||||
<menuitem action="Preferences"/>
|
<menuitem action="hud_preferences"/>
|
||||||
|
<menuitem action="advanced_preferences"/>
|
||||||
<separator/>
|
<separator/>
|
||||||
<menuitem action="Quit"/>
|
<menuitem action="Quit"/>
|
||||||
</menu>
|
</menu>
|
||||||
|
@ -807,7 +853,7 @@ class fpdb:
|
||||||
</menu>
|
</menu>
|
||||||
<menu action="viewers">
|
<menu action="viewers">
|
||||||
<menuitem action="autoimp"/>
|
<menuitem action="autoimp"/>
|
||||||
<menuitem action="hudConfigurator"/>
|
<menuitem action="hud_preferences"/>
|
||||||
<menuitem action="graphs"/>
|
<menuitem action="graphs"/>
|
||||||
<menuitem action="tourneygraphs"/>
|
<menuitem action="tourneygraphs"/>
|
||||||
<menuitem action="ringplayerstats"/>
|
<menuitem action="ringplayerstats"/>
|
||||||
|
@ -841,16 +887,16 @@ class fpdb:
|
||||||
# Create actions
|
# Create actions
|
||||||
actiongroup.add_actions([('main', None, _('_Main')),
|
actiongroup.add_actions([('main', None, _('_Main')),
|
||||||
('Quit', gtk.STOCK_QUIT, _('_Quit'), None, 'Quit the Program', self.quit),
|
('Quit', gtk.STOCK_QUIT, _('_Quit'), None, 'Quit the Program', self.quit),
|
||||||
('LoadProf', None, _('_Load Profile (broken)'), _('<control>L'), 'Load your profile', self.dia_load_profile),
|
('SaveProf', None, _('Save Profile (todo)'), None, 'Save your profile', self.dia_save_profile),
|
||||||
('SaveProf', None, _('_Save Profile (todo)'), _('<control>S'), 'Save your profile', self.dia_save_profile),
|
('site_preferences', None, _('_Site Preferences'), None, 'Site Preferences', self.dia_site_preferences),
|
||||||
('Preferences', None, _('Pre_ferences'), _('<control>F'), 'Edit your preferences', self.dia_preferences),
|
('advanced_preferences', None, _('_Advanced Preferences'), _('<control>F'), 'Edit your preferences', self.dia_advanced_preferences),
|
||||||
('import', None, _('_Import')),
|
('import', None, _('_Import')),
|
||||||
('bulkimp', None, _('_Bulk Import'), _('<control>B'), 'Bulk Import', self.tab_bulk_import),
|
('bulkimp', None, _('_Bulk Import'), _('<control>B'), 'Bulk Import', self.tab_bulk_import),
|
||||||
('tourneyimp', None, _('Tournament _Results Import'), _('<control>R'), 'Tournament Results Import', self.tab_tourney_import),
|
('tourneyimp', None, _('Tournament _Results Import'), _('<control>R'), 'Tournament Results Import', self.tab_tourney_import),
|
||||||
('imapimport', None, _('_Import through eMail/IMAP'), _('<control>I'), 'Import through eMail/IMAP', self.tab_imap_import),
|
('imapimport', None, _('_Import through eMail/IMAP'), _('<control>I'), 'Import through eMail/IMAP', self.tab_imap_import),
|
||||||
('viewers', None, _('_Viewers')),
|
('viewers', None, _('_Viewers')),
|
||||||
('autoimp', None, _('_Auto Import and HUD'), _('<control>A'), 'Auto Import and HUD', self.tab_auto_import),
|
('autoimp', None, _('_Auto Import and HUD'), _('<control>A'), 'Auto Import and HUD', self.tab_auto_import),
|
||||||
('hudConfigurator', None, _('_HUD Configurator'), _('<control>H'), 'HUD Configurator', self.diaHudConfigurator),
|
('hud_preferences', None, _('_HUD Preferences'), _('<control>H'), 'HUD Preferences', self.dia_hud_preferences),
|
||||||
('graphs', None, _('_Graphs'), _('<control>G'), 'Graphs', self.tabGraphViewer),
|
('graphs', None, _('_Graphs'), _('<control>G'), 'Graphs', self.tabGraphViewer),
|
||||||
('tourneygraphs', None, _('Tourney Graphs'), None, 'TourneyGraphs', self.tabTourneyGraphViewer),
|
('tourneygraphs', None, _('Tourney Graphs'), None, 'TourneyGraphs', self.tabTourneyGraphViewer),
|
||||||
('stove', None, _('Stove (preview)'), None, 'Stove', self.tabStove),
|
('stove', None, _('Stove (preview)'), None, 'Stove', self.tabStove),
|
||||||
|
@ -895,8 +941,8 @@ class fpdb:
|
||||||
print (_("Logfile is %s\n") % os.path.join(self.config.dir_log, self.config.log_file))
|
print (_("Logfile is %s\n") % os.path.join(self.config.dir_log, self.config.log_file))
|
||||||
if self.config.example_copy:
|
if self.config.example_copy:
|
||||||
self.info_box(_("Config file"),
|
self.info_box(_("Config file"),
|
||||||
_("has been created at:\n%s.\n") % self.config.file
|
_("Config file has been created at:") + ("\n%s.\n") % self.config.file
|
||||||
+ _("Edit your screen_name and hand history path in the supported_sites section of the Preferences window (Main menu) before trying to import hands."))
|
+ _("Edit your screen_name and hand history path in the supported_sites section of the Advanced Preferences window (Main menu) before trying to import hands."))
|
||||||
self.settings = {}
|
self.settings = {}
|
||||||
self.settings['global_lock'] = self.lock
|
self.settings['global_lock'] = self.lock
|
||||||
if (os.sep == "/"):
|
if (os.sep == "/"):
|
||||||
|
@ -1338,7 +1384,7 @@ You can find the full license texts in agpl-3.0.txt, gpl-2.0.txt, gpl-3.0.txt an
|
||||||
except KeyError, exc:
|
except KeyError, exc:
|
||||||
log.warning("site %s missing from db" % site)
|
log.warning("site %s missing from db" % site)
|
||||||
dia = gtk.MessageDialog(parent=None, flags=0, type=gtk.MESSAGE_WARNING, buttons=(gtk.BUTTONS_YES_NO), message_format="Unknown Site")
|
dia = gtk.MessageDialog(parent=None, flags=0, type=gtk.MESSAGE_WARNING, buttons=(gtk.BUTTONS_YES_NO), message_format="Unknown Site")
|
||||||
diastring = _("WARNING: Unable to find site '%s'\n\nPress YES to add this site to the database.") % site
|
diastring = _("Warning:") +" " + _("Unable to find site '%s'\n\nPress YES to add this site to the database.") % site
|
||||||
dia.format_secondary_text(diastring)
|
dia.format_secondary_text(diastring)
|
||||||
response = dia.run()
|
response = dia.run()
|
||||||
dia.destroy()
|
dia.destroy()
|
||||||
|
|
|
@ -258,7 +258,7 @@ or None if we fail to get the info """
|
||||||
#print "DEBUG: addBringIn(%s, %s)" %(action.group('PNAME'), action.group('BET'))
|
#print "DEBUG: addBringIn(%s, %s)" %(action.group('PNAME'), action.group('BET'))
|
||||||
hand.addBringIn(action.group('PNAME'), action.group('BET'))
|
hand.addBringIn(action.group('PNAME'), action.group('BET'))
|
||||||
else:
|
else:
|
||||||
logging.error(_("DEBUG: ") + _("Unimplemented readAction: '%s' '%s'") % (action.group('PNAME'), action.group('ATYPE')))
|
logging.error(_("DEBUG:") + " " + _("Unimplemented %s: '%s' '%s'") % ("readAction", action.group('PNAME'), action.group('ATYPE')))
|
||||||
|
|
||||||
def readShowdownActions(self, hand):
|
def readShowdownActions(self, hand):
|
||||||
for shows in self.re_ShowdownAction.finditer(hand.handText):
|
for shows in self.re_ShowdownAction.finditer(hand.handText):
|
||||||
|
|
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,42 @@
|
||||||
|
Everleaf Gaming Game #190075259
|
||||||
|
***** Hand history for game #190075259 *****
|
||||||
|
Blinds $0.01/$0.02 NL Hold'em - 2010/08/03 - 17:03:59
|
||||||
|
Table Los Angeles XV
|
||||||
|
Seat 2 is the button
|
||||||
|
Total number of players: 8
|
||||||
|
Seat 1: zetnik ( $ 0.98 USD )
|
||||||
|
Seat 2: Nadiy1981 ( $ 1.95 USD )
|
||||||
|
Seat 3: rcgott4 ( $ 0.94 USD )
|
||||||
|
Seat 4: MDKILLER69 ( $ 1.80 USD )
|
||||||
|
Seat 5: Serg2407 ( $ 0.40 USD )
|
||||||
|
Seat 8: lenchik_1984 ( $ 1.51 USD )
|
||||||
|
Seat 9: xxx47 ( $ 0.03 USD )
|
||||||
|
Seat 10: maluo ( $ 4.19 USD )
|
||||||
|
rcgott4: posts small blind [$ 0.01 USD]
|
||||||
|
MDKILLER69: posts big blind [$ 0.02 USD]
|
||||||
|
** Dealing down cards **
|
||||||
|
Serg2407 calls [$ 0.02 USD]
|
||||||
|
lenchik_1984 folds
|
||||||
|
xxx47 calls [$ 0.02 USD]
|
||||||
|
maluo folds
|
||||||
|
zetnik calls [$ 0.02 USD]
|
||||||
|
Nadiy1981 folds
|
||||||
|
rcgott4 calls [$ 0.01 USD]
|
||||||
|
MDKILLER69 raises [$ 0.18 USD]
|
||||||
|
Serg2407 folds
|
||||||
|
xxx47 calls [$ 0.01 USD]
|
||||||
|
zetnik raises [$ 0.96 USD]
|
||||||
|
rcgott4 folds
|
||||||
|
MDKILLER69 calls [$ 0.78 USD]
|
||||||
|
** Dealing Flop ** [ 6d, Jc, Js ]
|
||||||
|
** Dealing Turn ** [ 3d ]
|
||||||
|
** Dealing River ** [ 9d ]
|
||||||
|
zetnik shows [ 4c, 4d ] two pairs, jacks and fours
|
||||||
|
MDKILLER69 shows [ 8c, 8h ] two pairs, jacks and eights
|
||||||
|
xxx47 shows [ 5s, Td ] a pair of jacks
|
||||||
|
MDKILLER69 wins $ 0.13 USD from main pot with two pairs, jacks and
|
||||||
|
eights [ Jc, Js, 9d, 8c, 8h ]
|
||||||
|
MDKILLER69 wins $ 1.81 USD from side pot with two pairs, jacks and
|
||||||
|
eights [ Jc, Js, 9d, 8c, 8h ]
|
||||||
|
|
||||||
|
|
|
@ -47,8 +47,8 @@ def testSQLiteVarianceFunction():
|
||||||
cur.execute("SELECT variance(i) from test")
|
cur.execute("SELECT variance(i) from test")
|
||||||
result = cur.fetchone()[0]
|
result = cur.fetchone()[0]
|
||||||
|
|
||||||
print (_("DEBUG: ") + _("Testing variance function"))
|
print (_("DEBUG:") + " " + _("Testing variance function"))
|
||||||
print (_("DEBUG: ") + _("result: %s expecting: 0.666666 (result-expecting ~= 0.0): %s") % (result, (result - 0.66666)))
|
print (_("DEBUG:") + " " + _("result: %s expecting: 0.666666 (result-expecting ~= 0.0): %s") % (result, (result - 0.66666)))
|
||||||
cur.execute("DROP TABLE test")
|
cur.execute("DROP TABLE test")
|
||||||
assert (result - 0.66666) <= 0.0001
|
assert (result - 0.66666) <= 0.0001
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user