Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/guiframe/gui_manager.py

    ra4340d1 r9bbb627  
    2424import logging 
    2525import httplib 
     26import webbrowser 
    2627 
    2728 
     
    21522153    def _onSphinxDocs(self, evt): 
    21532154        """ 
    2154         Bring up Sphinx Documentation at top level whenever the menu item 
    2155         'documentation' is clicked. Calls DocumentationWindow with the top 
    2156         level path of "index.html" 
     2155        Bring up Sphinx Documentation.  If Wx 2.9 or higher is installed  
     2156        with proper HTML support then Pop up a Sphinx Documentation dialog 
     2157        locally.  If not pop up a new tab in the default system browser  
     2158        calling the documentation website. 
    21572159         
    21582160        :param evt: menu event 
     
    21602162        # Running SasView "in-place" using run.py means the docs will be in a 
    21612163        # different place than they would otherwise. 
    2162         from documentation_window import DocumentationWindow 
    2163          
    2164         sphinx_doc_viewer = DocumentationWindow(self, -1, "index.html") 
    2165 #        sphinx_doc_viewer.Show() 
    2166  
     2164 
     2165        show_sphinx_docs = float(wx.__version__[:3]) >= 2.9 
     2166        if show_sphinx_docs: 
     2167            SPHINX_DOC_ENV = "SASVIEW_DOC_PATH" 
     2168            if SPHINX_DOC_ENV in os.environ: 
     2169                docs_path = os.path.join(os.environ[SPHINX_DOC_ENV], "index.html") 
     2170            else: 
     2171                docs_path = os.path.join(PATH_APP, "..", "..", "doc", "index.html") 
     2172 
     2173            if os.path.exists(docs_path): 
     2174                from documentation_window import DocumentationWindow 
     2175 
     2176                sphinx_doc_viewer = DocumentationWindow(None, -1, docs_path) 
     2177                sphinx_doc_viewer.Show() 
     2178            else: 
     2179                logging.error("Could not find Sphinx documentation at '%' -- has it been built?" % docs_path) 
     2180        else: 
     2181            #For red hat and maybe others who do not have Wx 3.0 
     2182            #just send to webpage of documentation 
     2183            webbrowser.open_new_tab('http://www.sasview.org/sasview') 
    21672184 
    21682185    def set_manager(self, manager): 
Note: See TracChangeset for help on using the changeset viewer.