diff --git a/qutebrowser/commands/keys.py b/qutebrowser/commands/keys.py index 1ca7fea5e..15f60a4c2 100644 --- a/qutebrowser/commands/keys.py +++ b/qutebrowser/commands/keys.py @@ -84,7 +84,7 @@ class KeyParser(QObject): def _handle_modifier_key(self, e): """Handle a new keypress with modifiers. - Returns True if the keypress has been handled, and False if not. + Return True if the keypress has been handled, and False if not. e -- the KeyPressEvent from Qt @@ -118,11 +118,11 @@ class KeyParser(QObject): def _handle_single_key(self, e): """Handle a new keypress with a single key (no modifiers). - Separates the keypress into count/command, then checks if it matches - any possible command, and either runs the command, ignores it, or - displays an error. + Separate the keypress into count/command, then check if it matches + any possible command, and either run the command, ignore it, or + display an error. - e -- the KeyPressEvent from Qt + e -- the KeyPressEvent from Qt. """ # FIXME maybe we can do this in an easier way by using QKeySeqyence diff --git a/qutebrowser/utils/about.py b/qutebrowser/utils/about.py index cebf09619..17476bdd2 100644 --- a/qutebrowser/utils/about.py +++ b/qutebrowser/utils/about.py @@ -41,7 +41,7 @@ pyeval_output = None def handle(url): """Handle about page with an url. - Returns HTML content. + Return HTML content. """ if not is_about_url(url): diff --git a/qutebrowser/utils/completion.py b/qutebrowser/utils/completion.py index 340491fe0..64092f984 100644 --- a/qutebrowser/utils/completion.py +++ b/qutebrowser/utils/completion.py @@ -49,7 +49,7 @@ class CompletionModel(QAbstractItemModel): def removeRows(self, position=0, count=1, parent=QModelIndex()): """Remove rows from the model. - Overrides QAbstractItemModel::removeRows. + Override QAbstractItemModel::removeRows. """ node = self._node(parent) @@ -60,7 +60,7 @@ class CompletionModel(QAbstractItemModel): def _node(self, index): """Return the interal data representation for index. - Returns the CompletionItem for index, or the root CompletionItem if the + Return the CompletionItem for index, or the root CompletionItem if the index was invalid. """ @@ -72,7 +72,7 @@ class CompletionModel(QAbstractItemModel): def columnCount(self, parent=QModelIndex()): """Return the column count in the model. - Overrides QAbstractItemModel::columnCount. + Override QAbstractItemModel::columnCount. """ # pylint: disable=unused-argument @@ -81,8 +81,8 @@ class CompletionModel(QAbstractItemModel): def data(self, index, role=Qt.DisplayRole): """Return the data for role/index as QVariant. - Returns an invalid QVariant on error. - Overrides QAbstractItemModel::data. + Return an invalid QVariant on error. + Override QAbstractItemModel::data. """ if not index.isValid(): @@ -99,8 +99,8 @@ class CompletionModel(QAbstractItemModel): def flags(self, index): """Return the item flags for index. - Returns Qt.NoItemFlags on error. - Overrides QAbstractItemModel::flags. + Return Qt.NoItemFlags on error. + Override QAbstractItemModel::flags. """ # FIXME categories are not selectable, but moving via arrow keys still @@ -116,8 +116,8 @@ class CompletionModel(QAbstractItemModel): def headerData(self, section, orientation, role=Qt.DisplayRole): """Return the header data for role/index as QVariant. - Returns an invalid QVariant on error. - Overrides QAbstractItemModel::headerData. + Return an invalid QVariant on error. + Override QAbstractItemModel::headerData. """ if orientation == Qt.Horizontal and role == Qt.DisplayRole: @@ -127,8 +127,8 @@ class CompletionModel(QAbstractItemModel): def setData(self, index, value, role=Qt.EditRole): """Set the data for role/index to value. - Returns True on success, False on failure. - Overrides QAbstractItemModel::setData. + Return True on success, False on failure. + Override QAbstractItemModel::setData. """ if not index.isValid(): @@ -144,8 +144,8 @@ class CompletionModel(QAbstractItemModel): def index(self, row, column, parent=QModelIndex()): """Return the QModelIndex for row/column/parent. - Returns an invalid QModelIndex on failure. - Overrides QAbstractItemModel::index. + Return an invalid QModelIndex on failure. + Override QAbstractItemModel::index. """ if (0 <= row < self.rowCount(parent) and @@ -170,8 +170,8 @@ class CompletionModel(QAbstractItemModel): def parent(self, index): """Return the QModelIndex of the parent of the object behind index. - Returns an invalid QModelIndex on failure. - Overrides QAbstractItemModel::parent. + Return an invalid QModelIndex on failure. + Override QAbstractItemModel::parent. """ if not index.isValid(): @@ -184,8 +184,8 @@ class CompletionModel(QAbstractItemModel): def rowCount(self, parent=QModelIndex()): """Return the children count of an item. - Uses the root frame if parent is invalid. - Overrides QAbstractItemModel::data. + Use the root frame if parent is invalid. + Override QAbstractItemModel::rowCount. """ if parent.column() > 0: @@ -201,8 +201,8 @@ class CompletionModel(QAbstractItemModel): def sort(self, column, order=Qt.AscendingOrder): """Sort the data in column according to order. - Raises NotImplementedError, should be overwritten in a superclass. - Overrides QAbstractItemModel::sort. + Raise NotImplementedError, should be overwritten in a superclass. + Override QAbstractItemModel::sort. """ raise NotImplementedError @@ -355,12 +355,12 @@ class CompletionFilterModel(QSortFilterProxyModel): def filterAcceptsRow(self, row, parent): """Custom filter implementation. - Overrides QSortFilterProxyModel::filterAcceptsRow. + Override QSortFilterProxyModel::filterAcceptsRow. row -- The row of the item. parent -- The parent item QModelIndex. - Returns True if self.pattern is contained in item, or if it's a root + Return True if self.pattern is contained in item, or if it's a root item (category). Else returns False. """ diff --git a/qutebrowser/utils/config.py b/qutebrowser/utils/config.py index f7d4c1f49..1f63a6db6 100644 --- a/qutebrowser/utils/config.py +++ b/qutebrowser/utils/config.py @@ -184,7 +184,7 @@ class ColorDict(dict): def getraw(self, key): """Get a value without the transformations done in __getitem__. - Returns a value, or None if the value wasn't found. + Return a value, or None if the value wasn't found. """ try: @@ -216,7 +216,7 @@ class FontDict(dict): def getraw(self, key): """Get a value without the transformations done in __getitem__. - Returns a value, or None if the value wasn't found. + Return a value, or None if the value wasn't found. """ try: @@ -258,7 +258,7 @@ class Config(ConfigParser): def __getitem__(self, key): """Get an item from the configparser or default dict. - Extends ConfigParser's __getitem__. + Extend ConfigParser's __getitem__. """ try: @@ -269,7 +269,7 @@ class Config(ConfigParser): def get(self, *args, **kwargs): """Get an item from the configparser or default dict. - Extends ConfigParser's get(). + Extend ConfigParser's get(). """ if 'fallback' in kwargs: diff --git a/qutebrowser/widgets/browser.py b/qutebrowser/widgets/browser.py index 4442ed441..d40adc0e2 100644 --- a/qutebrowser/widgets/browser.py +++ b/qutebrowser/widgets/browser.py @@ -521,7 +521,7 @@ class BrowserTab(QWebView): def event(self, e): """Check if a link was clicked with the middle button or Ctrl. - Extends the superclass event(). + Extend the superclass event(). This also is a bit of a hack, but it seems it's the only possible way. Set the _open_new_tab attribute accordingly. diff --git a/qutebrowser/widgets/completion.py b/qutebrowser/widgets/completion.py index f63308a56..d93c533ed 100644 --- a/qutebrowser/widgets/completion.py +++ b/qutebrowser/widgets/completion.py @@ -170,7 +170,7 @@ class CompletionView(QTreeView): def tab_handler(self, shift): """Handle a tab press for the CompletionView. - Selects the previous/next item and writes the new text to the + Select the previous/next item and write the new text to the statusbar. Called by key_(s)tab_handler in statusbar.command. shift -- Whether shift is pressed or not. @@ -230,7 +230,7 @@ class CompletionItemDelegate(QStyledItemDelegate): def sizeHint(self, option, index): """Override sizeHint of QStyledItemDelegate. - Returns the cell size based on the QTextDocument size, but might not + Return the cell size based on the QTextDocument size, but might not work correctly yet. """ diff --git a/qutebrowser/widgets/statusbar.py b/qutebrowser/widgets/statusbar.py index 9054bde63..52a3158f1 100644 --- a/qutebrowser/widgets/statusbar.py +++ b/qutebrowser/widgets/statusbar.py @@ -290,7 +290,7 @@ class CommandValidator(QValidator): string -- The string to validate. pos -- The current curser position. - Returns a tuple (status, string, pos) as a QValidator should. + Return a tuple (status, string, pos) as a QValidator should. """ if any(string.startswith(c) for c in keys.startchars):