Update of /cvsroot/spambayes/spambayes/windows
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1047/windows

Modified Files:
        pop3proxy_tray.py 
Log Message:
New version numbering scheme.  All apps now use the same version number, and
the current version information is read from the __init__.py file in the
"spambayes" module.

Float version numbers are no longer used for update checks.  Instead, our
standard string version number format is parsed into a tuple in the format of
the sys.version_info field.  Versions can then be compared based on that
tuple.

Index: pop3proxy_tray.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/windows/pop3proxy_tray.py,v
retrieving revision 1.22
retrieving revision 1.23
diff -C2 -d -r1.22 -r1.23
*** pop3proxy_tray.py   22 Jul 2004 05:56:56 -0000      1.22
--- pop3proxy_tray.py   23 Dec 2004 18:14:33 -0000      1.23
***************
*** 507,522 ****
      def CheckVersion(self):
          # Stolen, with few modifications, from addin.py
!         from spambayes.Version import get_version_string, \
!              get_version_number, fetch_latest_dict
!         if hasattr(sys, "frozen"):
!             version_number_key = "BinaryVersion"
!             version_string_key = "Full Description Binary"
!         else:
!             version_number_key = "Version"
!             version_string_key = "Full Description"
  
          app_name = "POP3 Proxy"
!         cur_ver_string = get_version_string(app_name, version_string_key)
!         cur_ver_num = get_version_number(app_name, version_number_key)
  
          try:
--- 507,517 ----
      def CheckVersion(self):
          # Stolen, with few modifications, from addin.py
!         from spambayes.Version import get_current_version, get_version, \
!                 get_download_page, fetch_latest_dict
  
          app_name = "POP3 Proxy"
!         app_display_name = "SpamBayes POP3 Proxy"
!         ver_current = get_current_version()
!         cur_ver_string = ver_current.get_long_version(app_display_name)
  
          try:
***************
*** 524,536 ****
              latest = fetch_latest_dict()
              SetWaitCursor(0)
!             try:
!                 latest_ver_string = get_version_string(app_name, 
version_string_key,
!                                                        version_dict=latest)
!                 latest_ver_num = get_version_number(app_name, 
version_number_key,
!                                                     version_dict=latest)
!             except KeyError:
!                 # "Full Description Binary" not in the version currently on 
the web
!                 latest_ver_string = "0.1"
!                 latest_ver_num = 0.1
          except:
              self.ShowMessage("Error checking the latest version")
--- 519,524 ----
              latest = fetch_latest_dict()
              SetWaitCursor(0)
!             ver_latest = get_version(app_name, version_dict=latest)
!             latest_ver_string = ver_latest.get_long_version(app_display_name)
          except:
              self.ShowMessage("Error checking the latest version")
***************
*** 538,547 ****
              return
  
!         self.ShowMessage("Current version is %s, latest is %s." % \
!                          (cur_ver_string, latest_ver_string))
!         if latest_ver_num > cur_ver_num:
!             url = get_version_string(app_name, "Download Page", 
version_dict=latest)
!             # Offer to open up the url
! ##                os.startfile(url)
  
      def ShowMessage(self, msg):
--- 526,546 ----
              return
  
!         ver_message = "Current version is %s.\r\n" \
!                       "Latest version is %s.\r\n\r\n" % \
!                       (cur_ver_string, latest_ver_string)
!         if ver_latest == ver_current:
!             ver_message += "Your are running the latest downloadable version."
!         elif ver_current > ver_latest:
!             ver_message += "Your current version is newer than the latest " \
!                            "downloadable version."
!         else:
!             ver_message += "There is a newer version available.  You may " \
!                            "download the updated version from:\r\n"
!             url = get_download_page(app_name, version_dict=latest)
!             ver_message += url
!         self.ShowMessage(ver_message)
!         # It would be nice to offer to open up the url if there is a
!         # newer version, but we don't do that yet.
! ##          os.startfile(url)
  
      def ShowMessage(self, msg):

_______________________________________________
Spambayes-checkins mailing list
[email protected]
http://mail.python.org/mailman/listinfo/spambayes-checkins

Reply via email to