Changeset 90662e6 in sasview
- Timestamp:
- Jun 5, 2015 9:22:28 AM (9 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, 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:
- 41eee5f
- Parents:
- 5ac0a7a
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/guiframe/documentation_window.py
r78bcf3c3 r90662e6 2 2 import logging 3 3 import wx 4 from wx import Frame5 4 import webbrowser 6 wx_supports_html2 = float(wx.__version__[:3]) >= 2.9 7 if wx_supports_html2: 5 6 wx_supports_html2 = True 7 try: 8 8 import wx.html2 as html 9 else: 10 import wx.html as html 9 except: 10 wx_supports_html2 = False 11 11 12 from gui_manager import get_app_dir 12 13 13 PATH_APP = get_app_dir()14 14 15 class DocumentationWindow( Frame):15 class DocumentationWindow(wx.Frame): 16 16 def __init__(self, parent, id, path, title, size=(850, 540)): 17 Frame.__init__(self, parent, id, title, size=size)17 wx.Frame.__init__(self, parent, id, title, size=size) 18 18 19 19 SPHINX_DOC_ENV = "SASVIEW_DOC_PATH" … … 24 24 # bothering to worry about docs when running using the old 25 25 # (non - run.py) way. 26 docs_path = os.path.join( PATH_APP, "doc")26 docs_path = os.path.join(get_app_dir(), "doc") 27 27 28 28 file_path = "file:///" + docs_path + "/" + path 29 29 30 if not os.path.exists( docs_path):30 if not os.path.exists(file_path): 31 31 logging.error("Could not find Sphinx documentation at %s \ 32 -- has it been built?", docs_path)32 -- has it been built?", file_path) 33 33 elif wx_supports_html2: 34 34 # Complete HTML/CSS support! … … 37 37 self.Show() 38 38 else: 39 logging.error("No html2 support, popping up a web browser") 39 40 #For cases that do not build against current version dependency 40 41 # Wx 3.0 we provide a webbrowser call - this is particularly for … … 43 44 webbrowser.open_new_tab(file_path) 44 45 45 46 def main(): 47 app = wx.App() 48 DocumentationWindow(None, -1, "index.html", "Documentation",) 49 app.MainLoop() 50 51 if __name__ == '__main__': 52 main()
Note: See TracChangeset
for help on using the changeset viewer.