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

This commit is contained in:
Erki Ferenc 2010-08-15 22:55:51 +02:00
commit f6a1881ba7
17 changed files with 175 additions and 47 deletions

View File

@ -23,9 +23,17 @@ import HandHistoryConverter
import Configuration
import sys
import locale
lang=locale.getdefaultlocale()[0][0:2]
if lang=="en":
def _(string): return string
else:
import gettext
trans = gettext.translation("fpdb", localedir="locale", languages=["de_DE"])
try:
trans = gettext.translation("fpdb", localedir="locale", languages=[lang])
trans.install()
except IOError:
def _(string): return string
(options, argv) = Options.fpdb_options()
config = Configuration.Config()

View File

@ -22,9 +22,17 @@ import sys
import logging
from HandHistoryConverter import *
import locale
lang=locale.getdefaultlocale()[0][0:2]
if lang=="en":
def _(string): return string
else:
import gettext
trans = gettext.translation("fpdb", localedir="locale", languages=["de_DE"])
try:
trans = gettext.translation("fpdb", localedir="locale", languages=[lang])
trans.install()
except IOError:
def _(string): return string
# Betfair HH format

View File

@ -15,9 +15,17 @@
#along with this program. If not, see <http://www.gnu.org/licenses/>.
#In the "official" distribution you can find the license in agpl-3.0.txt.
import locale
lang=locale.getdefaultlocale()[0][0:2]
if lang=="en":
def _(string): return string
else:
import gettext
trans = gettext.translation("fpdb", localedir="locale", languages=["de_DE"])
try:
trans = gettext.translation("fpdb", localedir="locale", languages=[lang])
trans.install()
except IOError:
def _(string): return string
# From fpdb_simple
card_map = { "0": 0, "2": 2, "3" : 3, "4" : 4, "5" : 5, "6" : 6, "7" : 7, "8" : 8,

View File

@ -36,6 +36,18 @@ import re
import xml.dom.minidom
from xml.dom.minidom import Node
import locale
lang=locale.getdefaultlocale()[0][0:2]
if lang=="en":
def _(string): return string
else:
import gettext
try:
trans = gettext.translation("fpdb", localedir="locale", languages=[lang])
trans.install()
except IOError:
def _(string): return string
import logging, logging.config
import ConfigParser

View File

@ -33,9 +33,17 @@ import fpdb_import
import Configuration
import Exceptions
import locale
lang=locale.getdefaultlocale()[0][0:2]
if lang=="en":
def _(string): return string
else:
import gettext
trans = gettext.translation("fpdb", localedir="locale", languages=["de_DE"])
try:
trans = gettext.translation("fpdb", localedir="locale", languages=[lang])
trans.install()
except IOError:
def _(string): return string
class GuiBulkImport():

View File

@ -35,9 +35,17 @@ import Exceptions
import Database
import SQL
import locale
lang=locale.getdefaultlocale()[0][0:2]
if lang=="en":
def _(string): return string
else:
import gettext
trans = gettext.translation("fpdb", localedir="locale", languages=["de_DE"])
try:
trans = gettext.translation("fpdb", localedir="locale", languages=[lang])
trans.install()
except IOError:
def _(string): return string
class GuiDatabase:

View File

@ -30,9 +30,17 @@ import logging
# logging has been set up in fpdb.py or HUD_main.py, use their settings:
log = logging.getLogger("logview")
import locale
lang=locale.getdefaultlocale()[0][0:2]
if lang=="en":
def _(string): return string
else:
import gettext
trans = gettext.translation("fpdb", localedir="locale", languages=["de_DE"])
try:
trans = gettext.translation("fpdb", localedir="locale", languages=[lang])
trans.install()
except IOError:
def _(string): return string
MAX_LINES = 100000 # max lines to display in window
EST_CHARS_PER_LINE = 150 # used to guesstimate number of lines in log file

View File

@ -60,9 +60,18 @@ elif os.name == 'nt':
#import Tables
import Hud
import locale
lang=locale.getdefaultlocale()[0][0:2]
print "lang:", lang
if lang=="en":
def _(string): return string
else:
import gettext
trans = gettext.translation("fpdb", localedir="locale", languages=["de_DE"])
try:
trans = gettext.translation("fpdb", localedir="locale", languages=[lang])
trans.install()
except IOError:
def _(string): return string
# get config and set up logger
c = Configuration.Config(file=options.config, dbname=options.dbname)

View File

@ -41,9 +41,17 @@ import Hand
from Exceptions import FpdbParseError
import Configuration
#import gettext
#trans = gettext.translation("fpdb", localedir="locale", languages=["de_DE"])
#trans.install()
import locale
lang=locale.getdefaultlocale()[0][0:2]
if lang=="en":
def _(string): return string
else:
import gettext
try:
trans = gettext.translation("fpdb", localedir="locale", languages=[lang])
trans.install()
except IOError:
def _(string): return string
import pygtk
import gtk

View File

@ -22,9 +22,17 @@
from imaplib import IMAP4, IMAP4_SSL
import PokerStarsSummary
import locale
lang=locale.getdefaultlocale()[0][0:2]
if lang=="en":
def _(string): return string
else:
import gettext
trans = gettext.translation("fpdb", localedir="locale", languages=["de_DE"])
try:
trans = gettext.translation("fpdb", localedir="locale", languages=[lang])
trans.install()
except IOError:
def _(string): return string
def splitPokerStarsSummaries(emailText):
splitSummaries=emailText.split("\nPokerStars Tournament #")[1:]

View File

@ -19,9 +19,17 @@ import sys
from optparse import OptionParser
# http://docs.python.org/library/optparse.html
import locale
lang=locale.getdefaultlocale()[0][0:2]
if lang=="en":
def _(string): return string
else:
import gettext
trans = gettext.translation("fpdb", localedir="locale", languages=["de_DE"])
try:
trans = gettext.translation("fpdb", localedir="locale", languages=[lang])
trans.install()
except IOError:
def _(string): return string
def fpdb_options():

View File

@ -29,8 +29,19 @@ import os
import sys
import re
# Win32 modules
import locale
lang=locale.getdefaultlocale()[0][0:2]
if lang=="en":
def _(string): return string
else:
import gettext
try:
trans = gettext.translation("fpdb", localedir="locale", languages=[lang])
trans.install()
except IOError:
def _(string): return string
# Win32 modules
if os.name == 'nt':
import win32gui
import win32process
@ -220,7 +231,7 @@ def discover_nt(c):
tw.site = "Full Tilt"
else:
tw.site = "Unknown"
sys.stderr.write("Found unknown table = %s" % tw.title)
sys.stderr.write(_("Found unknown table = %s") % tw.title)
if tw.site != "Unknown":
eval("%s(tw)" % c.supported_sites[tw.site].decoder)
else:
@ -247,7 +258,7 @@ def discover_nt_by_name(c, tablename):
if 'Chat:' in titles[hwnd]: continue # Some sites (FTP? PS? Others?) have seperable or seperately constructed chat windows
if ' - Table ' in titles[hwnd]: continue # Absolute table Chat window.. sigh. TODO: Can we tell what site we're trying to discover for somehow in here, so i can limit this check just to AP searches?
temp = decode_windows(c, titles[hwnd], hwnd)
print "attach to window", temp
print _("attach to window"), temp
return temp
return None
@ -434,5 +445,5 @@ if __name__=="__main__":
for t in tables.keys():
print tables[t]
print "press enter to continue"
print _("press enter to continue")
sys.stdin.readline()

View File

@ -36,9 +36,17 @@ import gobject
import Configuration
from HandHistoryConverter import getTableTitleRe
import locale
lang=locale.getdefaultlocale()[0][0:2]
if lang=="en":
def _(string): return string
else:
import gettext
trans = gettext.translation("fpdb", localedir="locale", languages=["de_DE"])
try:
trans = gettext.translation("fpdb", localedir="locale", languages=[lang])
trans.install()
except IOError:
def _(string): return string
# get the correct module for the current os
if os.name == 'posix':

View File

@ -45,9 +45,9 @@ class TourneyFilters(Filters.Filters):
self.conf = db.config
self.display = display
self.filterText = {'playerstitle':'Hero:', 'sitestitle':'Sites:', 'seatstitle':'Number of Players:',
'seatsbetween':'Between:', 'seatsand':'And:', 'datestitle':'Date:',
'tourneyTypesTitle':'Tourney Type'}
self.filterText = {'playerstitle':_('Hero:'), 'sitestitle':_('Sites:'), 'seatstitle':_('Number of Players:'),
'seatsbetween':_('Between:'), 'seatsand':_('And:'), 'datestitle':_('Date:'),
'tourneyTypesTitle':_('Tourney Type')}
gen = self.conf.get_general_params()
self.day_start = 0
@ -102,7 +102,7 @@ class TourneyFilters(Filters.Filters):
if len(result) == 1:
self.siteid[site] = result[0][0]
else:
print "Either 0 or more than one site matched (%s) - EEK" % site
print _("Either 0 or more than one site matched (%s) - EEK") % site
# For use in date ranges.
self.start_date = gtk.Entry(max=12)

View File

@ -20,9 +20,17 @@ import sys
import re
import Queue
import locale
lang=locale.getdefaultlocale()[0][0:2]
if lang=="en":
def _(string): return string
else:
import gettext
trans = gettext.translation("fpdb", localedir="locale", languages=["de_DE"])
try:
trans = gettext.translation("fpdb", localedir="locale", languages=[lang])
trans.install()
except IOError:
def _(string): return string
# if path is set to use an old version of python look for a new one:
# (does this work in linux?)

View File

@ -17,9 +17,17 @@
# create .bat scripts in windows to try out different gtk dirs
import locale
lang=locale.getdefaultlocale()[0][0:2]
if lang=="en":
def _(string): return string
else:
import gettext
trans = gettext.translation("fpdb", localedir="locale", languages=["de_DE"])
try:
trans = gettext.translation("fpdb", localedir="locale", languages=[lang])
trans.install()
except IOError:
def _(string): return string
try: