Coverage for qutebrowser/utils/docutils.py : 96%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2014-2018 Florian Bruhin (The Compiler) <mail@qutebrowser.org> # # This file is part of qutebrowser. # # qutebrowser is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # qutebrowser is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with qutebrowser. If not, see <http://www.gnu.org/licenses/>.
"""Check if we're running from a git repository."""
"""Check if the generated html documentation is up to date.
Args: path: The path of the document to check.
Return: True if they are up to date or we couldn't check. False if they are outdated. """ return True 'doc', 'help', filename + '.asciidoc') asciidoc_time = os.path.getmtime(asciidoc_path) return asciidoc_time <= html_time
"""Generate documentation based on a docstring of a command handler.
The docstring needs to follow the format described in doc/contributing.
Attributes: _state: The current state of the parser state machine. _cur_arg_name: The name of the argument we're currently handling. _short_desc_parts: The short description of the function as list. _long_desc_parts: The long description of the function as list. short_desc: The short description of the function. long_desc: The long description of the function. arg_descs: A dict of argument names to their descriptions """
'arg_start', 'arg_inside', 'misc'])
"""Constructor.
Args: func: The function to parse the docstring for. """ self.State.short: self._parse_short, self.State.desc: self._parse_desc, self.State.desc_hidden: self._skip, self.State.arg_start: self._parse_arg_start, self.State.arg_inside: self._parse_arg_inside, self.State.misc: self._skip, } "Function {}() from {} has no docstring".format( utils.qualname(func), inspect.getsourcefile(func)))
"""Helper method to process a line like 'fooarg: Blah blub'."""
"""Handler to ignore everything until we get 'Args:'."""
"""Parse the short description (first block) in the docstring.""" else:
"""Parse the long description in the docstring."""
"""Parse first argument line."""
"""Parse subsequent argument lines.""" else: |