Rename api.tab.Tab to api.apitypes.Tab

Then we can add other related types there, and we don't clash with the common
"tab" argument for a new tab.
This commit is contained in:
Florian Bruhin 2018-11-30 14:28:29 +01:00
parent 88205a8d32
commit bc0ac62087
2 changed files with 5 additions and 5 deletions

View File

@ -19,13 +19,13 @@
"""Scrolling-related commands."""
from qutebrowser.api import cmdutils, tab
from qutebrowser.api import cmdutils, apitypes
@cmdutils.register()
@cmdutils.argument('tab', value=cmdutils.Value.tab)
@cmdutils.argument('count', value=cmdutils.Value.count)
def scroll_px(tab: tab.Tab, dx: int, dy: int, count: int = 1) -> None:
def scroll_px(tab: apitypes.Tab, dx: int, dy: int, count: int = 1) -> None:
"""Scroll the current tab by 'count * dx/dy' pixels.
Args:
@ -43,7 +43,7 @@ def scroll_px(tab: tab.Tab, dx: int, dy: int, count: int = 1) -> None:
@cmdutils.register()
@cmdutils.argument('tab', value=cmdutils.Value.tab)
@cmdutils.argument('count', value=cmdutils.Value.count)
def scroll(tab: tab.Tab, direction: str, count: int = 1) -> None:
def scroll(tab: apitypes.Tab, direction: str, count: int = 1) -> None:
"""Scroll the current tab in the given direction.
Note you can use `:run-with-count` to have a keybinding with a bigger
@ -82,7 +82,7 @@ def scroll(tab: tab.Tab, direction: str, count: int = 1) -> None:
@cmdutils.argument('tab', value=cmdutils.Value.tab)
@cmdutils.argument('count', value=cmdutils.Value.count)
@cmdutils.argument('horizontal', flag='x')
def scroll_to_perc(tab: tab.Tab, count: int = None,
def scroll_to_perc(tab: apitypes.Tab, count: int = None,
perc: float = None, horizontal: bool = False) -> None:
"""Scroll to a specific percentage of the page.
@ -112,7 +112,7 @@ def scroll_to_perc(tab: tab.Tab, count: int = None,
@cmdutils.register()
@cmdutils.argument('tab', value=cmdutils.Value.tab)
def scroll_to_anchor(tab: tab.Tab, name):
def scroll_to_anchor(tab: apitypes.Tab, name):
"""Scroll to the given anchor in the document.
Args: