Changeset b297ba9 in sasmodels for sasmodels/rst2html.py


Ignore:
Timestamp:
Mar 20, 2019 5:03:50 PM (5 years ago)
Author:
Paul Kienzle <pkienzle@…>
Branches:
master, core_shell_microgels, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
Children:
4e28511
Parents:
0d362b7
Message:

lint

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/rst2html.py

    r1fbadb2 rb297ba9  
    142142 
    143143def load_rst_as_html(filename): 
     144    # type: (str) -> str 
     145    """Load rst from file and convert to html""" 
    144146    from os.path import expanduser 
    145147    with open(expanduser(filename)) as fid: 
     
    149151 
    150152def wxview(html, url="", size=(850, 540)): 
     153    # type: (str, str, Tuple[int, int]) -> "wx.Frame" 
     154    """View HTML in a wx dialog""" 
    151155    import wx 
    152156    from wx.html2 import WebView 
     
    158162 
    159163def view_html_wxapp(html, url=""): 
     164    # type: (str, str) -> None 
     165    """HTML viewer app in wx""" 
    160166    import wx  # type: ignore 
    161167    app = wx.App() 
     
    164170 
    165171def view_url_wxapp(url): 
     172    # type: (str) -> None 
     173    """URL viewer app in wx""" 
    166174    import wx  # type: ignore 
    167175    from wx.html2 import WebView 
     
    174182 
    175183def qtview(html, url=""): 
     184    # type: (str, str) -> "QWebView" 
     185    """View HTML in a Qt dialog""" 
    176186    try: 
    177187        from PyQt5.QtWebKitWidgets import QWebView 
     
    186196 
    187197def view_html_qtapp(html, url=""): 
     198    # type: (str, str) -> None 
     199    """HTML viewer app in Qt""" 
    188200    import sys 
    189201    try: 
     
    196208 
    197209def view_url_qtapp(url): 
     210    # type: (str) -> None 
     211    """URL viewer app in Qt""" 
    198212    import sys 
    199213    try: 
     
    217231 
    218232def can_use_qt(): 
     233    # type: () -> bool 
    219234    """ 
    220235    Return True if QWebView exists. 
     
    233248 
    234249def view_help(filename, qt=False): 
     250    # type: (str, bool) -> None 
     251    """View rst or html file.  If *qt* use q viewer, otherwise use wx.""" 
    235252    import os 
    236253 
     
    252269 
    253270def main(): 
     271    # type: () -> None 
     272    """Command line interface to rst or html viewer.""" 
    254273    import sys 
    255274    view_help(sys.argv[1], qt=False) 
Note: See TracChangeset for help on using the changeset viewer.