Merge branch 'master' of git://git.assembla.com/fpdb

This commit is contained in:
gimick 2011-03-05 18:04:23 +00:00
commit 57196d531d
17 changed files with 36 additions and 24 deletions

View File

@ -163,8 +163,8 @@ def get_logger(file_name, config = "config", fallback = False, log_dir=None, log
log = logging.basicConfig(filename=file, level=logging.INFO) log = logging.basicConfig(filename=file, level=logging.INFO)
log = logging.getLogger() log = logging.getLogger()
# but it looks like default is no output :-( maybe because all the calls name a module? # but it looks like default is no output :-( maybe because all the calls name a module?
log.debug(_("Default logger initialised for ")+file) log.debug(_("Default logger initialised for %s") % file)
print _("Default logger intialised for ")+file print(_("Default logger initialised for %s") % file)
return log return log
def check_dir(path, create = True): def check_dir(path, create = True):
@ -834,7 +834,7 @@ class Config:
try: try:
example_doc = xml.dom.minidom.parse(example_file) example_doc = xml.dom.minidom.parse(example_file)
except: except:
log.error(_("Error parsing example file %s. See error log file.") % (example_file)) log.error(_("Error parsing example configuration file %s. See error log file.") % (example_file))
return nodes_added return nodes_added
for cnode in doc.getElementsByTagName("FreePokerToolsConfig"): for cnode in doc.getElementsByTagName("FreePokerToolsConfig"):

View File

@ -464,6 +464,7 @@ class Database:
log.warning(_("Some database functions will not work without NumPy support")) log.warning(_("Some database functions will not work without NumPy support"))
self.cursor = self.connection.cursor() self.cursor = self.connection.cursor()
self.cursor.execute('PRAGMA temp_store=2') # use memory for temp tables/indexes self.cursor.execute('PRAGMA temp_store=2') # use memory for temp tables/indexes
self.cursor.execute('PRAGMA journal_mode=WAL') # use memory for temp tables/indexes
self.cursor.execute('PRAGMA synchronous=0') # don't wait for file writes to finish self.cursor.execute('PRAGMA synchronous=0') # don't wait for file writes to finish
else: else:
raise FpdbError("sqlite database "+database+" does not exist") raise FpdbError("sqlite database "+database+" does not exist")
@ -1168,7 +1169,7 @@ 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 _("Creating mysql index %s %s") % (idx['tab'], idx['col']) print _("Creating MySQL 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)
@ -1177,7 +1178,7 @@ class Database:
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 pg index "), idx['tab'], idx['col'] print _("Creating PostgreSQL index "), 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)
@ -1422,22 +1423,22 @@ 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") print _("Only MySQL and Postgres supported so far")

View File

@ -160,7 +160,6 @@ class Filters(threading.Thread):
self.types = {} # list of all ring/tour values self.types = {} # list of all ring/tour values
self.num_limit_types = 0 self.num_limit_types = 0
self.num_limit_types = 0
self.fillLimitsFrame(vbox, self.display) self.fillLimitsFrame(vbox, self.display)
limitsFrame.add(vbox) limitsFrame.add(vbox)

View File

@ -266,7 +266,7 @@ class HUD_main(object):
cards = self.get_cards(new_hand_id) cards = self.get_cards(new_hand_id)
table_kwargs = dict(table_name=table_name, tournament=tour_number, table_number=tab_number) table_kwargs = dict(table_name=table_name, tournament=tour_number, table_number=tab_number)
tablewindow = Tables.Table(self.config, site_name, **table_kwargs) tablewindow = Tables.Table(self.config, site_name, **table_kwargs)
if tablewindow is None: if tablewindow.number is None:
# If no client window is found on the screen, complain and continue # If no client window is found on the screen, complain and continue
if type == "tour": if type == "tour":
table_name = "%s %s" % (tour_number, tab_number) table_name = "%s %s" % (tour_number, tab_number)

View File

@ -73,7 +73,7 @@ class OnGame(HandHistoryConverter):
re_HandInfo = re.compile(u""" re_HandInfo = re.compile(u"""
\*\*\*\*\*\sHistory\sfor\shand\s(?P<HID>[-A-Z\d]+).* \*\*\*\*\*\sHistory\sfor\shand\s(?P<HID>[-A-Z\d]+).*
Start\shand:\s(?P<DATETIME>.*) Start\shand:\s(?P<DATETIME>.*)
Table:\s(\[SPEED\]\s)?(?P<TABLE>[-\'\w\s]+)\s\[\d+\]\s\( Table:\s(\[SPEED\]\s)?(?P<TABLE>[-\'\w\s\.]+)\s\[\d+\]\s\(
( (
(?P<LIMIT>NO_LIMIT|Limit|LIMIT|Pot\sLimit|POT_LIMIT)\s (?P<LIMIT>NO_LIMIT|Limit|LIMIT|Pot\sLimit|POT_LIMIT)\s
(?P<GAME>TEXAS_HOLDEM|OMAHA_HI|SEVEN_CARD_STUD|SEVEN_CARD_STUD_HI_LO|RAZZ|FIVE_CARD_DRAW)\s (?P<GAME>TEXAS_HOLDEM|OMAHA_HI|SEVEN_CARD_STUD|SEVEN_CARD_STUD_HI_LO|RAZZ|FIVE_CARD_DRAW)\s

View File

@ -330,6 +330,12 @@ class PartyPoker(HandHistoryConverter):
# FIXME: there is no such property in Hand class # FIXME: there is no such property in Hand class
self.isSNG = True self.isSNG = True
if key == 'BUYIN': if key == 'BUYIN':
if info[key] == None:
# Freeroll tourney
hand.buyin = 0
hand.fee = 0
hand.buyinCurrency = "FREE"
hand.isKO = False
if hand.tourNo != None: if hand.tourNo != None:
hand.buyin = 0 hand.buyin = 0
hand.fee = 0 hand.fee = 0

View File

@ -34,9 +34,13 @@ import gtk
import gobject import gobject
# FreePokerTools modules # FreePokerTools modules
import Configuration
from HandHistoryConverter import getTableTitleRe from HandHistoryConverter import getTableTitleRe
from HandHistoryConverter import getTableNoRe from HandHistoryConverter import getTableNoRe
c = Configuration.Config()
log = Configuration.get_logger("logging.conf", "hud", log_dir=c.dir_log, log_file='HUD-log.txt')
# Global used for figuring out the current game being played from the title. # Global used for figuring out the current game being played from the title.
# The dict key is a tuple of (limit type, category) for the game. # The dict key is a tuple of (limit type, category) for the game.
# The list is the names for those games used by the supported poker sites # The list is the names for those games used by the supported poker sites

View File

@ -128,7 +128,7 @@ class Table(Table_Window):
des_re = 'No such window with id' des_re = 'No such window with id'
listing = os.popen("xwininfo -id %d -stats" % (self.number)).read() listing = os.popen("xwininfo -id %d -stats" % (self.number)).read()
if listing == "": return
mo = re.search(des_re, listing) mo = re.search(des_re, listing)
if mo is not None: if mo is not None:
return None # table has been destroyed return None # table has been destroyed

Binary file not shown.

Binary file not shown.

View File

@ -3,7 +3,7 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: 0.20.905 plus git\n" "Project-Id-Version: 0.20.905 plus git\n"
"POT-Creation-Date: 2011-02-27 05:51+CET\n" "POT-Creation-Date: 2011-02-27 23:57+CET\n"
"PO-Revision-Date: 2010-08-30 00:57+0200\n" "PO-Revision-Date: 2010-08-30 00:57+0200\n"
"Last-Translator: Steffen Schaumburg <steffen@schaumburger.info>\n" "Last-Translator: Steffen Schaumburg <steffen@schaumburger.info>\n"
"Language-Team: Fpdb\n" "Language-Team: Fpdb\n"
@ -3099,7 +3099,7 @@ msgstr ""
#: fpdb.pyw:38 #: fpdb.pyw:38
msgid " - press return to continue\n" msgid " - press return to continue\n"
msgstr " - drücken Sie Enter um fortzufahren" msgstr " - drücken Sie Enter um fortzufahren\n"
#: fpdb.pyw:45 #: fpdb.pyw:45
msgid "" msgid ""
@ -3133,8 +3133,9 @@ msgid "GuiStove not found. If you want to use it please install pypoker-eval."
msgstr "" msgstr ""
#: fpdb.pyw:244 #: fpdb.pyw:244
#, fuzzy
msgid "" msgid ""
"Copyright 2008-2010, Steffen, Eratosthenes, Carl Gherardi, Eric Blade, _mt, " "Copyright 2008-2011, Steffen, Eratosthenes, Carl Gherardi, Eric Blade, _mt, "
"sqlcoder, Bostik, and others" "sqlcoder, Bostik, and others"
msgstr "" msgstr ""
"Copyright 2008-2010, Steffen, Eratosthenes, Carl Gherardi, Eric Blade, _mt, " "Copyright 2008-2010, Steffen, Eratosthenes, Carl Gherardi, Eric Blade, _mt, "

View File

@ -5,7 +5,7 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2011-02-27 05:51+CET\n" "POT-Creation-Date: 2011-02-27 23:57+CET\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -2990,7 +2990,7 @@ msgid "GuiStove not found. If you want to use it please install pypoker-eval."
msgstr "" msgstr ""
#: fpdb.pyw:244 #: fpdb.pyw:244
msgid "Copyright 2008-2010, Steffen, Eratosthenes, Carl Gherardi, Eric Blade, _mt, sqlcoder, Bostik, and others" msgid "Copyright 2008-2011, Steffen, Eratosthenes, Carl Gherardi, Eric Blade, _mt, sqlcoder, Bostik, and others"
msgstr "" msgstr ""
#: fpdb.pyw:245 #: fpdb.pyw:245

View File

@ -1,7 +1,7 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: fpdb\n" "Project-Id-Version: fpdb\n"
"POT-Creation-Date: 2011-02-27 05:51+CET\n" "POT-Creation-Date: 2011-02-27 23:57+CET\n"
"PO-Revision-Date: \n" "PO-Revision-Date: \n"
"Last-Translator: Javier Sánchez <donoban@gmail.com>\n" "Last-Translator: Javier Sánchez <donoban@gmail.com>\n"
"Language-Team: \n" "Language-Team: \n"
@ -3042,7 +3042,7 @@ msgstr ""
#: fpdb.pyw:244 #: fpdb.pyw:244
msgid "" msgid ""
"Copyright 2008-2010, Steffen, Eratosthenes, Carl Gherardi, Eric Blade, _mt, " "Copyright 2008-2011, Steffen, Eratosthenes, Carl Gherardi, Eric Blade, _mt, "
"sqlcoder, Bostik, and others" "sqlcoder, Bostik, and others"
msgstr "" msgstr ""

View File

@ -5,7 +5,7 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2011-02-27 05:51+CET\n" "POT-Creation-Date: 2011-02-27 23:57+CET\n"
"PO-Revision-Date: 2010-09-09 13:33+0100\n" "PO-Revision-Date: 2010-09-09 13:33+0100\n"
"Last-Translator: \n" "Last-Translator: \n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -3195,7 +3195,7 @@ msgstr ""
#: fpdb.pyw:244 #: fpdb.pyw:244
msgid "" msgid ""
"Copyright 2008-2010, Steffen, Eratosthenes, Carl Gherardi, Eric Blade, _mt, " "Copyright 2008-2011, Steffen, Eratosthenes, Carl Gherardi, Eric Blade, _mt, "
"sqlcoder, Bostik, and others" "sqlcoder, Bostik, and others"
msgstr "" msgstr ""

View File

@ -5,7 +5,7 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: 0.20.905 plus git\n" "Project-Id-Version: 0.20.905 plus git\n"
"POT-Creation-Date: 2011-02-27 05:51+CET\n" "POT-Creation-Date: 2011-02-27 23:57+CET\n"
"PO-Revision-Date: 2011-02-27 18:23+0100\n" "PO-Revision-Date: 2011-02-27 18:23+0100\n"
"Last-Translator: Ferenc Erki <erkiferenc@gmail.com>\n" "Last-Translator: Ferenc Erki <erkiferenc@gmail.com>\n"
"Language-Team: Hungarian <erkiferenc@gmail.com>\n" "Language-Team: Hungarian <erkiferenc@gmail.com>\n"
@ -3183,8 +3183,9 @@ msgstr ""
"eval-t." "eval-t."
#: fpdb.pyw:244 #: fpdb.pyw:244
#, fuzzy
msgid "" msgid ""
"Copyright 2008-2010, Steffen, Eratosthenes, Carl Gherardi, Eric Blade, _mt, " "Copyright 2008-2011, Steffen, Eratosthenes, Carl Gherardi, Eric Blade, _mt, "
"sqlcoder, Bostik, and others" "sqlcoder, Bostik, and others"
msgstr "" msgstr ""
"Copyright 2008-2010, Steffen, Eratosthenes, Carl Gherardi, Eric Blade, _mt, " "Copyright 2008-2010, Steffen, Eratosthenes, Carl Gherardi, Eric Blade, _mt, "

Binary file not shown.

Binary file not shown.