diff --git a/pyfpdb/HUD_main.py b/pyfpdb/HUD_main.py index 30a72096..81e8700a 100755 --- a/pyfpdb/HUD_main.py +++ b/pyfpdb/HUD_main.py @@ -151,7 +151,9 @@ class HUD_main(object): try: (table_name, max, poker_game) = self.db_connection.get_table_name(new_hand_id) stat_dict = self.db_connection.get_stats_from_hand(new_hand_id) - cards = self.db_connection.get_cards(new_hand_id) + cards = self.db_connection.get_cards(new_hand_id) + comm_cards = self.db_connection.get_common_cards(new_hand_id) + cards['common'] = comm_cards['common'] except Exception, err: print "db error: skipping ", new_hand_id, err sys.stderr.write("Database error %s in hand %d. Skipping.\n" % (err, int(new_hand_id))) diff --git a/pyfpdb/Hello.py b/pyfpdb/Hello.py index b5d1d366..41262d6c 100644 --- a/pyfpdb/Hello.py +++ b/pyfpdb/Hello.py @@ -99,3 +99,15 @@ class Hello_plus(Aux_Window): # hands played that was updated in the "update_data()" function. self.label.set_text("Hello %s\nYou have played %d hands\n on %s." % (self.hero, self.hands_played, self.site)) +class Hello_Menu(Aux_Window): + """A 'Hello World' Aux_Window demo.""" + def create(self): +# This demo puts a menu item on the HUD mainwindow. + self.item = gtk.MenuItem('Print cards') + self.hud.menu.append(self.item) + self.item.connect("activate", self.print_cards) + self.item.show() + + def print_cards(self, *args): +# callback for the menu item + print "cards =", self.hud.cards diff --git a/pyfpdb/Mucked.py b/pyfpdb/Mucked.py index 1d7e9597..a915facc 100755 --- a/pyfpdb/Mucked.py +++ b/pyfpdb/Mucked.py @@ -349,10 +349,6 @@ class Flop_Mucked(Aux_Window): self.m_windows[i].show_all() self.m_windows[i].hide() - def update_data(self, new_hand_id, db_connection): - cards = db_connection.get_common_cards(new_hand_id) - self.hud.cards['common'] = cards['common'] - def update_gui(self, new_hand_id): """Prepare and show the mucked cards.""" if self.displayed_cards: