From df2c50aa600d10dbc38da59b80f84b58fd50151d Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Thu, 7 Jul 2016 11:28:57 +0200 Subject: [PATCH] Add class docstrings for webkittab/webenginetab --- qutebrowser/browser/webengine/webenginetab.py | 12 ++++++++++++ qutebrowser/browser/webkit/webkittab.py | 12 ++++++++++++ 2 files changed, 24 insertions(+) diff --git a/qutebrowser/browser/webengine/webenginetab.py b/qutebrowser/browser/webengine/webenginetab.py index 434e0067a..5ef430b82 100644 --- a/qutebrowser/browser/webengine/webenginetab.py +++ b/qutebrowser/browser/webengine/webenginetab.py @@ -35,6 +35,8 @@ from qutebrowser.utils import usertypes, qtutils class WebEngineSearch(tab.AbstractSearch): + """QtWebEngine implementations related to searching on the page.""" + ## TODO pass @@ -42,6 +44,8 @@ class WebEngineSearch(tab.AbstractSearch): class WebEngineCaret(tab.AbstractCaret): + """QtWebEngine implementations related to moving the cursor/selection.""" + ## TODO @pyqtSlot(usertypes.KeyMode) @@ -65,6 +69,8 @@ class WebEngineCaret(tab.AbstractCaret): class WebEngineScroller(tab.AbstractScroller): + """QtWebEngine implementations related to scrolling.""" + def _key_press(self, key, count=1): # FIXME Abort scrolling if the minimum/maximum was reached. press_evt = QKeyEvent(QEvent.KeyPress, key, Qt.NoModifier, 0, 0, 0) @@ -117,6 +123,8 @@ class WebEngineScroller(tab.AbstractScroller): class WebEngineHistory(tab.AbstractHistory): + """QtWebEngine implementations related to page history.""" + def current_idx(self): return self._history.currentItemIndex() @@ -145,6 +153,8 @@ class WebEngineHistory(tab.AbstractHistory): class WebEngineZoom(tab.AbstractZoom): + """QtWebEngine implementations related to zooming.""" + def _set_factor_internal(self, factor): self._widget.setZoomFactor(factor) @@ -154,6 +164,8 @@ class WebEngineZoom(tab.AbstractZoom): class WebEngineViewTab(tab.AbstractTab): + """A QtWebEngine tab in the browser.""" + def __init__(self, win_id, modeman, parent=None): super().__init__(win_id) widget = webview.WebEngineView() diff --git a/qutebrowser/browser/webkit/webkittab.py b/qutebrowser/browser/webkit/webkittab.py index 8197ae27b..239807b01 100644 --- a/qutebrowser/browser/webkit/webkittab.py +++ b/qutebrowser/browser/webkit/webkittab.py @@ -36,6 +36,8 @@ from qutebrowser.utils import qtutils, objreg, usertypes, utils class WebViewSearch(tabmod.AbstractSearch): + """QtWebKit implementations related to searching on the page.""" + def clear(self): # We first clear the marked text, then the highlights self._widget.search('', 0) @@ -76,6 +78,8 @@ class WebViewSearch(tabmod.AbstractSearch): class WebViewCaret(tabmod.AbstractCaret): + """QtWebKit implementations related to moving the cursor/selection.""" + @pyqtSlot(usertypes.KeyMode) def on_mode_entered(self, mode): if mode != usertypes.KeyMode.caret: @@ -294,6 +298,8 @@ class WebViewCaret(tabmod.AbstractCaret): class WebViewZoom(tabmod.AbstractZoom): + """QtWebKit implementations related to zooming.""" + def _set_factor_internal(self, factor): self._widget.setZoomFactor(factor) @@ -303,6 +309,8 @@ class WebViewZoom(tabmod.AbstractZoom): class WebViewScroller(tabmod.AbstractScroller): + """QtWebKit implementations related to scrolling.""" + def pos_px(self): return self._widget.page().mainFrame().scrollPosition() @@ -396,6 +404,8 @@ class WebViewScroller(tabmod.AbstractScroller): class WebViewHistory(tabmod.AbstractHistory): + """QtWebKit implementations related to page history.""" + def current_idx(self): return self._history.currentItemIndex() @@ -434,6 +444,8 @@ class WebViewHistory(tabmod.AbstractHistory): class WebViewTab(tabmod.AbstractTab): + """A QtWebKit tab in the browser.""" + def __init__(self, win_id, modeman, parent=None): super().__init__(win_id) widget = webview.WebView(win_id, self.tab_id, tab=self)