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

This commit is contained in:
Worros 2010-08-23 13:25:01 +08:00
commit 6da5522965
13 changed files with 361 additions and 290 deletions

View File

@ -450,7 +450,6 @@ def sss():
self.settings['os']="windows" self.settings['os']="windows"
self.settings.update(self.config.get_db_parameters()) self.settings.update(self.config.get_db_parameters())
self.settings.update(self.config.get_tv_parameters())
self.settings.update(self.config.get_import_parameters()) self.settings.update(self.config.get_import_parameters())
self.settings.update(self.config.get_default_paths()) self.settings.update(self.config.get_default_paths())

View File

@ -520,6 +520,20 @@ class General(dict):
log.debug(_("config.general: adding %s = %s") % (name,value)) log.debug(_("config.general: adding %s = %s") % (name,value))
self[name] = value self[name] = value
try:
self["version"]=int(self["version"])
except KeyError:
self["version"]=0
self["ui_language"]="system"
self["config_difficuly"]="expert"
def get_defaults(self):
self["version"]=0
self["ui_language"]="system"
self["config_difficuly"]="expert"
self["config_wrap_len"]="-1"
self["day_start"]="5"
def __str__(self): def __str__(self):
s = "" s = ""
for k in self: for k in self:
@ -703,6 +717,8 @@ class Config:
self.emails = {} self.emails = {}
self.gui_cash_stats = GUICashStats() self.gui_cash_stats = GUICashStats()
if doc.getElementsByTagName("general") == []:
self.general.get_defaults()
for gen_node in doc.getElementsByTagName("general"): for gen_node in doc.getElementsByTagName("general"):
self.general.add_elements(node=gen_node) # add/overwrite elements in self.general self.general.add_elements(node=gen_node) # add/overwrite elements in self.general

View File

@ -334,7 +334,6 @@ if __name__== "__main__":
else: settings['os'] = 'linuxmac' else: settings['os'] = 'linuxmac'
settings.update(config.get_db_parameters('fpdb')) settings.update(config.get_db_parameters('fpdb'))
settings.update(config.get_tv_parameters())
settings.update(config.get_import_parameters()) settings.update(config.get_import_parameters())
settings.update(config.get_default_paths()) settings.update(config.get_default_paths())

View File

@ -53,7 +53,6 @@ class GuiPositionalStats (threading.Thread):
settings = {} settings = {}
settings.update(self.conf.get_db_parameters()) settings.update(self.conf.get_db_parameters())
settings.update(self.conf.get_tv_parameters())
settings.update(self.conf.get_import_parameters()) settings.update(self.conf.get_import_parameters())
settings.update(self.conf.get_default_paths()) settings.update(self.conf.get_default_paths())

View File

@ -82,7 +82,6 @@ class GuiSessionViewer (threading.Thread):
settings = {} settings = {}
settings.update(self.conf.get_db_parameters()) settings.update(self.conf.get_db_parameters())
settings.update(self.conf.get_tv_parameters())
settings.update(self.conf.get_import_parameters()) settings.update(self.conf.get_import_parameters())
settings.update(self.conf.get_default_paths()) settings.update(self.conf.get_default_paths())

View File

@ -5,8 +5,11 @@
<!-- config_wrap_len is preferred max line length in this file, -1 means no max <!-- config_wrap_len is preferred max line length in this file, -1 means no max
day_start is time that logical day starts, e.g. 5 means that any play day_start is time that logical day starts, e.g. 5 means that any play
between 00:00 and 04:59:59 counts as being on the previous day --> between 00:00 and 04:59:59 counts as being on the previous day -->
<general config_wrap_len="-1" <general version="1"
config_wrap_len="-1"
day_start="5" day_start="5"
ui_language="system"
config_difficuly="expert"
/> />
<import callFpdbHud = "True" interval = "10" fastStoreHudCache="False" hhArchiveBase="~/.fpdb/HandHistories/" saveActions="True"></import> <import callFpdbHud = "True" interval = "10" fastStoreHudCache="False" hhArchiveBase="~/.fpdb/HandHistories/" saveActions="True"></import>

View File

@ -320,10 +320,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") % player print (_("DEBUG: checkPlayerExists %s fail on hand number %s") % (player, self.handid))
raise FpdbParseError(_("checkPlayerExists: '%s' failed.") % player) 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))

View File

@ -1,3 +1,4 @@
# -*- coding: utf-8 -*-
import sys import sys
import os import os
import codecs import codecs
@ -76,7 +77,6 @@ def main(argv=None):
sql = SQL.Sql(db_server = 'sqlite') sql = SQL.Sql(db_server = 'sqlite')
settings = {} settings = {}
settings.update(config.get_db_parameters()) settings.update(config.get_db_parameters())
settings.update(config.get_tv_parameters())
settings.update(config.get_import_parameters()) settings.update(config.get_import_parameters())
settings.update(config.get_default_paths()) settings.update(config.get_default_paths())
db.recreate_tables() db.recreate_tables()

View File

@ -1 +1,3 @@
cd ..
python /usr/share/doc/python-2.7/examples/Tools/i18n/msgfmt.py --output-file=locale/hu/LC_MESSAGES/fpdb.mo locale/fpdb-hu_HU.po python /usr/share/doc/python-2.7/examples/Tools/i18n/msgfmt.py --output-file=locale/hu/LC_MESSAGES/fpdb.mo locale/fpdb-hu_HU.po

View File

@ -1,2 +1,3 @@
cd ..
python /usr/share/doc/python-2.7/examples/Tools/i18n/pygettext.py --output-dir=locale --default-domain=fpdb --output=fpdb-en_GB.po *.py* python /usr/share/doc/python-2.7/examples/Tools/i18n/pygettext.py --output-dir=locale --default-domain=fpdb --output=fpdb-en_GB.po *.py*

File diff suppressed because it is too large Load Diff

View File

@ -30,7 +30,6 @@ sql = SQL.Sql(db_server = 'sqlite')
settings = {} settings = {}
settings.update(config.get_db_parameters()) settings.update(config.get_db_parameters())
settings.update(config.get_tv_parameters())
settings.update(config.get_import_parameters()) settings.update(config.get_import_parameters())
settings.update(config.get_default_paths()) settings.update(config.get_default_paths())

View File

@ -30,7 +30,6 @@ sql = SQL.Sql(db_server = 'sqlite')
settings = {} settings = {}
settings.update(config.get_db_parameters()) settings.update(config.get_db_parameters())
settings.update(config.get_tv_parameters())
settings.update(config.get_import_parameters()) settings.update(config.get_import_parameters())
settings.update(config.get_default_paths()) settings.update(config.get_default_paths())