various gettextifications and skipping of new non-stat fields in HUD configurator
This commit is contained in:
		
							parent
							
								
									c654beee03
								
							
						
					
					
						commit
						8bec7644ef
					
				| 
						 | 
					@ -313,7 +313,7 @@ class GuiAutoImport (threading.Thread):
 | 
				
			||||||
    #enabling and disabling sites from this interface not possible
 | 
					    #enabling and disabling sites from this interface not possible
 | 
				
			||||||
    #expects a box to layout the line horizontally
 | 
					    #expects a box to layout the line horizontally
 | 
				
			||||||
    def createSiteLine(self, hbox1, hbox2, site, iconpath, hhpath, filter_name, active = True):
 | 
					    def createSiteLine(self, hbox1, hbox2, site, iconpath, hhpath, filter_name, active = True):
 | 
				
			||||||
        label = gtk.Label("%s auto-import:" % site)
 | 
					        label = gtk.Label(_("%s auto-import:") % site)
 | 
				
			||||||
        hbox1.pack_start(label, False, False, 3)
 | 
					        hbox1.pack_start(label, False, False, 3)
 | 
				
			||||||
        label.show()
 | 
					        label.show()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -203,7 +203,7 @@ class GuiBulkImport():
 | 
				
			||||||
        if not self.allowThreads:
 | 
					        if not self.allowThreads:
 | 
				
			||||||
            self.spin_threads.set_sensitive(False)
 | 
					            self.spin_threads.set_sensitive(False)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#    checkbox - fail on error?
 | 
					#    checkbox - archive file?
 | 
				
			||||||
        self.is_archive = gtk.CheckButton(_('Archive File'))
 | 
					        self.is_archive = gtk.CheckButton(_('Archive File'))
 | 
				
			||||||
        self.table.attach(self.is_archive, 0, 1, 1, 2, xpadding=10, ypadding=0, yoptions=gtk.SHRINK)
 | 
					        self.table.attach(self.is_archive, 0, 1, 1, 2, xpadding=10, ypadding=0, yoptions=gtk.SHRINK)
 | 
				
			||||||
        self.is_archive.show()
 | 
					        self.is_archive.show()
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -35,10 +35,10 @@ log = logging.getLogger("logview")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
MAX_LINES = 100000         # max lines to display in window
 | 
					MAX_LINES = 100000         # max lines to display in window
 | 
				
			||||||
EST_CHARS_PER_LINE = 150   # used to guesstimate number of lines in log file
 | 
					EST_CHARS_PER_LINE = 150   # used to guesstimate number of lines in log file
 | 
				
			||||||
LOGFILES = [ [ 'Fpdb Errors', 'fpdb-errors.txt', False ]  # label, filename, start value
 | 
					LOGFILES = [ [ _('Fpdb Errors'), 'fpdb-errors.txt', False ]  # label, filename, start value
 | 
				
			||||||
           , [ 'Fpdb Log',    'fpdb-log.txt',    True ]
 | 
					           , [ _('Fpdb Log'),    'fpdb-log.txt',    True ]
 | 
				
			||||||
           , [ 'HUD Errors',  'HUD-errors.txt',  False ]
 | 
					           , [ _('HUD Errors'),  'HUD-errors.txt',  False ]
 | 
				
			||||||
           , [ 'HUD Log',     'HUD-log.txt',     False ]
 | 
					           , [ _('HUD Log'),     'HUD-log.txt',     False ]
 | 
				
			||||||
           ]
 | 
					           ]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class GuiLogView:
 | 
					class GuiLogView:
 | 
				
			||||||
| 
						 | 
					@ -95,10 +95,10 @@ class GuiLogView:
 | 
				
			||||||
        self.vbox.show()
 | 
					        self.vbox.show()
 | 
				
			||||||
        self.dia.set_focus(self.listview)
 | 
					        self.dia.set_focus(self.listview)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        col = self.addColumn("Date/Time", 0)
 | 
					        col = self.addColumn(_("Date/Time"), 0)
 | 
				
			||||||
        col = self.addColumn("Module", 1)
 | 
					        col = self.addColumn(_("Module"), 1)
 | 
				
			||||||
        col = self.addColumn("Level", 2)
 | 
					        col = self.addColumn(_("Level"), 2)
 | 
				
			||||||
        col = self.addColumn("Text", 3)
 | 
					        col = self.addColumn(_("Text"), 3)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        self.loadLog()
 | 
					        self.loadLog()
 | 
				
			||||||
        self.vbox.show_all()
 | 
					        self.vbox.show_all()
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -60,7 +60,7 @@ class GuiPositionalStats (threading.Thread):
 | 
				
			||||||
                          }
 | 
					                          }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        self.filters = Filters.Filters(self.db, self.conf, self.sql, display = filters_display)
 | 
					        self.filters = Filters.Filters(self.db, self.conf, self.sql, display = filters_display)
 | 
				
			||||||
        self.filters.registerButton1Name("Refresh")
 | 
					        self.filters.registerButton1Name(_("Refresh"))
 | 
				
			||||||
        self.filters.registerButton1Callback(self.refreshStats)
 | 
					        self.filters.registerButton1Callback(self.refreshStats)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        # ToDo: store in config
 | 
					        # ToDo: store in config
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -28,18 +28,18 @@ import gobject
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import Configuration
 | 
					import Configuration
 | 
				
			||||||
 | 
					
 | 
				
			||||||
rewrite = { 'general' : 'General',                   'supported_databases' : 'Databases'
 | 
					rewrite = { 'general' : _('General'),                   'supported_databases' : _('Databases')
 | 
				
			||||||
          , 'import'  : 'Import',                    'hud_ui' : 'HUD'
 | 
					          , 'import'  : _('Import'),                    'hud_ui' : _('HUD')
 | 
				
			||||||
          , 'supported_sites' : 'Sites',             'supported_games' : 'Games'
 | 
					          , 'supported_sites' : _('Sites'),             'supported_games' : _('Games')
 | 
				
			||||||
          , 'popup_windows' : 'Popup Windows',       'pu' : 'Window'
 | 
					          , 'popup_windows' : _('Popup Windows'),       'pu' : _('Window')
 | 
				
			||||||
          , 'pu_name' : 'Popup Name',                'pu_stat' : 'Stat'
 | 
					          , 'pu_name' : _('Popup Name'),                'pu_stat' : _('Stat')
 | 
				
			||||||
          , 'pu_stat_name' : 'Stat Name'
 | 
					          , 'pu_stat_name' : _('Stat Name')
 | 
				
			||||||
          , 'aux_windows' : 'Auxiliary Windows',     'aw stud_mucked' : 'stud_mucked'
 | 
					          , 'aux_windows' : _('Auxiliary Windows'),     'aw stud_mucked' : _('stud_mucked')
 | 
				
			||||||
          , 'aw mucked' : 'mucked',                  'hhcs' : 'Hand History Converters'
 | 
					          , 'aw mucked' : _('mucked'),                  'hhcs' : _('Hand History Converters')
 | 
				
			||||||
          , 'gui_cash_stats' : 'Ring Player Stats',  'field_type' : 'Field Type'
 | 
					          , 'gui_cash_stats' : _('Ring Player Stats'),  'field_type' : _('Field Type')
 | 
				
			||||||
          , 'col_title' : 'Column Heading',          'xalignment' : 'Left/Right Align'
 | 
					          , 'col_title' : _('Column Heading'),          'xalignment' : _('Left/Right Align')
 | 
				
			||||||
          , 'disp_all' : 'Show in Summaries',        'disp_posn' : 'Show in Position Stats'
 | 
					          , 'disp_all' : _('Show in Summaries'),        'disp_posn' : _('Show in Position Stats')
 | 
				
			||||||
          , 'col_name' : 'Stat Name',                'field_format' : 'Format'
 | 
					          , 'col_name' : _('Stat Name'),                'field_format' : _('Format')
 | 
				
			||||||
          }
 | 
					          }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class GuiPrefs:
 | 
					class GuiPrefs:
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -94,14 +94,14 @@ class GuiStove():
 | 
				
			||||||
        return combobox
 | 
					        return combobox
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def createDrawTab(self):
 | 
					    def createDrawTab(self):
 | 
				
			||||||
        tab_title = "Draw"
 | 
					        tab_title = _("Draw")
 | 
				
			||||||
        label = gtk.Label(tab_title)
 | 
					        label = gtk.Label(tab_title)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        ddbox = gtk.VBox(False, 0)
 | 
					        ddbox = gtk.VBox(False, 0)
 | 
				
			||||||
        self.notebook.append_page(ddbox, label)
 | 
					        self.notebook.append_page(ddbox, label)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def createStudTab(self):
 | 
					    def createStudTab(self):
 | 
				
			||||||
        tab_title = "Stud"
 | 
					        tab_title = _("Stud")
 | 
				
			||||||
        label = gtk.Label(tab_title)
 | 
					        label = gtk.Label(tab_title)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        ddbox = gtk.VBox(False, 0)
 | 
					        ddbox = gtk.VBox(False, 0)
 | 
				
			||||||
| 
						 | 
					@ -112,7 +112,7 @@ class GuiStove():
 | 
				
			||||||
        #                 / gamehbox / in_frame / table /
 | 
					        #                 / gamehbox / in_frame / table /
 | 
				
			||||||
        #                            / out_frame
 | 
					        #                            / out_frame
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        tab_title = "Flop"
 | 
					        tab_title = _("Flop")
 | 
				
			||||||
        label = gtk.Label(tab_title)
 | 
					        label = gtk.Label(tab_title)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        ddbox = gtk.VBox(False, 0)
 | 
					        ddbox = gtk.VBox(False, 0)
 | 
				
			||||||
| 
						 | 
					@ -131,17 +131,17 @@ class GuiStove():
 | 
				
			||||||
        flop_games_cb = self.create_combo_box(games)
 | 
					        flop_games_cb = self.create_combo_box(games)
 | 
				
			||||||
        players_cb = self.create_combo_box(players)
 | 
					        players_cb = self.create_combo_box(players)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        label = gtk.Label("Gametype:")
 | 
					        label = gtk.Label(_("Gametype:"))
 | 
				
			||||||
        ddhbox.add(label)
 | 
					        ddhbox.add(label)
 | 
				
			||||||
        ddhbox.add(flop_games_cb)
 | 
					        ddhbox.add(flop_games_cb)
 | 
				
			||||||
        label = gtk.Label("Players:")
 | 
					        label = gtk.Label(_("Players:"))
 | 
				
			||||||
        ddhbox.add(label)
 | 
					        ddhbox.add(label)
 | 
				
			||||||
        ddhbox.add(players_cb)
 | 
					        ddhbox.add(players_cb)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        # Frames for Stove input and output
 | 
					        # Frames for Stove input and output
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        in_frame = gtk.Frame("Input:")
 | 
					        in_frame = gtk.Frame(_("Input:"))
 | 
				
			||||||
        out_frame = gtk.Frame("Output:")
 | 
					        out_frame = gtk.Frame(_("Output:"))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        gamehbox.add(in_frame)
 | 
					        gamehbox.add(in_frame)
 | 
				
			||||||
        gamehbox.add(out_frame)
 | 
					        gamehbox.add(out_frame)
 | 
				
			||||||
| 
						 | 
					@ -167,7 +167,7 @@ Against the range: {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        # Input Frame
 | 
					        # Input Frame
 | 
				
			||||||
        table = gtk.Table(4, 5, True)
 | 
					        table = gtk.Table(4, 5, True)
 | 
				
			||||||
        label = gtk.Label("Board:")
 | 
					        label = gtk.Label(_("Board:"))
 | 
				
			||||||
        board = gtk.Entry()
 | 
					        board = gtk.Entry()
 | 
				
			||||||
        board.connect("changed", self.set_board_flop, board)
 | 
					        board.connect("changed", self.set_board_flop, board)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -179,7 +179,7 @@ Against the range: {
 | 
				
			||||||
        table.attach(btn1, 2, 3, 0, 1, xoptions=gtk.SHRINK, yoptions=gtk.SHRINK)
 | 
					        table.attach(btn1, 2, 3, 0, 1, xoptions=gtk.SHRINK, yoptions=gtk.SHRINK)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        label = gtk.Label("Player1:")
 | 
					        label = gtk.Label(_("Player1:"))
 | 
				
			||||||
        board = gtk.Entry()
 | 
					        board = gtk.Entry()
 | 
				
			||||||
        board.connect("changed", self.set_hero_cards_flop, board)
 | 
					        board.connect("changed", self.set_hero_cards_flop, board)
 | 
				
			||||||
        btn2 = gtk.Button()
 | 
					        btn2 = gtk.Button()
 | 
				
			||||||
| 
						 | 
					@ -194,7 +194,7 @@ Against the range: {
 | 
				
			||||||
        table.attach(btn3, 3, 4, 1, 2, xoptions=gtk.SHRINK, yoptions=gtk.SHRINK)
 | 
					        table.attach(btn3, 3, 4, 1, 2, xoptions=gtk.SHRINK, yoptions=gtk.SHRINK)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        label = gtk.Label("Player2:")
 | 
					        label = gtk.Label(_("Player2:"))
 | 
				
			||||||
        board = gtk.Entry()
 | 
					        board = gtk.Entry()
 | 
				
			||||||
        board.connect("changed", self.set_villain_cards_flop, board)
 | 
					        board.connect("changed", self.set_villain_cards_flop, board)
 | 
				
			||||||
        btn4 = gtk.Button()
 | 
					        btn4 = gtk.Button()
 | 
				
			||||||
| 
						 | 
					@ -208,7 +208,7 @@ Against the range: {
 | 
				
			||||||
        table.attach(btn4, 2, 3, 2, 3, xoptions=gtk.SHRINK, yoptions=gtk.SHRINK)
 | 
					        table.attach(btn4, 2, 3, 2, 3, xoptions=gtk.SHRINK, yoptions=gtk.SHRINK)
 | 
				
			||||||
        table.attach(btn5, 3, 4, 2, 3, xoptions=gtk.SHRINK, yoptions=gtk.SHRINK)
 | 
					        table.attach(btn5, 3, 4, 2, 3, xoptions=gtk.SHRINK, yoptions=gtk.SHRINK)
 | 
				
			||||||
        
 | 
					        
 | 
				
			||||||
        btn6 = gtk.Button("Results")
 | 
					        btn6 = gtk.Button(_("Results"))
 | 
				
			||||||
        btn6.connect("pressed", self.update_flop_output_pane, btn6)
 | 
					        btn6.connect("pressed", self.update_flop_output_pane, btn6)
 | 
				
			||||||
        table.attach(btn6, 0, 1, 3, 4, xoptions=gtk.SHRINK, yoptions=gtk.SHRINK)
 | 
					        table.attach(btn6, 0, 1, 3, 4, xoptions=gtk.SHRINK, yoptions=gtk.SHRINK)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -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)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -70,7 +70,7 @@ class GuiTourneyPlayerStats (GuiPlayerStats.GuiPlayerStats):
 | 
				
			||||||
        self.main_hbox = gtk.HPaned()
 | 
					        self.main_hbox = gtk.HPaned()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        self.filters = TourneyFilters.TourneyFilters(self.db, self.conf, self.sql, display = filters_display)
 | 
					        self.filters = TourneyFilters.TourneyFilters(self.db, self.conf, self.sql, display = filters_display)
 | 
				
			||||||
        #self.filters.registerButton1Name("_Filters")
 | 
					        #self.filters.registerButton1Name(_("_Filters"))
 | 
				
			||||||
        #self.filters.registerButton1Callback(self.showDetailFilter)
 | 
					        #self.filters.registerButton1Callback(self.showDetailFilter)
 | 
				
			||||||
        self.filters.registerButton2Name(_("_Refresh Stats"))
 | 
					        self.filters.registerButton2Name(_("_Refresh Stats"))
 | 
				
			||||||
        self.filters.registerButton2Callback(self.refreshStats)
 | 
					        self.filters.registerButton2Callback(self.refreshStats)
 | 
				
			||||||
| 
						 | 
					@ -79,24 +79,24 @@ class GuiTourneyPlayerStats (GuiPlayerStats.GuiPlayerStats):
 | 
				
			||||||
        # ToDo: create popup to adjust column config
 | 
					        # ToDo: create popup to adjust column config
 | 
				
			||||||
        # columns to display, keys match column name returned by sql, values in tuple are:
 | 
					        # columns to display, keys match column name returned by sql, values in tuple are:
 | 
				
			||||||
        #     is column displayed, column heading, xalignment, formatting, celltype
 | 
					        #     is column displayed, column heading, xalignment, formatting, celltype
 | 
				
			||||||
        self.columns = [ ["siteName",       True,  "Site",    0.0, "%s", "str"]
 | 
					        self.columns = [ ["siteName",       True,  _("Site"),    0.0, "%s", "str"]
 | 
				
			||||||
                       #,["tourney",        False, "Tourney", 0.0, "%s", "str"]   # true not allowed for this line
 | 
					                       #,["tourney",        False, _("Tourney"), 0.0, "%s", "str"]   # true not allowed for this line
 | 
				
			||||||
                       , ["category",       True,  "Cat.",   0.0, "%s", "str"]
 | 
					                       , ["category",       True,  _("Cat."),    0.0, "%s", "str"]
 | 
				
			||||||
                       , ["limitType",      True,  "Limit",   0.0, "%s", "str"]
 | 
					                       , ["limitType",      True,  _("Limit"),   0.0, "%s", "str"]
 | 
				
			||||||
                       , ["currency",       True,  "Curr.",   0.0, "%s", "str"]
 | 
					                       , ["currency",       True,  _("Curr."),   0.0, "%s", "str"]
 | 
				
			||||||
                       , ["buyIn",          True,  "BuyIn",   1.0, "%3.2f", "str"]
 | 
					                       , ["buyIn",          True,  _("BuyIn"),   1.0, "%3.2f", "str"]
 | 
				
			||||||
                       , ["fee",            True,  "Fee",     1.0, "%3.2f", "str"]
 | 
					                       , ["fee",            True,  _("Fee"),     1.0, "%3.2f", "str"]
 | 
				
			||||||
                       , ["playerName",     False, "Name",    0.0, "%s", "str"]   # true not allowed for this line (set in code)
 | 
					                       , ["playerName",     False, _("Name"),    0.0, "%s", "str"]   # true not allowed for this line (set in code)
 | 
				
			||||||
                       , ["tourneyCount",   True,  "#",       1.0, "%1.0f", "str"]
 | 
					                       , ["tourneyCount",   True,  _("#"),       1.0, "%1.0f", "str"]
 | 
				
			||||||
                       , ["itm",            True,  "ITM%",    1.0, "%3.2f", "str"]
 | 
					                       , ["itm",            True,  _("ITM%"),    1.0, "%3.2f", "str"]
 | 
				
			||||||
                       , ["_1st",           False, "1st",     1.0, "%1.0f", "str"]
 | 
					                       , ["_1st",           False, _("1st"),     1.0, "%1.0f", "str"]
 | 
				
			||||||
                       , ["_2nd",           True,  "2nd",     1.0, "%1.0f", "str"]
 | 
					                       , ["_2nd",           True,  _("2nd"),     1.0, "%1.0f", "str"]
 | 
				
			||||||
                       , ["_3rd",           True,  "3rd",     1.0, "%1.0f", "str"]
 | 
					                       , ["_3rd",           True,  _("3rd"),     1.0, "%1.0f", "str"]
 | 
				
			||||||
                       , ["unknownRank",    True,  "Rank?",   1.0, "%1.0f", "str"]
 | 
					                       , ["unknownRank",    True,  _("Rank?"),   1.0, "%1.0f", "str"]
 | 
				
			||||||
                       , ["spent",          True,  "Spent",   1.0, "%3.2f", "str"]
 | 
					                       , ["spent",          True,  _("Spent"),   1.0, "%3.2f", "str"]
 | 
				
			||||||
                       , ["won",            True,  "Won",     1.0, "%3.2f", "str"]
 | 
					                       , ["won",            True,  _("Won"),     1.0, "%3.2f", "str"]
 | 
				
			||||||
                       , ["roi",            True,  "ROI%",    1.0, "%3.0f", "str"]
 | 
					                       , ["roi",            True,  _("ROI%"),    1.0, "%3.0f", "str"]
 | 
				
			||||||
                       , ["profitPerTourney", True,"$/Tour",  1.0, "%3.2f", "str"]]
 | 
					                       , ["profitPerTourney", True,_("$/Tour"),  1.0, "%3.2f", "str"]]
 | 
				
			||||||
                       
 | 
					                       
 | 
				
			||||||
        self.stats_frame = gtk.Frame()
 | 
					        self.stats_frame = gtk.Frame()
 | 
				
			||||||
        self.stats_frame.show()
 | 
					        self.stats_frame.show()
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -66,16 +66,16 @@ class HUD_main(object):
 | 
				
			||||||
    def __init__(self, db_name='fpdb'):
 | 
					    def __init__(self, db_name='fpdb'):
 | 
				
			||||||
        self.db_name = db_name
 | 
					        self.db_name = db_name
 | 
				
			||||||
        self.config = c
 | 
					        self.config = c
 | 
				
			||||||
        log.info("HUD_main starting: using db name = %s" % (db_name))
 | 
					        log.info(_("HUD_main starting: using db name = %s") % (db_name))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        try:
 | 
					        try:
 | 
				
			||||||
            if not options.errorsToConsole:
 | 
					            if not options.errorsToConsole:
 | 
				
			||||||
                fileName = os.path.join(self.config.dir_log, 'HUD-errors.txt')
 | 
					                fileName = os.path.join(self.config.dir_log, 'HUD-errors.txt')
 | 
				
			||||||
                log.info("Note: error output is being diverted to:" + fileName)
 | 
					                log.info(_("Note: error output is being diverted to:") + fileName)
 | 
				
			||||||
                log.info("Any major error will be reported there _only_.")
 | 
					                log.info(_("Any major error will be reported there _only_."))
 | 
				
			||||||
                errorFile = open(fileName, 'w', 0)
 | 
					                errorFile = open(fileName, 'w', 0)
 | 
				
			||||||
                sys.stderr = errorFile
 | 
					                sys.stderr = errorFile
 | 
				
			||||||
                sys.stderr.write("HUD_main: starting ...\n")
 | 
					                log.info(_("HUD_main: starting ...\n"))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            self.hud_dict = {}
 | 
					            self.hud_dict = {}
 | 
				
			||||||
            self.hud_params = self.config.get_hud_ui_parameters()
 | 
					            self.hud_params = self.config.get_hud_ui_parameters()
 | 
				
			||||||
| 
						 | 
					@ -104,7 +104,7 @@ class HUD_main(object):
 | 
				
			||||||
            self.main_window.connect("table_changed", self.table_changed)
 | 
					            self.main_window.connect("table_changed", self.table_changed)
 | 
				
			||||||
            self.main_window.connect("destroy", self.destroy)
 | 
					            self.main_window.connect("destroy", self.destroy)
 | 
				
			||||||
            self.vb = gtk.VBox()
 | 
					            self.vb = gtk.VBox()
 | 
				
			||||||
            self.label = gtk.Label('Closing this window will exit from the HUD.')
 | 
					            self.label = gtk.Label(_('Closing this window will exit from the HUD.'))
 | 
				
			||||||
            self.vb.add(self.label)
 | 
					            self.vb.add(self.label)
 | 
				
			||||||
            self.main_window.add(self.vb)
 | 
					            self.main_window.add(self.vb)
 | 
				
			||||||
            self.main_window.set_title("HUD Main Window")
 | 
					            self.main_window.set_title("HUD Main Window")
 | 
				
			||||||
| 
						 | 
					@ -135,13 +135,13 @@ class HUD_main(object):
 | 
				
			||||||
        self.kill_hud(None, hud.table.key)
 | 
					        self.kill_hud(None, hud.table.key)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def game_changed(self, widget, hud):
 | 
					    def game_changed(self, widget, hud):
 | 
				
			||||||
        print "hud_main: Game changed."
 | 
					        print _("hud_main: Game changed.")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def table_changed(self, widget, hud):
 | 
					    def table_changed(self, widget, hud):
 | 
				
			||||||
        self.kill_hud(None, hud.table.key)
 | 
					        self.kill_hud(None, hud.table.key)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def destroy(self, *args):             # call back for terminating the main eventloop
 | 
					    def destroy(self, *args):             # call back for terminating the main eventloop
 | 
				
			||||||
        log.info("Terminating normally.")
 | 
					        log.info(_("Terminating normally."))
 | 
				
			||||||
        gtk.main_quit()
 | 
					        gtk.main_quit()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def kill_hud(self, event, table):
 | 
					    def kill_hud(self, event, table):
 | 
				
			||||||
| 
						 | 
					@ -202,7 +202,7 @@ class HUD_main(object):
 | 
				
			||||||
        while 1:    # wait for a new hand number on stdin
 | 
					        while 1:    # wait for a new hand number on stdin
 | 
				
			||||||
            new_hand_id = sys.stdin.readline()
 | 
					            new_hand_id = sys.stdin.readline()
 | 
				
			||||||
            new_hand_id = string.rstrip(new_hand_id)
 | 
					            new_hand_id = string.rstrip(new_hand_id)
 | 
				
			||||||
            log.debug("Received hand no %s" % new_hand_id)
 | 
					            log.debug(_("Received hand no %s") % new_hand_id)
 | 
				
			||||||
            if new_hand_id == "":           # blank line means quit
 | 
					            if new_hand_id == "":           # blank line means quit
 | 
				
			||||||
                self.destroy()
 | 
					                self.destroy()
 | 
				
			||||||
                break # this thread is not always killed immediately with gtk.main_quit()
 | 
					                break # this thread is not always killed immediately with gtk.main_quit()
 | 
				
			||||||
| 
						 | 
					@ -226,12 +226,12 @@ class HUD_main(object):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#        get basic info about the new hand from the db
 | 
					#        get basic info about the new hand from the db
 | 
				
			||||||
#        if there is a db error, complain, skip hand, and proceed
 | 
					#        if there is a db error, complain, skip hand, and proceed
 | 
				
			||||||
            log.info("HUD_main.read_stdin: hand processing starting ...")
 | 
					            log.info(_("HUD_main.read_stdin: hand processing starting ..."))
 | 
				
			||||||
            try:
 | 
					            try:
 | 
				
			||||||
                (table_name, max, poker_game, type, site_id, site_name, num_seats, tour_number, tab_number) = \
 | 
					                (table_name, max, poker_game, type, site_id, site_name, num_seats, tour_number, tab_number) = \
 | 
				
			||||||
                                self.db_connection.get_table_info(new_hand_id)
 | 
					                                self.db_connection.get_table_info(new_hand_id)
 | 
				
			||||||
            except Exception:
 | 
					            except Exception:
 | 
				
			||||||
                log.exception("db error: skipping %s" % new_hand_id)
 | 
					                log.exception(_("db error: skipping %s") % new_hand_id)
 | 
				
			||||||
                continue
 | 
					                continue
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            if type == "tour":   # hand is from a tournament
 | 
					            if type == "tour":   # hand is from a tournament
 | 
				
			||||||
| 
						 | 
					@ -250,8 +250,8 @@ class HUD_main(object):
 | 
				
			||||||
                try:
 | 
					                try:
 | 
				
			||||||
                    self.hud_dict[temp_key].stat_dict = stat_dict
 | 
					                    self.hud_dict[temp_key].stat_dict = stat_dict
 | 
				
			||||||
                except KeyError:    # HUD instance has been killed off, key is stale
 | 
					                except KeyError:    # HUD instance has been killed off, key is stale
 | 
				
			||||||
                    log.error('hud_dict[%s] was not found\n' % temp_key)
 | 
					                    log.error(_('hud_dict[%s] was not found\n') % temp_key)
 | 
				
			||||||
                    log.error('will not send hand\n')
 | 
					                    log.error(_('will not send hand\n'))
 | 
				
			||||||
                    # Unlocks table, copied from end of function
 | 
					                    # Unlocks table, copied from end of function
 | 
				
			||||||
                    self.db_connection.connection.rollback()
 | 
					                    self.db_connection.connection.rollback()
 | 
				
			||||||
                    return
 | 
					                    return
 | 
				
			||||||
| 
						 | 
					@ -273,7 +273,7 @@ class HUD_main(object):
 | 
				
			||||||
#        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)
 | 
				
			||||||
                    log.error("HUD create: table name %s not found, skipping." % table_name)
 | 
					                    log.error(_("HUD create: table name %s not found, skipping.") % table_name)
 | 
				
			||||||
                else:
 | 
					                else:
 | 
				
			||||||
                    tablewindow.key = temp_key
 | 
					                    tablewindow.key = temp_key
 | 
				
			||||||
                    tablewindow.max = max
 | 
					                    tablewindow.max = max
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -362,7 +362,9 @@ class fpdb:
 | 
				
			||||||
                                 (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(_("Please select the game category for which you want to configure HUD stats:"))
 | 
					        label=gtk.Label(_("Note that this dialogue will overwrite an existing config if one has been made already. ") + 
 | 
				
			||||||
 | 
					                _("Abort now if you don't want that.") + "\n" + 
 | 
				
			||||||
 | 
					                _("Please select the game category for which you want to configure HUD stats and the number of rows and columns:"))
 | 
				
			||||||
        diaSelections.vbox.add(label)
 | 
					        diaSelections.vbox.add(label)
 | 
				
			||||||
        label.show()
 | 
					        label.show()
 | 
				
			||||||
        
 | 
					        
 | 
				
			||||||
| 
						 | 
					@ -379,7 +381,7 @@ class fpdb:
 | 
				
			||||||
        comboRows.connect("changed", self.hudConfiguratorComboSelection)
 | 
					        comboRows.connect("changed", self.hudConfiguratorComboSelection)
 | 
				
			||||||
        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(_("%d rows") % i)
 | 
				
			||||||
        comboRows.set_active(0)
 | 
					        comboRows.set_active(0)
 | 
				
			||||||
        comboRows.show()
 | 
					        comboRows.show()
 | 
				
			||||||
        
 | 
					        
 | 
				
			||||||
| 
						 | 
					@ -387,7 +389,7 @@ class fpdb:
 | 
				
			||||||
        comboColumns.connect("changed", self.hudConfiguratorComboSelection)
 | 
					        comboColumns.connect("changed", self.hudConfiguratorComboSelection)
 | 
				
			||||||
        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("%d columns" % i)
 | 
				
			||||||
        comboColumns.set_active(0)
 | 
					        comboColumns.set_active(0)
 | 
				
			||||||
        comboColumns.show()
 | 
					        comboColumns.show()
 | 
				
			||||||
        
 | 
					        
 | 
				
			||||||
| 
						 | 
					@ -445,7 +447,7 @@ class fpdb:
 | 
				
			||||||
            if attr.startswith('__'): continue
 | 
					            if attr.startswith('__'): continue
 | 
				
			||||||
            if attr in ("Charset", "Configuration", "Database", "GInitiallyUnowned", "gtk", "pygtk",
 | 
					            if attr in ("Charset", "Configuration", "Database", "GInitiallyUnowned", "gtk", "pygtk",
 | 
				
			||||||
                        "player", "c", "db_connection", "do_stat", "do_tip", "stat_dict",
 | 
					                        "player", "c", "db_connection", "do_stat", "do_tip", "stat_dict",
 | 
				
			||||||
                        "h", "re", "re_Percent", "re_Places", ): continue
 | 
					                        "h", "re", "re_Percent", "re_Places", "L10n", "log", "encoder", "codecs", "_", "sys", "logging"): 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.hudConfiguratorRows+1):
 | 
				
			||||||
| 
						 | 
					@ -455,11 +457,11 @@ class fpdb:
 | 
				
			||||||
                    if columnNumber==0:
 | 
					                    if columnNumber==0:
 | 
				
			||||||
                        pass
 | 
					                        pass
 | 
				
			||||||
                    else:
 | 
					                    else:
 | 
				
			||||||
                        label=gtk.Label("column "+str(columnNumber))
 | 
					                        label=gtk.Label(_("column %d" % columnNumber))
 | 
				
			||||||
                        table.attach(child=label, left_attach=columnNumber, right_attach=columnNumber+1, top_attach=rowNumber, bottom_attach=rowNumber+1)
 | 
					                        table.attach(child=label, left_attach=columnNumber, right_attach=columnNumber+1, top_attach=rowNumber, bottom_attach=rowNumber+1)
 | 
				
			||||||
                        label.show()
 | 
					                        label.show()
 | 
				
			||||||
                elif columnNumber==0:
 | 
					                elif columnNumber==0:
 | 
				
			||||||
                    label=gtk.Label("row "+str(rowNumber))
 | 
					                    label=gtk.Label(_("row %d" % rowNumber))
 | 
				
			||||||
                    table.attach(child=label, left_attach=columnNumber, right_attach=columnNumber+1, top_attach=rowNumber, bottom_attach=rowNumber+1)
 | 
					                    table.attach(child=label, left_attach=columnNumber, right_attach=columnNumber+1, top_attach=rowNumber, bottom_attach=rowNumber+1)
 | 
				
			||||||
                    label.show()
 | 
					                    label.show()
 | 
				
			||||||
                else:
 | 
					                else:
 | 
				
			||||||
| 
						 | 
					@ -573,7 +575,7 @@ class fpdb:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def dia_recreate_hudcache(self, widget, data=None):
 | 
					    def dia_recreate_hudcache(self, widget, data=None):
 | 
				
			||||||
        if self.obtain_global_lock("dia_recreate_hudcache"):
 | 
					        if self.obtain_global_lock("dia_recreate_hudcache"):
 | 
				
			||||||
            self.dia_confirm = gtk.MessageDialog(parent=self.window, flags=gtk.DIALOG_DESTROY_WITH_PARENT, type=gtk.MESSAGE_WARNING, buttons=(gtk.BUTTONS_YES_NO), message_format="Confirm recreating HUD cache")
 | 
					            self.dia_confirm = gtk.MessageDialog(parent=self.window, flags=gtk.DIALOG_DESTROY_WITH_PARENT, type=gtk.MESSAGE_WARNING, buttons=(gtk.BUTTONS_YES_NO), message_format=_("Confirm recreating HUD cache"))
 | 
				
			||||||
            diastring = _("Please confirm that you want to re-create the HUD cache.")
 | 
					            diastring = _("Please confirm that you want to re-create the HUD cache.")
 | 
				
			||||||
            self.dia_confirm.format_secondary_text(diastring)
 | 
					            self.dia_confirm.format_secondary_text(diastring)
 | 
				
			||||||
            # disable windowclose, do not want the the underlying processing interrupted mid-process
 | 
					            # disable windowclose, do not want the the underlying processing interrupted mid-process
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user