Skip to content
This repository has been archived by the owner on May 21, 2023. It is now read-only.

Commit

Permalink
Fix bugs found when testing py2exe version
Browse files Browse the repository at this point in the history
 - icon file can't be found relative to __file__ for py2exe, as __file__ doesn't exist in the namespace
 - setting title too often.
  • Loading branch information
jerub committed Jul 28, 2012
1 parent 86fc179 commit 9fe872c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions KosLookupExe.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ def __init__(self, *args, **kwargs):
if not self.working_file:
self.Close()
return
self.UpdateTitle(self.working_file)
self.checker = ChatKosLookup.KosChecker()
self.tailer = ChatKosLookup.FileTailer(self.working_file)
self.labels = []
Expand All @@ -65,7 +66,11 @@ def UpdateIcon(self):
file, but when running from source, this method pulls it in from the
directory containing the python modules.
"""
icon_path = os.path.join(os.path.dirname(__file__), 'icon.ico')
try:
icon_path = os.path.join(os.path.dirname(__file__), 'icon.ico')
except NameError:
# __file__ does not exist
return
if os.path.exists(icon_path):
self.SetIcon(wx.Icon(icon_path, wx.BITMAP_TYPE_ICO))

Expand All @@ -74,7 +79,6 @@ def KosCheckerPoll(self):
if not entry:
wx.FutureCall(1000, self.KosCheckerPoll)
return
self.UpdateTitle(self.working_file)
kos, not_kos, error = self.checker.koscheck_logentry(entry)
new_labels = []
if comment:
Expand Down

0 comments on commit 9fe872c

Please sign in to comment.