fpdb/pyfpdb/HUD_run_me.py
eblade fb9d7c0af2 Add file HUD_run_me, to be run by GuiAutoImport
GuiAutoImport: run HUD_run_me instead of HUD_main
HUD_main: Add HUD_removed() function, called by HUD when an individual HUD is closed, eliminates polling them every update; use 'in' operator instead of has_key
HUD: clean up code that deals with lack of font descriptor in config, and notification of what font was selected
HUD: clean up unnecessary use of keys() functions, and 'in' vs has_key
HUD: restore previous definition of reposition_windows(), although i can't make it error at will anymore
Tables: cleanup with keys() and in operator
fpdb: no longer raise an error on duplicate tab, since we currently depend on that, it's not an error, right?
2009-01-06 05:18:45 -05:00

53 lines
1.2 KiB
Python

#!/usr/bin/env python
import sys
import os
import thread
import time
import string
import re
errorfile = open('HUD-error.txt', 'w', 0)
sys.stderr = errorfile
# pyGTK modules
import pygtk
import gtk
import gobject
# FreePokerTools modules
import Configuration
import Database
import Tables
import Hud
import HUD_main
def destroy(*args): # call back for terminating the main eventloop
gtk.main_quit()
if __name__== "__main__":
sys.stderr.write("HUD_main starting\n")
try:
HUD_main.db_name = sys.argv[1]
except:
HUD_main.db_name = 'fpdb'
sys.stderr.write("Using db name = %s\n" % (HUD_main.db_name))
HUD_main.config = Configuration.Config()
gobject.threads_init() # this is required
thread.start_new_thread(HUD_main.read_stdin, ()) # starts the thread
HUD_main.main_window = gtk.Window()
HUD_main.main_window.connect("destroy", destroy)
HUD_main.eb = gtk.VBox()
label = gtk.Label('Closing this window will exit from the HUD.')
HUD_main.eb.add(label)
HUD_main.main_window.add(HUD_main.eb)
HUD_main.main_window.set_title("HUD Main Window")
HUD_main.main_window.show_all()
gtk.main()