[Spambayes-checkins] spambayes/Outlook2000/dialogs processors.py, 1.8, 1.9

Mark Hammond mhammond at users.sourceforge.net
Tue Aug 26 18:06:01 EDT 2003


Update of /cvsroot/spambayes/spambayes/Outlook2000/dialogs
In directory sc8-pr-cvs1:/tmp/cvs-serv32466

Modified Files:
	processors.py 
Log Message:
In binary builds, look for the bitmaps in the 'images' directory.


Index: processors.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/processors.py,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** processors.py	24 Aug 2003 12:01:52 -0000	1.8
--- processors.py	27 Aug 2003 00:05:59 -0000	1.9
***************
*** 47,62 ****
  class ImageProcessor(ControlProcessor):
      def Init(self):
-         filename = ""
          rcp = self.window.manager.dialog_parser;
          text = win32gui.GetWindowText(self.GetControl())
          name = rcp.names[int(text)]
          filename = rcp.bitmaps[name]
!         import os
!         if not os.path.isabs(filename):
!             filename = os.path.join( os.path.dirname( __file__ ), "resources", filename)
          handle = win32gui.LoadImage(0, filename, win32con.IMAGE_BITMAP,0,0,
                                      win32con.LR_COLOR|win32con.LR_LOADFROMFILE|win32con.LR_SHARED)
          win32gui.SendMessage(self.GetControl(), win32con.STM_SETIMAGE, win32con.IMAGE_BITMAP, handle)
-         
  
      def GetPopupHelpText(self, cid):
--- 47,65 ----
  class ImageProcessor(ControlProcessor):
      def Init(self):
          rcp = self.window.manager.dialog_parser;
          text = win32gui.GetWindowText(self.GetControl())
          name = rcp.names[int(text)]
          filename = rcp.bitmaps[name]
!         import os, sys
!         if hasattr(sys, "frozen"):
!             # bitmap in the app/images directory
!             filename = os.path.join(self.window.manager.application_directory,
!                                     "images", filename)
!         else:
!             if not os.path.isabs(filename):
!                 filename = os.path.join( os.path.dirname( __file__ ), "resources", filename)
          handle = win32gui.LoadImage(0, filename, win32con.IMAGE_BITMAP,0,0,
                                      win32con.LR_COLOR|win32con.LR_LOADFROMFILE|win32con.LR_SHARED)
          win32gui.SendMessage(self.GetControl(), win32con.STM_SETIMAGE, win32con.IMAGE_BITMAP, handle)
  
      def GetPopupHelpText(self, cid):





More information about the Spambayes-checkins mailing list