Update attributes in docstrings.
This commit is contained in:
parent
f2b46dc2e9
commit
05ff908c4f
@ -38,7 +38,11 @@ class ArgumentParserError(Exception):
|
||||
|
||||
class ArgumentParserExit(Exception):
|
||||
|
||||
"""Exception raised when the argument parser exitted."""
|
||||
"""Exception raised when the argument parser exitted.
|
||||
|
||||
Attributes:
|
||||
status: The exit status.
|
||||
"""
|
||||
|
||||
def __init__(self, status, msg):
|
||||
self.status = status
|
||||
@ -61,7 +65,11 @@ class HelpAction(argparse.Action):
|
||||
|
||||
class ArgumentParser(argparse.ArgumentParser):
|
||||
|
||||
"""Subclass ArgumentParser to be more suitable for runtime parsing."""
|
||||
"""Subclass ArgumentParser to be more suitable for runtime parsing.
|
||||
|
||||
Attributes:
|
||||
name: The command name.
|
||||
"""
|
||||
|
||||
def __init__(self, name, *args, **kwargs):
|
||||
self.name = name
|
||||
|
@ -258,6 +258,9 @@ class _WindowsUserscriptRunner(_BaseUserscriptRunner):
|
||||
|
||||
This also means the userscript *has* to use >> (append) rather than >
|
||||
(overwrite) to write to the file!
|
||||
|
||||
Attributes:
|
||||
_oshandle: The oshandle of the temp file.
|
||||
"""
|
||||
|
||||
def __init__(self, parent=None):
|
||||
|
@ -64,6 +64,13 @@ class DocstringParser:
|
||||
"""Generate documentation based on a docstring of a command handler.
|
||||
|
||||
The docstring needs to follow the format described in HACKING.
|
||||
|
||||
Attributes:
|
||||
_state: The current state of the parser state machine.
|
||||
_cur_arg_name: The name of the argument we're currently handling.
|
||||
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
|
||||
"""
|
||||
|
||||
State = usertypes.enum('State', 'short', 'desc', 'desc_hidden',
|
||||
|
@ -30,7 +30,14 @@ from qutebrowser.utils import message, log
|
||||
|
||||
class ExternalEditor(QObject):
|
||||
|
||||
"""Class to simplify editing a text in an external editor."""
|
||||
"""Class to simplify editing a text in an external editor.
|
||||
|
||||
Attributes:
|
||||
_text: The current text before the editor is opened.
|
||||
_oshandle: The OS level handle to the tmpfile.
|
||||
_filehandle: The file handle to the tmpfile.
|
||||
_proc: The QProcess of the editor.
|
||||
"""
|
||||
|
||||
editing_finished = pyqtSignal(str)
|
||||
|
||||
|
@ -28,7 +28,11 @@ from qutebrowser.utils import utils
|
||||
|
||||
class Loader(jinja2.BaseLoader):
|
||||
|
||||
"""Jinja loader which uses utils.read_file to load templates."""
|
||||
"""Jinja loader which uses utils.read_file to load templates.
|
||||
|
||||
Attributes:
|
||||
_subdir: The subdirectory to find templates in.
|
||||
"""
|
||||
|
||||
def __init__(self, subdir):
|
||||
self._subdir = subdir
|
||||
|
@ -362,7 +362,12 @@ class RAMHandler(logging.Handler):
|
||||
|
||||
class HTMLFormatter(logging.Formatter):
|
||||
|
||||
"""Formatter for HTML-colored log messages, similiar to colorlog."""
|
||||
"""Formatter for HTML-colored log messages, similiar to colorlog.
|
||||
|
||||
Attributes:
|
||||
_log_colors: The colors to use for logging levels.
|
||||
_colordict: The colordict passed to the logger.
|
||||
"""
|
||||
|
||||
def __init__(self, fmt, datefmt, log_colors):
|
||||
"""Constructor.
|
||||
|
@ -33,7 +33,14 @@ from qutebrowser.widgets import misc
|
||||
|
||||
class ConsoleLineEdit(misc.CommandLineEdit):
|
||||
|
||||
"""A QLineEdit which executes entered code and provides a history."""
|
||||
"""A QLineEdit which executes entered code and provides a history.
|
||||
|
||||
Attributes:
|
||||
_history: The command history of executed commands.
|
||||
_more: A flag which is set when more input is expected.
|
||||
_buffer: The buffer for multiline commands.
|
||||
_interpreter: The InteractiveInterpreter to execute code with.
|
||||
"""
|
||||
|
||||
write = pyqtSignal(str)
|
||||
|
||||
@ -162,7 +169,13 @@ class ConsoleTextEdit(QTextEdit):
|
||||
|
||||
class ConsoleWidget(QWidget):
|
||||
|
||||
"""A widget with an interactive Python console."""
|
||||
"""A widget with an interactive Python console.
|
||||
|
||||
Attributes:
|
||||
_lineedit: The line edit in the console.
|
||||
_output: The output widget in the console.
|
||||
_vbox: The layout which contains everything.
|
||||
"""
|
||||
|
||||
def __init__(self, parent=None):
|
||||
super().__init__(parent)
|
||||
|
@ -98,7 +98,11 @@ class CommandLineEdit(QLineEdit):
|
||||
|
||||
class _CommandValidator(QValidator):
|
||||
|
||||
"""Validator to prevent the : from getting deleted."""
|
||||
"""Validator to prevent the : from getting deleted.
|
||||
|
||||
Attributes:
|
||||
prompt: The current prompt.
|
||||
"""
|
||||
|
||||
def __init__(self, parent=None):
|
||||
super().__init__(parent)
|
||||
|
@ -34,9 +34,7 @@ class Command(misc.MinimalLineEditMixin, misc.CommandLineEdit):
|
||||
"""The commandline part of the statusbar.
|
||||
|
||||
Attributes:
|
||||
cursor_part: The part the cursor is currently over.
|
||||
parts: A list of strings with the split commandline
|
||||
prefix: The prefix currently entered.
|
||||
_cursor_part: The part the cursor is currently over.
|
||||
|
||||
Signals:
|
||||
got_cmd: Emitted when a command is triggered by the user.
|
||||
|
Loading…
Reference in New Issue
Block a user