From bc0ac62087ce0d700ee129467695e92692a6b8cc Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Fri, 30 Nov 2018 14:28:29 +0100 Subject: [PATCH] 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. --- qutebrowser/api/{tab.py => apitypes.py} | 0 qutebrowser/components/scrollcommands.py | 10 +++++----- 2 files changed, 5 insertions(+), 5 deletions(-) rename qutebrowser/api/{tab.py => apitypes.py} (100%) diff --git a/qutebrowser/api/tab.py b/qutebrowser/api/apitypes.py similarity index 100% rename from qutebrowser/api/tab.py rename to qutebrowser/api/apitypes.py diff --git a/qutebrowser/components/scrollcommands.py b/qutebrowser/components/scrollcommands.py index 10b7d7244..c749c5dbe 100644 --- a/qutebrowser/components/scrollcommands.py +++ b/qutebrowser/components/scrollcommands.py @@ -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: