Changeset e8c61f6 in sasview for sansguiframe/src
- Timestamp:
- Mar 27, 2012 11:28:56 AM (13 years ago)
- Branches:
- master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- 204548c
- Parents:
- 27edb0d
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sansguiframe/src/sans/guiframe/gui_manager.py
rd71a9fe re8c61f6 18 18 import time 19 19 import py_compile 20 # Try to find a local config21 20 import imp 22 21 import warnings 22 import re 23 23 warnings.simplefilter("ignore") 24 24 import logging 25 25 import urllib2 26 26 27 27 from sans.guiframe.events import EVT_STATUS … … 307 307 self.on_batch_selection(event=None) 308 308 self.add_icon() 309 # Check for update310 #self._check_update(None)311 309 # Register the close event so it calls our own method 312 310 wx.EVT_CLOSE(self, self.WindowClose) … … 676 674 # Set up extra custom tool menu 677 675 self._setup_extra_custom() 678 #self.Show(True) 679 #self._check_update(None) 676 self._check_update(None) 680 677 681 678 def _setup_extra_custom(self): … … 1246 1243 wx.EVT_MENU(self, id, self._onAbout) 1247 1244 1248 # Checking for updates needs major refactoring to work with py2exe 1249 # We need to make sure it doesn't hang the application if the server 1250 # is not up. We also need to make sure there's a proper executable to 1251 # run if we spawn a new background process. 1252 #id = wx.NewId() 1253 #self._help_menu.Append(id,'&Check for update', 1254 # 'Check for the latest version of %s' % config.__appname__) 1255 #wx.EVT_MENU(self, id, self._check_update) 1245 # Checking for updates 1246 id = wx.NewId() 1247 self._help_menu.Append(id,'&Check for update', 1248 'Check for the latest version of %s' % config.__appname__) 1249 wx.EVT_MENU(self, id, self._check_update) 1256 1250 self._menubar.Append(self._help_menu, '&Help') 1257 1251 … … 2111 2105 a call-back method when the current version number has been obtained. 2112 2106 """ 2113 2114 if hasattr(config, "__update_URL__"): 2115 import version 2116 checker = version.VersionThread2(config.__update_URL__, 2117 self._process_version, 2118 baggage=event==None) 2119 checker.start() 2107 try: 2108 f=urllib2.urlopen(config.__update_URL__, 2109 timeout=1.0) 2110 content=f.read() 2111 except: 2112 content = "0.0.0" 2113 2114 version = content.strip() 2115 if len(re.findall('\d+\.\d+\.\d+$', version)) < 0: 2116 content = "0.0.0" 2117 self._process_version(content, standalone=event==None) 2120 2118 2121 2119 def _process_version(self, version, standalone=True): … … 2132 2130 """ 2133 2131 try: 2134 if cmp(version, config.__version__) > 0:2135 msg = " Version %s is available! See the Help " % str(version)2136 msg += " menu to download it."2132 if version == "0.0.0": 2133 msg = "Could not connect to the application server." 2134 msg += " Please try again later." 2137 2135 self.SetStatusText(msg) 2136 elif cmp(version, config.__version__) > 0: 2137 msg = "Version %s is available! " % str(version) 2138 2138 if not standalone: 2139 2139 import webbrowser 2140 2140 webbrowser.open(config.__download_page__) 2141 else: 2142 msg += "See the help menu to download it." 2143 self.SetStatusText(msg) 2141 2144 else: 2142 2145 if not standalone:
Note: See TracChangeset
for help on using the changeset viewer.