In the "Games" filter, 27_3draw was showing up as 273draw with the 3 underlined....
[fpdb-dooglus.git] / pyfpdb / HUD_run_me.py
blobc3b77d033628b107c12b23d53da11a611a44acaa
1 #!/usr/bin/env python
2 # -*- coding: utf-8 -*-
4 #Copyright 2009-2011 Eric Blade
5 #This program is free software: you can redistribute it and/or modify
6 #it under the terms of the GNU Affero General Public License as published by
7 #the Free Software Foundation, version 3 of the License.
9 #This program is distributed in the hope that it will be useful,
10 #but WITHOUT ANY WARRANTY; without even the implied warranty of
11 #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 #GNU General Public License for more details.
14 #You should have received a copy of the GNU Affero General Public License
15 #along with this program. If not, see <http://www.gnu.org/licenses/>.
16 #In the "official" distribution you can find the license in agpl-3.0.txt.
18 import sys
19 import os
20 import thread
21 import time
22 import string
23 import re
25 errorfile = open('HUD-error.txt', 'w', 0)
26 sys.stderr = errorfile
28 # pyGTK modules
29 import pygtk
30 import gtk
31 import gobject
33 # FreePokerTools modules
34 import Configuration
35 import Database
36 import Tables
37 import Hud
38 import HUD_main
40 def destroy(*args): # call back for terminating the main eventloop
41 gtk.main_quit()
44 if __name__== "__main__":
45 sys.stderr.write(_("HUD_main starting"))
47 try:
48 HUD_main.db_name = sys.argv[1]
49 except:
50 HUD_main.db_name = 'fpdb'
51 sys.stderr.write(_("Using db name = %s") % (HUD_main.db_name))
53 HUD_main.config = Configuration.Config()
55 gobject.threads_init() # this is required
56 hud = HUD_main.HUD_main()
57 thread.start_new_thread(hud.read_stdin, ()) # starts the thread
59 HUD_main.main_window = gtk.Window()
60 HUD_main.main_window.connect("destroy", destroy)
61 HUD_main.eb = gtk.VBox()
62 label = gtk.Label(_('Closing this window will exit from the HUD.'))
63 HUD_main.eb.add(label)
64 HUD_main.main_window.add(HUD_main.eb)
66 HUD_main.main_window.set_title(_("HUD Main Window"))
67 HUD_main.main_window.show_all()
69 gtk.main()