Changes in sasmodels/rst2html.py [f2f5413:990d8df] in sasmodels


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/rst2html.py

    rf2f5413 r990d8df  
    3838    - mathml 
    3939    - mathjax 
    40     See `http://docutils.sourceforge.net/docs/user/config.html#math-output`_ 
     40    See `<http://docutils.sourceforge.net/docs/user/config.html#math-output>`_ 
    4141    for details. 
    4242 
     
    211211    sys.exit(app.exec_()) 
    212212 
     213def can_use_qt(): 
     214    """ 
     215    Return True if QWebView exists. 
     216 
     217    Checks first in PyQt5 then in PyQt4 
     218    """ 
     219    try: 
     220        from PyQt5.QtWebKitWidgets import QWebView 
     221        return True 
     222    except ImportError: 
     223        try: 
     224            from PyQt4.QtWebkit import QWebView 
     225            return True 
     226        except ImportError: 
     227            return False 
     228 
    213229def view_help(filename, qt=False): 
    214230    import os 
    215     url="file:///"+os.path.abspath(filename).replace("\\","/") 
     231 
     232    if qt: 
     233        qt = can_use_qt() 
     234 
     235    url = "file:///"+os.path.abspath(filename).replace("\\", "/") 
    216236    if filename.endswith('.rst'): 
    217237        html = load_rst_as_html(filename) 
Note: See TracChangeset for help on using the changeset viewer.