Changeset 9989a6a in sasview


Ignore:
Timestamp:
Jul 6, 2015 9:35:09 AM (9 years ago)
Author:
Doucet, Mathieu <doucetm@…>
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:
098f3d2
Parents:
be34c71
Message:

Move latest version file to a json format

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • sasview/local_config.py

    r686fd10 r9989a6a  
    1313__build__ = sas.sasview.__build__ 
    1414__download_page__ = 'https://github.com/SasView/sasview/releases' 
    15 __update_URL__ = 'http://www.sasview.org/sasview.latestversion' 
     15__update_URL__ = 'http://www.sasview.org/latestversion.json' 
    1616 
    1717 
  • src/sas/guiframe/config.py

    r686fd10 r9989a6a  
    1010__build__ = '1' 
    1111__download_page__ = 'https://github.com/SasView/sasview/releases' 
    12 __update_URL__ = 'http://www.sasview.org/sasview.latestversion' 
     12__update_URL__ = 'http://www.sasview.org/latestversion.json' 
    1313 
    1414 
  • src/sas/guiframe/gui_manager.py

    r805f07a r9989a6a  
    2727import urllib 
    2828import urllib2 
    29  
     29import json 
    3030 
    3131from sas.guiframe.events import EVT_CATEGORY 
     
    20542054            content = "0.0.0" 
    20552055 
    2056         version = content.strip() 
    2057         if len(re.findall('\d+\.\d+\.\d+$', version)) < 0: 
    2058             content = "0.0.0" 
    2059         self._process_version(content, standalone=event == None) 
    2060  
    2061     def _process_version(self, version, standalone=True): 
     2056        version_info = json.loads(content) 
     2057        self._process_version(version_info, standalone=event == None) 
     2058 
     2059    def _process_version(self, version_info, standalone=True): 
    20622060        """ 
    20632061        Call-back method for the process of checking for updates. 
     
    20712069 
    20722070        """ 
     2071        version = version_info["version"] 
    20732072        try: 
    20742073            if version == "0.0.0": 
     
    20802079                if not standalone: 
    20812080                    import webbrowser 
    2082                     webbrowser.open(config.__download_page__) 
     2081                    if "download_url" in version_info: 
     2082                        webbrowser.open(version_info["download_url"]) 
     2083                    else: 
     2084                        webbrowser.open(config.__download_page__) 
    20832085                else: 
    20842086                    msg += "See the help menu to download it." 
Note: See TracChangeset for help on using the changeset viewer.