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.
25 errorfile
= open('HUD-error.txt', 'w', 0)
26 sys
.stderr
= errorfile
33 # FreePokerTools modules
40 def destroy(*args
): # call back for terminating the main eventloop
44 if __name__
== "__main__":
45 sys
.stderr
.write(_("HUD_main starting"))
48 HUD_main
.db_name
= sys
.argv
[1]
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()