Changeset ee22241 in sasview for src/sas/qtgui/Utilities


Ignore:
Timestamp:
Sep 24, 2018 9:15:49 AM (6 years ago)
Author:
rozyczko <piotr.rozyczko@…>
Branches:
ESS_GUI, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc
Children:
2dce1d8
Parents:
712db9e
Message:

Refactored onHelp a bit to allow more encapsulation. SASVIEW-1112

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/qtgui/Utilities/GuiUtils.py

    r9ce69ec ree22241  
    584584        msg = "Attempt at opening an invalid URL" 
    585585        raise AttributeError(msg) 
     586 
     587def showHelp(url): 
     588    """ 
     589    Open a local url in the default browser 
     590    """ 
     591    location = HELP_DIRECTORY_LOCATION + url 
     592    #WP: Added to handle OSX bundle docs 
     593    if os.path.isdir(location) == False: 
     594        sas_path = os.path.abspath(os.path.dirname(sys.argv[0])) 
     595        location = sas_path+"/"+location 
     596    try: 
     597        webbrowser.open('file://' + os.path.realpath(location)) 
     598    except webbrowser.Error as ex: 
     599        logging.warning("Cannot display help. %s" % ex) 
    586600 
    587601def retrieveData1d(data): 
Note: See TracChangeset for help on using the changeset viewer.