Changeset 957af0d in sasview


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

Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • sasview/local_config.py

    r9989a6a r957af0d  
    1414__download_page__ = 'https://github.com/SasView/sasview/releases' 
    1515__update_URL__ = 'http://www.sasview.org/latestversion.json' 
    16  
    1716 
    1817# Debug message flag 
     
    130129DEFAULT_PERSPECTIVE = 'None' 
    131130 
     131# Time out for updating sasview 
     132UPDATE_TIMEOUT = 2 
     133 
    132134def printEVT(message): 
    133135    if __EVT_DEBUG__: 
  • sasview/sasview.py

    r5f0be1f r957af0d  
    1616import traceback 
    1717 
    18 logging.basicConfig(level=logging.INFO, 
     18logging.basicConfig(level=logging.DEBUG, 
    1919                    format='%(asctime)s %(levelname)s %(message)s', 
    2020                    filename=os.path.join(os.path.expanduser("~"), 
  • 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.