From b68d28c1da376547672ca00ef7bc16e94030db18 Mon Sep 17 00:00:00 2001 From: hut Date: Fri, 22 Feb 2013 20:24:09 +0100 Subject: Fix docstrings to comply with the PEP8 http://www.python.org/dev/peps/pep-0008/#documentation-strings --- ranger/__init__.py | 6 +- ranger/api/__init__.py | 10 +-- ranger/colorschemes/__init__.py | 4 +- ranger/config/commands.py | 133 +++++++++++++-------------------- ranger/container/__init__.py | 5 +- ranger/container/bookmarks.py | 20 +++-- ranger/core/actions.py | 7 +- ranger/core/fm.py | 9 +-- ranger/core/loader.py | 15 ++-- ranger/core/main.py | 4 +- ranger/core/runner.py | 9 +-- ranger/core/shared.py | 3 +- ranger/core/tab.py | 4 +- ranger/ext/curses_interrupt_handler.py | 3 +- ranger/ext/direction.py | 6 +- ranger/ext/get_executables.py | 7 +- ranger/ext/human_readable.py | 3 +- ranger/ext/img_display.py | 23 ++---- ranger/ext/iter_tools.py | 6 +- ranger/ext/keybinding_parser.py | 7 +- ranger/ext/lazy_property.py | 3 +- ranger/ext/popen_forked.py | 3 +- ranger/ext/rifle.py | 20 ++--- ranger/ext/run_forked.py | 3 +- ranger/ext/shell_escape.py | 4 +- ranger/ext/shutil_generatorized.py | 1 - ranger/ext/signals.py | 30 +++----- ranger/fsobject/__init__.py | 5 +- ranger/fsobject/directory.py | 14 ++-- ranger/fsobject/fsobject.py | 8 +- ranger/gui/ansi.py | 10 +-- ranger/gui/color.py | 7 +- ranger/gui/colorscheme.py | 15 ++-- ranger/gui/curses_shortcuts.py | 4 +- ranger/gui/displayable.py | 40 +++++----- ranger/gui/widgets/__init__.py | 5 +- ranger/gui/widgets/browsercolumn.py | 7 +- ranger/gui/widgets/browserview.py | 1 + ranger/gui/widgets/console.py | 8 +- ranger/gui/widgets/pager.py | 5 +- ranger/gui/widgets/statusbar.py | 3 +- ranger/gui/widgets/taskview.py | 4 +- ranger/gui/widgets/titlebar.py | 3 +- 43 files changed, 189 insertions(+), 298 deletions(-) diff --git a/ranger/__init__.py b/ranger/__init__.py index 8dbd7fc6..da6b234c 100644 --- a/ranger/__init__.py +++ b/ranger/__init__.py @@ -1,8 +1,7 @@ # Copyright (C) 2009-2013 Roman Zimbelmann # This software is distributed under the terms of the GNU GPL version 3. -""" -A console file manager with VI key bindings. +"""A console file manager with VI key bindings. It provides a minimalistic and nice curses interface with a view on the directory hierarchy. The secondary task of ranger is to figure out which @@ -37,8 +36,7 @@ CONFDIR = '~/.config/ranger' # Example usage in the code: # import ranger; ranger.log("hello world") def log(*objects, **keywords): - """ - Writes objects to a logfile (for the purpose of debugging only.) + """Writes objects to a logfile (for the purpose of debugging only.) Has the same arguments as print() in python3. """ from ranger import arg diff --git a/ranger/api/__init__.py b/ranger/api/__init__.py index 9fbf2418..a50f706f 100644 --- a/ranger/api/__init__.py +++ b/ranger/api/__init__.py @@ -1,11 +1,10 @@ -""" -Files in this module contain helper functions used in configuration files. -""" +"""Files in this module contain helper functions used in configuration files.""" # Hooks for use in plugins: def hook_init(fm): - """ + """A hook that is called when ranger starts up. + Parameters: fm = the file manager instance Return Value: @@ -17,7 +16,8 @@ def hook_init(fm): """ def hook_ready(fm): - """ + """A hook that is called after the ranger UI is initialized. + Parameters: fm = the file manager instance Return Value: diff --git a/ranger/colorschemes/__init__.py b/ranger/colorschemes/__init__.py index a442d9c7..fb52df0e 100644 --- a/ranger/colorschemes/__init__.py +++ b/ranger/colorschemes/__init__.py @@ -1,3 +1 @@ -""" -Colorschemes are required to be located here or in CONFDIR/colorschemes/ -""" +"""Colorschemes are required to be located here or in CONFDIR/colorschemes/""" diff --git a/ranger/config/commands.py b/ranger/config/commands.py index ba1b6646..280c0cd8 100644 --- a/ranger/config/commands.py +++ b/ranger/config/commands.py @@ -79,8 +79,7 @@ from ranger.api.commands import * class alias(Command): - """ - :alias + """:alias Copies the oldcommand as newcommand. """ @@ -95,8 +94,7 @@ class alias(Command): self.fm.commands.alias(self.arg(1), self.rest(2)) class cd(Command): - """ - :cd [-r] + """:cd [-r] The cd command changes the directory. The command 'cd -' is equivalent to typing ``. @@ -172,8 +170,8 @@ class cd(Command): class chain(Command): - """ - :chain ; ; ... + """:chain ; ; ... + Calls multiple commands at once, separated by semicolons. """ def execute(self): @@ -247,8 +245,7 @@ class open_with(Command): return self._tab_through_executables() def _get_app_flags_mode(self, string): - """ - Extracts the application, flags and mode from a string. + """Extracts the application, flags and mode from a string. examples: "mplayer f 1" => ("mplayer", "f", 1) @@ -331,8 +328,7 @@ class open_with(Command): class find(Command): - """ - :find + """:find The find command will attempt to find a partial, case insensitive match in the filenames of the current directory and execute the @@ -386,8 +382,7 @@ class find(Command): class set_(Command): - """ - :set