Changeset 957af0d in sasview for src/sas


Ignore:
Timestamp:
Jul 24, 2015 2:36:02 PM (9 years ago)
Author:
Ricardo M. Ferraz Leal <ricleal@…>
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:
199bb42b
Parents:
069aae2
Message:

Proxy class in debug mode to test

Location:
src/sas/guiframe
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/guiframe/gui_manager.py

    r069aae2 r957af0d  
    4646from sas.guiframe.CategoryManager import CategoryManager 
    4747from sas.dataloader.loader import Loader 
     48from sas.guiframe.proxy import Connection 
    4849from matplotlib import _pylab_helpers 
     50 
    4951 
    5052def get_app_dir(): 
     
    20522054        a call-back method when the current version number has been obtained. 
    20532055        """ 
    2054         try: 
    2055             req = urllib2.Request(config.__update_URL__) 
    2056             res = urllib2.urlopen(req) 
    2057             content = res.read().strip() 
    2058             logging.info("Connected to www.sasview.org. Latest version: %s" 
    2059                          % (content)) 
    2060             version_info = json.loads(content) 
    2061         except: 
    2062             logging.info("Failed to connect to www.sasview.org") 
    2063             version_info = {"version": "0.0.0"} 
    2064         self._process_version(version_info, standalone=event == None) 
     2056        version_info = {"version": "0.0.0"} 
     2057        c = Connection(config.__update_URL__, config.UPDATE_TIMEOUT) 
     2058        response = c.connect() 
     2059        if response is not None: 
     2060            try: 
     2061                #  
     2062                content = response.read().strip() 
     2063                logging.info("Connected to www.sasview.org. Latest version: %s" 
     2064                             % (content)) 
     2065                version_info = json.loads(content) 
     2066            except: 
     2067                logging.info("Failed to connect to www.sasview.org") 
     2068        self._process_version(version_info, standalone=event == None)     
     2069 
     2070         
     2071         
     2072#          
     2073#         try: 
     2074#             req = urllib2.Request(config.__update_URL__) 
     2075#             res = urllib2.urlopen(req) 
     2076#             content = res.read().strip() 
     2077#             logging.info("Connected to www.sasview.org. Latest version: %s" 
     2078#                          % (content)) 
     2079#             version_info = json.loads(content) 
     2080#         except: 
     2081#             logging.info("Failed to connect to www.sasview.org") 
     2082#             version_info = {"version": "0.0.0"} 
     2083#         self._process_version(version_info, standalone=event == None) 
    20652084 
    20662085    def _process_version(self, version_info, standalone=True): 
Note: See TracChangeset for help on using the changeset viewer.