Fix lint
This commit is contained in:
parent
5e6150e665
commit
381b06e967
@ -53,4 +53,4 @@ defining-attr-methods=__init__,__new__,setUp
|
|||||||
max-args=10
|
max-args=10
|
||||||
|
|
||||||
[TYPECHECK]
|
[TYPECHECK]
|
||||||
ignored-classes=WebElementWrapper
|
ignored-classes=WebElementWrapper,AnsiCodes
|
||||||
|
@ -670,7 +670,7 @@ class CommandDispatcher:
|
|||||||
@cmdutils.register(instance='mainwindow.tabs.cmd', name='help',
|
@cmdutils.register(instance='mainwindow.tabs.cmd', name='help',
|
||||||
completion=[usertypes.Completion.helptopic])
|
completion=[usertypes.Completion.helptopic])
|
||||||
def show_help(self, topic):
|
def show_help(self, topic):
|
||||||
"""Show help about a command or setting.
|
r"""Show help about a command or setting.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
topic: The topic to show help for.
|
topic: The topic to show help for.
|
||||||
|
@ -54,7 +54,7 @@ class Command:
|
|||||||
completion, modes, not_modes, needs_js, is_debug, parser,
|
completion, modes, not_modes, needs_js, is_debug, parser,
|
||||||
type_conv, opt_args, pos_args):
|
type_conv, opt_args, pos_args):
|
||||||
# I really don't know how to solve this in a better way, I tried.
|
# I really don't know how to solve this in a better way, I tried.
|
||||||
# pylint: disable=too-many-arguments
|
# pylint: disable=too-many-arguments,too-many-locals
|
||||||
self.name = name
|
self.name = name
|
||||||
self.split = split
|
self.split = split
|
||||||
self.hide = hide
|
self.hide = hide
|
||||||
|
@ -167,7 +167,6 @@ class CommandCompletionModel(basecompletion.BaseCompletionModel):
|
|||||||
self.new_item(cat, name, desc)
|
self.new_item(cat, name, desc)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class HelpCompletionModel(basecompletion.BaseCompletionModel):
|
class HelpCompletionModel(basecompletion.BaseCompletionModel):
|
||||||
|
|
||||||
"""A CompletionModel filled with help topics."""
|
"""A CompletionModel filled with help topics."""
|
||||||
@ -180,6 +179,7 @@ class HelpCompletionModel(basecompletion.BaseCompletionModel):
|
|||||||
self._init_settings()
|
self._init_settings()
|
||||||
|
|
||||||
def _init_commands(self):
|
def _init_commands(self):
|
||||||
|
"""Fill completion with :command entries."""
|
||||||
assert cmdutils.cmd_dict
|
assert cmdutils.cmd_dict
|
||||||
cmdlist = []
|
cmdlist = []
|
||||||
for obj in set(cmdutils.cmd_dict.values()):
|
for obj in set(cmdutils.cmd_dict.values()):
|
||||||
@ -193,6 +193,7 @@ class HelpCompletionModel(basecompletion.BaseCompletionModel):
|
|||||||
self.new_item(cat, name, desc)
|
self.new_item(cat, name, desc)
|
||||||
|
|
||||||
def _init_settings(self):
|
def _init_settings(self):
|
||||||
|
"""Fill completion with section->option entries."""
|
||||||
cat = self.new_category("Settings")
|
cat = self.new_category("Settings")
|
||||||
for sectname, sectdata in configdata.DATA.items():
|
for sectname, sectdata in configdata.DATA.items():
|
||||||
for optname in sectdata.keys():
|
for optname in sectdata.keys():
|
||||||
|
@ -35,10 +35,9 @@ import colorama as col
|
|||||||
|
|
||||||
sys.path.insert(0, os.getcwd())
|
sys.path.insert(0, os.getcwd())
|
||||||
|
|
||||||
import qutebrowser
|
|
||||||
# We import qutebrowser.app so all @cmdutils-register decorators are run.
|
# We import qutebrowser.app so all @cmdutils-register decorators are run.
|
||||||
import qutebrowser.app
|
import qutebrowser.app
|
||||||
from qutebrowser import qutebrowser as qutequtebrowser
|
from qutebrowser import qutebrowser
|
||||||
from qutebrowser.commands import cmdutils
|
from qutebrowser.commands import cmdutils
|
||||||
from qutebrowser.config import configdata
|
from qutebrowser.config import configdata
|
||||||
from qutebrowser.utils import utils
|
from qutebrowser.utils import utils
|
||||||
@ -70,6 +69,7 @@ class UsageFormatter(argparse.HelpFormatter):
|
|||||||
result = "'{}'".format(default_metavar)
|
result = "'{}'".format(default_metavar)
|
||||||
|
|
||||||
def fmt(tuple_size):
|
def fmt(tuple_size):
|
||||||
|
"""Format the result according to the tuple size."""
|
||||||
if isinstance(result, tuple):
|
if isinstance(result, tuple):
|
||||||
return result
|
return result
|
||||||
else:
|
else:
|
||||||
@ -99,7 +99,7 @@ def _open_file(name, mode='w'):
|
|||||||
return open(name, mode, newline='\n', encoding='utf-8')
|
return open(name, mode, newline='\n', encoding='utf-8')
|
||||||
|
|
||||||
|
|
||||||
def _get_cmd_syntax(name, cmd):
|
def _get_cmd_syntax(_name, cmd):
|
||||||
"""Get the command syntax for a command.
|
"""Get the command syntax for a command.
|
||||||
|
|
||||||
We monkey-patch the parser's formatter_class here to use our UsageFormatter
|
We monkey-patch the parser's formatter_class here to use our UsageFormatter
|
||||||
@ -369,7 +369,7 @@ def regenerate_authors(filename):
|
|||||||
def regenerate_manpage(filename):
|
def regenerate_manpage(filename):
|
||||||
"""Update manpage OPTIONS using an argparse parser."""
|
"""Update manpage OPTIONS using an argparse parser."""
|
||||||
# pylint: disable=protected-access
|
# pylint: disable=protected-access
|
||||||
parser = qutequtebrowser.get_argparser()
|
parser = qutebrowser.get_argparser()
|
||||||
groups = []
|
groups = []
|
||||||
# positionals, optionals and user-defined groups
|
# positionals, optionals and user-defined groups
|
||||||
for group in parser._action_groups:
|
for group in parser._action_groups:
|
||||||
@ -388,6 +388,12 @@ def regenerate_manpage(filename):
|
|||||||
|
|
||||||
|
|
||||||
def call_asciidoc(src, dst):
|
def call_asciidoc(src, dst):
|
||||||
|
"""Call asciidoc for the given files.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
src: The source .asciidoc file.
|
||||||
|
dst: The destination .html file, or None to auto-guess.
|
||||||
|
"""
|
||||||
print("{}Calling asciidoc for {}...{}".format(
|
print("{}Calling asciidoc for {}...{}".format(
|
||||||
col.Fore.CYAN, os.path.basename(src), col.Fore.RESET))
|
col.Fore.CYAN, os.path.basename(src), col.Fore.RESET))
|
||||||
args = ['asciidoc']
|
args = ['asciidoc']
|
||||||
@ -401,7 +407,8 @@ def call_asciidoc(src, dst):
|
|||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
def main():
|
||||||
|
"""Regenerate all documentation."""
|
||||||
print("{}Generating asciidoc files...{}".format(
|
print("{}Generating asciidoc files...{}".format(
|
||||||
col.Fore.CYAN, col.Fore.RESET))
|
col.Fore.CYAN, col.Fore.RESET))
|
||||||
regenerate_manpage('doc/qutebrowser.1.asciidoc')
|
regenerate_manpage('doc/qutebrowser.1.asciidoc')
|
||||||
@ -416,3 +423,6 @@ if __name__ == '__main__':
|
|||||||
('README.asciidoc', None)]
|
('README.asciidoc', None)]
|
||||||
for src, dst in asciidoc_files:
|
for src, dst in asciidoc_files:
|
||||||
call_asciidoc(src, dst)
|
call_asciidoc(src, dst)
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
main()
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with qutebrowser. If not, see <http://www.gnu.org/licenses/>.
|
# along with qutebrowser. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
# pylint: disable=broad-except, no-member
|
# pylint: disable=broad-except
|
||||||
|
|
||||||
""" Run different codecheckers over a codebase.
|
""" Run different codecheckers over a codebase.
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user