From 6ec309a68515de954300d96e67de91d2d1efcb93 Mon Sep 17 00:00:00 2001 From: Mika Bostrom Date: Thu, 22 Oct 2009 08:44:45 +0300 Subject: [PATCH 1/6] Provide extra path for mucked cards image Modified: * Mucked.py When running from outside source tree, the image containing mucked cards' faces could not be loaded. Provide an extra path to load from. --- pyfpdb/Mucked.py | 7 ++++++- setup.py | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/pyfpdb/Mucked.py b/pyfpdb/Mucked.py index c4a6e4f1..6da35f6d 100755 --- a/pyfpdb/Mucked.py +++ b/pyfpdb/Mucked.py @@ -63,7 +63,12 @@ class Aux_Window(object): card_images = 53 * [0] suits = ('s', 'h', 'd', 'c') ranks = (14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2) - pb = gtk.gdk.pixbuf_new_from_file(self.config.execution_path(self.params['deck'])) + deckimg = self.params['deck'] + try: + pb = gtk.gdk.pixbuf_new_from_file(self.config.execution_path(deckimg)) + except: + stockpath = '/usr/share/python-fpdb/' + deckimg + pb = gtk.gdk.pixbuf_new_from_file(stockpath) for j in range(0, 13): for i in range(0, 4): diff --git a/setup.py b/setup.py index 737ad18e..31907f99 100644 --- a/setup.py +++ b/setup.py @@ -19,6 +19,6 @@ setup(name = 'fpdb', ('/usr/share/applications', ['files/fpdb.desktop']), ('/usr/share/python-fpdb', - ['pyfpdb/logging.conf']) + ['pyfpdb/logging.conf', 'pyfpdb/Cards01.png']) ] ) From 2ff0935aff9998be558e3639952ff0bd02bce6c1 Mon Sep 17 00:00:00 2001 From: Mika Bostrom Date: Fri, 23 Oct 2009 13:06:33 +0300 Subject: [PATCH 2/6] Include example config file in debian package --- setup.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 31907f99..0ba21bf0 100644 --- a/setup.py +++ b/setup.py @@ -19,6 +19,8 @@ setup(name = 'fpdb', ('/usr/share/applications', ['files/fpdb.desktop']), ('/usr/share/python-fpdb', - ['pyfpdb/logging.conf', 'pyfpdb/Cards01.png']) + ['pyfpdb/logging.conf', 'pyfpdb/Cards01.png', + 'pyfpdb/HUD_config.xml.example' + ]) ] ) From 22b3d5de7f14e3ef7852721a0f1778bfec804e9c Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 26 Oct 2009 05:03:25 -0400 Subject: [PATCH 3/6] should minimize to tray in windows. windows 7's tray doesn't like it much, but it'll get over it for now --- pyfpdb/fpdb.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/pyfpdb/fpdb.py b/pyfpdb/fpdb.py index d23a003e..83e442c1 100755 --- a/pyfpdb/fpdb.py +++ b/pyfpdb/fpdb.py @@ -41,6 +41,10 @@ if os.name == 'nt' and sys.version[0:3] not in ('2.5', '2.6') and '-r' not in sy else: pass #print "debug - not changing path" + +if os.name == 'nt': + import win32api + import win32con print "Python " + sys.version[0:3] + '...\n' @@ -639,12 +643,17 @@ This program is licensed under the AGPL3, see docs"""+os.sep+"agpl-3.0.txt") def window_state_event_cb(self, window, event): print "window_state_event", event if event.changed_mask & gtk.gdk.WINDOW_STATE_ICONIFIED: + # -20 = GWL_EXSTYLE can't find it in the pywin32 libs + #bits = win32api.GetWindowLong(self.window.window.handle, -20) + #bits = bits ^ (win32con.WS_EX_TOOLWINDOW | win32con.WS_EX_APPWINDOW) + + #win32api.SetWindowLong(self.window.window.handle, -20, bits) + if event.new_window_state & gtk.gdk.WINDOW_STATE_ICONIFIED: - print "FPDB minimized" + self.window.hide() self.window.set_skip_taskbar_hint(True) self.window.set_skip_pager_hint(True) else: - print "FPDB unminimized" self.window.set_skip_taskbar_hint(False) self.window.set_skip_pager_hint(False) @@ -660,6 +669,7 @@ This program is licensed under the AGPL3, see docs"""+os.sep+"agpl-3.0.txt") pass def statusicon_activate(self, widget, data = None): + self.window.show() self.window.present() def warning_box(self, str, diatitle="FPDB WARNING"): From bb6b2ab9a2a73b45eed516c8f8819f214a6c2ae7 Mon Sep 17 00:00:00 2001 From: Mika Bostrom Date: Mon, 26 Oct 2009 12:55:23 +0200 Subject: [PATCH 4/6] Fix session timestamp range PostgreSQL does automatic argument conversion/formatting when dealing with timestamps. This simplification allows the session stats to be generated with PostgreSQL as db backend. --- pyfpdb/SQL.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyfpdb/SQL.py b/pyfpdb/SQL.py index 13f592cd..3c25963f 100644 --- a/pyfpdb/SQL.py +++ b/pyfpdb/SQL.py @@ -2498,7 +2498,7 @@ class Sql: INNER JOIN Sites s on (s.Id = gt.siteId) INNER JOIN Players p on (p.Id = hp.playerId) WHERE hp.playerId in - AND date_format(h.handStart, '%Y-%m-%d') + AND h.handStart ORDER by time""" elif db_server == 'sqlite': self.query['sessionStats'] = """ """ From 27fa27f370db8d482bb12128410ba02e2d01e798 Mon Sep 17 00:00:00 2001 From: Mika Bostrom Date: Mon, 26 Oct 2009 13:29:32 +0200 Subject: [PATCH 5/6] GTK signal handlers need to return True/False Since we deal with minimize/expose/show/hide routines ourselves, we don't want these signals passed any further. NOTE: if no return type is specified, it is automatically None which usually is translated to False. That might trigger some weird behaviour, up to and including rare and hard to reproduce GTK crashes. --- pyfpdb/fpdb.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pyfpdb/fpdb.py b/pyfpdb/fpdb.py index e6092de6..fe2ddd39 100755 --- a/pyfpdb/fpdb.py +++ b/pyfpdb/fpdb.py @@ -656,6 +656,8 @@ This program is licensed under the AGPL3, see docs"""+os.sep+"agpl-3.0.txt") else: self.window.set_skip_taskbar_hint(False) self.window.set_skip_pager_hint(False) + # Tell GTK not to propagate this signal any further + return True def statusicon_menu(self, widget, button, time, data = None): # we don't need to pass data here, since we do keep track of most all From 35b24fa00225d143152c36d9523e66670639fab2 Mon Sep 17 00:00:00 2001 From: Mika Bostrom Date: Mon, 26 Oct 2009 16:53:18 +0200 Subject: [PATCH 6/6] Remove a stray conflict marker --- pyfpdb/HandHistoryConverter.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/pyfpdb/HandHistoryConverter.py b/pyfpdb/HandHistoryConverter.py index 7e10e66a..0642d845 100644 --- a/pyfpdb/HandHistoryConverter.py +++ b/pyfpdb/HandHistoryConverter.py @@ -1,8 +1,5 @@ #!/usr/bin/python -<<<<<<< HEAD:pyfpdb/HandHistoryConverter.py # -*- coding: utf-8 -*- -======= ->>>>>>> 1efdd7fc68d3c9ce013f4d42730bece8075e2272:pyfpdb/HandHistoryConverter.py #Copyright 2008 Carl Gherardi #This program is free software: you can redistribute it and/or modify