Ignore:
Timestamp:
May 2, 2017 1:58:01 PM (7 years ago)
Author:
Paul Kienzle <pkienzle@…>
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, magnetic_scatt, release-4.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
d66dbcc
Parents:
74d9780 (diff), 658dd57 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

merge with master

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sasgui/guiframe/documentation_window.py

    refe730d r914ba0a  
    3030    WX_SUPPORTS_HTML2 = False 
    3131 
     32 
     33======= 
     34""" 
     35documentation module provides a simple means to add help throughout the 
     36application. It checks for the existence of html2 package needed to support 
     37fully html panel which supports css.  The class defined here takes a title for 
     38the particular help panel, a pointer to the html documentation file of interest 
     39within the documentation tree along with a 'command' string such as a page 
     40anchor or a query string etc.  The path to the doc directory is retrieved 
     41automatically by the class itself.  Thus with these three pieces of information 
     42the class generates a panel with the appropriate title bar and help file 
     43formatted according the style sheets called in the html file.  Finally, if an 
     44old version of Python is running and the html2 package is not available the 
     45class brings up the default browser and passes the file:/// string to it.  In 
     46this case however the instruction portion is usually not passed for security 
     47reasons. 
     48""" 
     49import os 
     50import logging 
     51import webbrowser 
     52import urllib 
     53import sys 
     54 
     55import wx 
     56try: 
     57    import wx.html2 as html 
     58    WX_SUPPORTS_HTML2 = True 
     59except: 
     60    WX_SUPPORTS_HTML2 = False 
     61 
     62from sas.sasgui import get_app_dir 
     63 
     64logger = logging.getLogger(__name__) 
     65 
     66SPHINX_DOC_ENV = "SASVIEW_DOC_PATH" 
    3267 
    3368class DocumentationWindow(wx.Frame): 
     
    70105 
    71106        if not os.path.exists(file_path): 
    72             logging.error("Could not find Sphinx documentation at %s \ 
     107            logger.error("Could not find Sphinx documentation at %s \ 
    73108            -- has it been built?", file_path) 
    74109        elif WX_SUPPORTS_HTML2: 
     
    78113            self.Show() 
    79114        else: 
    80             logging.error("No html2 support, popping up a web browser") 
     115            logger.error("No html2 support, popping up a web browser") 
    81116            #For cases that do not build against current version dependency 
    82117            # Wx 3.0 we provide a webbrowser call - this is particularly for 
Note: See TracChangeset for help on using the changeset viewer.