From 752e5ad088da02808b302eed0d4163258909520b Mon Sep 17 00:00:00 2001 From: sqlcoder Date: Sat, 6 Feb 2010 12:27:15 +0000 Subject: [PATCH] make sure fpdb icon works in py2exe --- pyfpdb/fpdb.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pyfpdb/fpdb.py b/pyfpdb/fpdb.py index d5e0350d..376fdcc6 100755 --- a/pyfpdb/fpdb.py +++ b/pyfpdb/fpdb.py @@ -912,8 +912,10 @@ This program is licensed under the AGPL3, see docs"""+os.sep+"agpl-3.0.txt") sys.stderr = errorFile self.statusIcon = gtk.StatusIcon() - if os.path.exists(os.path.join(sys.path[0], '../gfx/fpdb-cards.png')): - self.statusIcon.set_from_file(os.path.join(sys.path[0], '../gfx/fpdb-cards.png')) + # use getcwd() here instead of sys.path[0] so that py2exe works: + cards = os.path.join(os.getcwd(), '..','gfx','fpdb-cards.png') + if os.path.exists(cards): + self.statusIcon.set_from_file(cards) elif os.path.exists('/usr/share/pixmaps/fpdb-cards.png'): self.statusIcon.set_from_file('/usr/share/pixmaps/fpdb-cards.png') else: