Changeset 914ba0a in sasview for src/sas/sasgui/guiframe/documentation_window.py
- Timestamp:
- May 2, 2017 3:58:01 PM (8 years ago)
- 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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sasgui/guiframe/documentation_window.py
refe730d r914ba0a 30 30 WX_SUPPORTS_HTML2 = False 31 31 32 33 ======= 34 """ 35 documentation module provides a simple means to add help throughout the 36 application. It checks for the existence of html2 package needed to support 37 fully html panel which supports css. The class defined here takes a title for 38 the particular help panel, a pointer to the html documentation file of interest 39 within the documentation tree along with a 'command' string such as a page 40 anchor or a query string etc. The path to the doc directory is retrieved 41 automatically by the class itself. Thus with these three pieces of information 42 the class generates a panel with the appropriate title bar and help file 43 formatted according the style sheets called in the html file. Finally, if an 44 old version of Python is running and the html2 package is not available the 45 class brings up the default browser and passes the file:/// string to it. In 46 this case however the instruction portion is usually not passed for security 47 reasons. 48 """ 49 import os 50 import logging 51 import webbrowser 52 import urllib 53 import sys 54 55 import wx 56 try: 57 import wx.html2 as html 58 WX_SUPPORTS_HTML2 = True 59 except: 60 WX_SUPPORTS_HTML2 = False 61 62 from sas.sasgui import get_app_dir 63 64 logger = logging.getLogger(__name__) 65 66 SPHINX_DOC_ENV = "SASVIEW_DOC_PATH" 32 67 33 68 class DocumentationWindow(wx.Frame): … … 70 105 71 106 if not os.path.exists(file_path): 72 logg ing.error("Could not find Sphinx documentation at %s \107 logger.error("Could not find Sphinx documentation at %s \ 73 108 -- has it been built?", file_path) 74 109 elif WX_SUPPORTS_HTML2: … … 78 113 self.Show() 79 114 else: 80 logg ing.error("No html2 support, popping up a web browser")115 logger.error("No html2 support, popping up a web browser") 81 116 #For cases that do not build against current version dependency 82 117 # Wx 3.0 we provide a webbrowser call - this is particularly for
Note: See TracChangeset
for help on using the changeset viewer.