add more missing imports and one _()

This commit is contained in:
steffen123 2010-08-16 01:41:25 +02:00
parent a60e715138
commit 2a69e927d2
8 changed files with 95 additions and 1 deletions

View File

@ -30,6 +30,17 @@ import logging
# logging has been set up in fpdb.py or HUD_main.py, use their settings: # logging has been set up in fpdb.py or HUD_main.py, use their settings:
log = logging.getLogger("filter") log = logging.getLogger("filter")
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 Configuration import Configuration
import Database import Database

View File

@ -42,6 +42,18 @@ except ImportError, inst:
and HUD are NOT affected by this problem.""") and HUD are NOT affected by this problem.""")
print "ImportError: %s" % inst.args print "ImportError: %s" % inst.args
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 fpdb_import import fpdb_import
import Database import Database
import Filters import Filters

View File

@ -22,6 +22,18 @@ import gtk
from imaplib import IMAP4 from imaplib import IMAP4
from socket import gaierror from socket import gaierror
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 ImapFetcher import ImapFetcher
class GuiImapFetcher (threading.Thread): class GuiImapFetcher (threading.Thread):

View File

@ -22,6 +22,18 @@ import gtk
import os import os
from time import time, strftime from time import time, strftime
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 fpdb_import import fpdb_import
import Database import Database
import Filters import Filters

View File

@ -41,6 +41,18 @@ except ImportError, inst:
print _("""Failed to load numpy and/or matplotlib in Session Viewer""") print _("""Failed to load numpy and/or matplotlib in Session Viewer""")
print _("ImportError: %s") % inst.args print _("ImportError: %s") % inst.args
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 Card import Card
import fpdb_import import fpdb_import
import Database import Database

View File

@ -24,6 +24,18 @@ import gtk
#import sys #import sys
from time import time, strftime from time import time, strftime
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 Card #import Card
#import fpdb_import #import fpdb_import
#import Database #import Database

View File

@ -20,6 +20,18 @@ import pygtk
pygtk.require('2.0') pygtk.require('2.0')
import gtk import gtk
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
class GuiTourneyViewer (threading.Thread): class GuiTourneyViewer (threading.Thread):
def __init__(self, config, db, sql, mainwin, debug=True): def __init__(self, config, db, sql, mainwin, debug=True):
self.db = db self.db = db

View File

@ -29,6 +29,17 @@ from time import gmtime, mktime, strftime, strptime
import logging #logging has been set up in fpdb.py or HUD_main.py, use their settings: import logging #logging has been set up in fpdb.py or HUD_main.py, use their settings:
log = logging.getLogger("filter") log = logging.getLogger("filter")
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 Configuration #import Configuration
#import Database #import Database
@ -74,7 +85,7 @@ class TourneyFilters(Filters.Filters):
self.numTourneys = int(w.get_text()) self.numTourneys = int(w.get_text())
except: except:
self.numTourneys = 0 self.numTourneys = 0
print "setting numTourneys:", self.numTourneys print _("setting numTourneys:"), self.numTourneys
#end def __set_num_tourneys #end def __set_num_tourneys
def __toggle_box(self, widget, entry): #identical with Filters def __toggle_box(self, widget, entry): #identical with Filters