Ignore:
File:
1 edited

Legend:

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

    ra4340d1 r79492222  
    1 import os 
    2 import logging 
    31import wx 
    42from wx import Frame 
    5 import webbrowser 
     3 
    64wx_supports_html2 = float(wx.__version__[:3]) >= 2.9 
    75if wx_supports_html2: 
     
    108    import wx.html as html 
    119 
    12     
    1310class DocumentationWindow(Frame): 
    1411    def __init__(self, parent, id, path, title='Help', size=(850, 540)): 
    1512        Frame.__init__(self, parent, id, title, size=size) 
    1613 
    17         SPHINX_DOC_ENV = "SASVIEW_DOC_PATH" 
    18         if SPHINX_DOC_ENV in os.environ: 
    19             docs_path = os.path.join(os.environ[SPHINX_DOC_ENV]) 
    20         else: 
    21             docs_path = os.path.join(PATH_APP, "..", "..", "doc") 
    22  
    23         if (not os.path.exists(docs_path)): 
    24             print "logging" 
    25             logging.error("Could not find Sphinx documentation at %s \ 
    26             -- has it been built?", docs_path) 
    27  
    28         elif wx_supports_html2: 
     14        if wx_supports_html2: 
    2915            # Complete HTML/CSS support! 
    3016            self.view = html.WebView.New(self) 
    31             self.view.LoadURL("file://" + docs_path + '\\' + path) 
    32             self.Show() 
    33         else:  
    34             #For cases that do not build against current version dependency 
    35             # Wx 3.0 we provide a webbrowser call - this is particularly for  
    36             #Red hat used at SNS for which Wx 3.0 is not available.  This 
    37             #does not deal with issue of math in docs of course.  
    38  
    39             webbrowser.open_new_tab("file:///" + docs_path + "/" + path) 
    40  
    41   
     17            self.view.LoadURL("file://" + path) 
     18        else: 
     19            # This ain't gonna be pretty... 
     20            self.view = html.HtmlWindow(self, -1, style=wx.NO_BORDER) 
     21            self.view.LoadPage(path) 
Note: See TracChangeset for help on using the changeset viewer.