summary refs log tree commit diff stats
path: root/ranger
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2009-12-17 21:52:51 +0100
committerhut <hut@lavabit.com>2009-12-17 21:52:51 +0100
commitb4b0eb249fbc2fa76e36eca898123509dd20d818 (patch)
tree21a0dd59613b07357b065fd907616006d728b72f /ranger
parent2b8338c11bd7b8d327321e21a6f1fc9d231d512e (diff)
downloadranger-b4b0eb249fbc2fa76e36eca898123509dd20d818.tar.gz
re-indented docstrings
Diffstat (limited to 'ranger')
-rw-r--r--ranger/actions.py10
-rw-r--r--ranger/container/__init__.py3
-rw-r--r--ranger/container/bookmarks.py31
-rw-r--r--ranger/container/environment.py6
-rw-r--r--ranger/ext/waitpid_no_intr.py2
-rw-r--r--ranger/fm.py10
-rw-r--r--ranger/fsobject/directory.py13
-rw-r--r--ranger/fsobject/fsobject.py11
-rw-r--r--ranger/gui/colorscheme.py5
-rw-r--r--ranger/gui/displayable.py24
-rw-r--r--ranger/gui/ui.py7
-rw-r--r--ranger/gui/widgets/__init__.py4
-rw-r--r--ranger/gui/widgets/statusbar.py6
13 files changed, 75 insertions, 57 deletions
diff --git a/ranger/actions.py b/ranger/actions.py
index 63d907e6..41c7a6eb 100644
--- a/ranger/actions.py
+++ b/ranger/actions.py
@@ -15,7 +15,7 @@ class Actions(EnvironmentAware, SettingsAware):
 
 	def interrupt(self):
 		"""Waits a short time.
-If CTRL+C is pressed while waiting, the program will be exited"""
+		If CTRL+C is pressed while waiting, the program will be exited"""
 		import time
 		self.env.key_clear()
 		try:
@@ -75,10 +75,10 @@ If CTRL+C is pressed while waiting, the program will be exited"""
 
 	def execute_file(self, files, app = '', flags = '', mode = 0):
 		"""Execute a file.
-app is the name of a method in Applications, without the "app_"
-flags is a string consisting of applications.ALLOWED_FLAGS
-mode is a positive integer.
-Both flags and mode specify how the program is run."""
+		app is the name of a method in Applications, without the "app_"
+		flags is a string consisting of applications.ALLOWED_FLAGS
+		mode is a positive integer.
+		Both flags and mode specify how the program is run."""
 
 		if type(files) not in (list, tuple):
 			files = [files]
diff --git a/ranger/container/__init__.py b/ranger/container/__init__.py
index 5a1cd9d8..bdb17110 100644
--- a/ranger/container/__init__.py
+++ b/ranger/container/__init__.py
@@ -1,5 +1,6 @@
 """This package includes container-objects which are
-used to manage stored data"""
+used to manage stored data
+"""
 from ranger.container.history import History
 from ranger.container.keybuffer import KeyBuffer
 from .commandlist import CommandList
diff --git a/ranger/container/bookmarks.py b/ranger/container/bookmarks.py
index d57ff4a9..b16180a0 100644
--- a/ranger/container/bookmarks.py
+++ b/ranger/container/bookmarks.py
@@ -9,14 +9,14 @@ class NonexistantBookmark(Exception):
 class Bookmarks(object):
 	"""Bookmarks is a container which associates keys with bookmarks.
 
-A key is a string with: len(key) == 1 and key in ALLOWED_KEYS.
+		A key is a string with: len(key) == 1 and key in ALLOWED_KEYS.
 
-A bookmark is an object with: bookmark == bookmarktype(str(instance))
-Which is true for str or FileSystemObject. This condition is required
-so bookmark-objects can be saved to and loaded from a file.
+		A bookmark is an object with: bookmark == bookmarktype(str(instance))
+		Which is true for str or FileSystemObject. This condition is required
+		so bookmark-objects can be saved to and loaded from a file.
 
-Optionally, a bookmark.go() method is used for entering a bookmark.
-"""
+		Optionally, a bookmark.go() method is used for entering a bookmark.
+		"""
 
 	last_mtime = None
 	autosave = True
@@ -24,8 +24,8 @@ Optionally, a bookmark.go() method is used for entering a bookmark.
 
 	def __init__(self, bookmarkfile, bookmarktype=str, autosave=False):
 		"""<bookmarkfile> specifies the path to the file where
-bookmarks are saved in.
-"""
+		bookmarks are saved in.
+		"""
 		self.autosave = autosave
 		self.dct = {}
 		self.path = bookmarkfile
@@ -48,8 +48,8 @@ bookmarks are saved in.
 
 	def enter(self, key):
 		"""Enter the bookmark with the given key.
-Requires the bookmark instance to have a go() method.
-"""
+		Requires the bookmark instance to have a go() method.
+		"""
 
 		try:
 			return self[key].go()
@@ -75,8 +75,9 @@ Requires the bookmark instance to have a go() method.
 
 	def __setitem__(self, key, value):
 		"""Bookmark <value> to the key <key>.
-key is expected to be a 1-character string and element of ALLOWED_KEYS.
-value is expected to be a filesystemobject."""
+		key is expected to be a 1-character string and element of ALLOWED_KEYS.
+		value is expected to be a filesystemobject.
+		"""
 		if key in ALLOWED_KEYS:
 			self.dct[key] = value
 			if self.autosave: self.save()
@@ -87,8 +88,8 @@ value is expected to be a filesystemobject."""
 
 	def update(self):
 		"""Update the bookmarks from the bookmark file.
-Useful if two instances are running which define different bookmarks.
-"""
+		Useful if two instances are running which define different bookmarks.
+		"""
 		
 		try:
 			real_dict = self._load_dict()
@@ -123,7 +124,7 @@ Useful if two instances are running which define different bookmarks.
 
 	def save(self):
 		"""Save the bookmarks to the bookmarkfile.
-This is done automatically after every modification if autosave is True."""
+		This is done automatically after every modification if autosave is True."""
 		import os
 		self.update()
 		if os.access(self.path, os.W_OK):
diff --git a/ranger/container/environment.py b/ranger/container/environment.py
index 11c0082b..40378221 100644
--- a/ranger/container/environment.py
+++ b/ranger/container/environment.py
@@ -32,9 +32,9 @@ class Environment(SettingsAware):
 	
 	def at_level(self, level):
 		"""Returns the FileSystemObject at the given level.
-level 1 => preview
-level 0 => current file/directory
-level <0 => parent directories"""
+		level 1 => preview
+		level 0 => current file/directory
+		level <0 => parent directories"""
 		if level <= 0:
 			try:
 				return self.pathway[level - 1]
diff --git a/ranger/ext/waitpid_no_intr.py b/ranger/ext/waitpid_no_intr.py
index 38df44ee..5ed79e04 100644
--- a/ranger/ext/waitpid_no_intr.py
+++ b/ranger/ext/waitpid_no_intr.py
@@ -1,5 +1,5 @@
 def waitpid_no_intr(pid):
-	""" catch interrupts which occur while using os.waitpid """
+	"""catch interrupts which occur while using os.waitpid"""
 	import os, errno
 
 	while True:
diff --git a/ranger/fm.py b/ranger/fm.py
index b59a3e8d..a93b732a 100644
--- a/ranger/fm.py
+++ b/ranger/fm.py
@@ -46,11 +46,11 @@ class FM(Actions):
 
 	def loop(self):
 		"""The main loop consists of:
-1. reloading bookmarks if outdated
-2. drawing and finalizing ui
-3. reading and handling user input
-4. after X loops: collecting unused directory objects
-"""
+		1. reloading bookmarks if outdated
+		2. drawing and finalizing ui
+		3. reading and handling user input
+		4. after X loops: collecting unused directory objects
+		"""
 
 		self.env.enter_dir(self.env.path)
 
diff --git a/ranger/fsobject/directory.py b/ranger/fsobject/directory.py
index 0ebfff13..08e6ff87 100644
--- a/ranger/fsobject/directory.py
+++ b/ranger/fsobject/directory.py
@@ -45,7 +45,8 @@ class Directory(SuperClass, SettingsAware):
 
 	def load_content(self):
 		"""Loads the contents of the directory. Use this sparingly since
-it takes rather long."""
+		it takes rather long.
+		"""
 		from os.path import join, isdir, basename
 		from os import listdir
 
@@ -130,7 +131,8 @@ it takes rather long."""
 
 	def move_pointer_to_file_path(self, path):
 		"""Move the index pointer to the index of the file object
-with the given path."""
+		with the given path.
+		"""
 		if path is None: return
 		try: path = path.path
 		except AttributeError: pass
@@ -171,7 +173,9 @@ with the given path."""
 		return False
 
 	def correct_pointer(self):
-		"""make sure the pointer is in the valid range of 0 : len(self.files)-1 (or None if directory is empty.)"""
+		"""make sure the pointer is in the valid range of:
+		0:len(self.files)-1 (or None if directory is empty.)
+		"""
 
 		if self.files is None or len(self.files) == 0:
 			self.pointed_index = None
@@ -196,7 +200,8 @@ with the given path."""
 
 	def load_content_if_outdated(self):
 		"""Load the contents of the directory if it's
-outdated or not done yet"""
+		outdated or not done yet
+		"""
 		if self.load_content_once(): return True
 
 		if self.old_show_hidden != self.settings.show_hidden:
diff --git a/ranger/fsobject/fsobject.py b/ranger/fsobject/fsobject.py
index 2f65fbc5..86fa7c32 100644
--- a/ranger/fsobject/fsobject.py
+++ b/ranger/fsobject/fsobject.py
@@ -37,7 +37,7 @@ class FileSystemObject(MimeTypeAware, FileManagerAware):
 	def __init__(self, path):
 		MimeTypeAware.__init__(self)
 		if type(self) == FileSystemObject:
-			raise TypeError("FileSystemObject is an abstract class and cannot be initialized.")
+			raise TypeError("Cannot initialize abstract class FileSystemObject")
 
 		from os.path import basename, dirname
 
@@ -89,8 +89,9 @@ class FileSystemObject(MimeTypeAware, FileManagerAware):
 			self.mimetype = None
 
 	def load(self):
-		"""reads useful information about the filesystem-object from the filesystem
-and caches it for later use"""
+		"""reads useful information about the filesystem-object from the
+		filesystem and caches it for later use
+		"""
 		import os
 		import stat
 		from ranger.ext.human_readable import human_readable
@@ -181,7 +182,9 @@ and caches it for later use"""
 		return False
 
 	def load_if_outdated(self):
-		"""calls load() if the currently cached information is outdated or nonexistant"""
+		"""calls load() if the currently cached information is outdated
+		or nonexistant.
+		"""
 		if self.load_once(): return True
 
 		import os
diff --git a/ranger/gui/colorscheme.py b/ranger/gui/colorscheme.py
index f7a2a2d7..7105adc0 100644
--- a/ranger/gui/colorscheme.py
+++ b/ranger/gui/colorscheme.py
@@ -64,8 +64,9 @@ class ColorScheme(object):
 
 	def use(self, context):
 		"""Use the colorscheme to determine the (fg, bg, attr) tuple.
-This is a dummy function which always returns default_colors.
-Override this in your custom colorscheme!"""
+      This is a dummy function which always returns default_colors.
+      Override this in your custom colorscheme!
+      """
 		from ranger.gui.color import default_colors
 		return default_colors
 
diff --git a/ranger/gui/displayable.py b/ranger/gui/displayable.py
index 495c78c7..9375be11 100644
--- a/ranger/gui/displayable.py
+++ b/ranger/gui/displayable.py
@@ -29,7 +29,8 @@ class Displayable(EnvironmentAware, FileManagerAware, SettingsAware):
 
 	def __contains__(self, item):
 		"""Is item inside the boundaries?
-item can be an iterable like [y, x] or an object with x and y methods."""
+		item can be an iterable like [y, x] or an object with x and y methods.
+		"""
 		try:
 			y, x = item.y, item.x
 		except AttributeError:
@@ -56,12 +57,14 @@ item can be an iterable like [y, x] or an object with x and y methods."""
 
 	def draw(self):
 		"""Draw the object. Called on every main iteration.
-Containers should call draw() on their contained objects here.
-Override this!"""
+		Containers should call draw() on their contained objects here.
+		Override this!
+		"""
 
 	def destroy(self):
 		"""Called when the object is destroyed.
-Override this!"""
+		Override this!
+		"""
 
 	def contains_point(self, y, x):
 		"""Test if the point lies within the boundaries of this object"""
@@ -70,12 +73,14 @@ Override this!"""
 
 	def click(self, event):
 		"""Called when a mouse key is pressed and self.focused is True.
-Override this!"""
+		Override this!
+		"""
 		pass
 
 	def press(self, key):
 		"""Called when a key is pressed and self.focused is True.
-Override this!"""
+		Override this!
+		"""
 		pass
 
 	def poke(self):
@@ -83,13 +88,14 @@ Override this!"""
 	
 	def draw(self):
 		"""Draw displayable.  Called on every main iteration if the object
-is visible.  Override this!
-"""
+		is visible.  Override this!
+		"""
 		pass
 
 	def finalize(self):
 		"""Called after every displayable is done drawing.
-Override this!"""
+		Override this!
+		"""
 		pass
 
 	def resize(self, y, x, hei=None, wid=None):
diff --git a/ranger/gui/ui.py b/ranger/gui/ui.py
index 3840a978..2af12cca 100644
--- a/ranger/gui/ui.py
+++ b/ranger/gui/ui.py
@@ -115,7 +115,8 @@ class UI(DisplayableContainer):
 
 	def setup(self):
 		"""Called after an initialize() call.
-Override this!"""
+		Override this!
+		"""
 
 	def redraw(self):
 		"""Redraw the window. This only calls self.win.redrawwin()."""
@@ -125,8 +126,8 @@ Override this!"""
 
 	def update_size(self):
 		"""Update self.env.termsize.
-Extend this method to resize all widgets!
-"""
+		Extend this method to resize all widgets!
+		"""
 		self.env.termsize = self.win.getmaxyx()
 
 	def draw(self):
diff --git a/ranger/gui/widgets/__init__.py b/ranger/gui/widgets/__init__.py
index 866062b4..41777c1c 100644
--- a/ranger/gui/widgets/__init__.py
+++ b/ranger/gui/widgets/__init__.py
@@ -2,5 +2,5 @@ from ranger.gui.displayable import Displayable
 
 class Widget(Displayable):
 	"""The Widget class defines no methods and only exists for
-classification of widgets.
-"""
+	classification of widgets.
+	"""
diff --git a/ranger/gui/widgets/statusbar.py b/ranger/gui/widgets/statusbar.py
index 41da7b06..79bc0032 100644
--- a/ranger/gui/widgets/statusbar.py
+++ b/ranger/gui/widgets/statusbar.py
@@ -118,9 +118,9 @@ class StatusBar(Widget):
 
 	def _combine_parts(self, left, right):
 		"""Combines left and right, filling the middle with spaces and
-removing elements which don't have enough room to fit in.
-<left> will be turned into the result (which is also returned).
-"""
+		removing elements which don't have enough room to fit in.
+		<left> will be turned into the result (which is also returned).
+		"""
 
 		leftsize = sum(len(part[1]) for part in left)
 		rightsize = sum(len(part[1]) for part in right)