summary refs log tree commit diff stats
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
parent2b8338c11bd7b8d327321e21a6f1fc9d231d512e (diff)
downloadranger-b4b0eb249fbc2fa76e36eca898123509dd20d818.tar.gz
re-indented docstrings
-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)
ger' to 'number'' href='/akkartik/mu/commit/Readme.md?h=hlt&id=5497090aa1e708c22cd240913a53dda32bb067aa'>5497090a ^
8f9ec2fb ^



9f8ca43e ^
5497090a ^
8f9ec2fb ^

f00fc595 ^
8f9ec2fb ^



ad07fc7f ^


8f9ec2fb ^
9f8ca43e ^
d855af1f ^
8f9ec2fb ^





b96af395 ^
8f9ec2fb ^











9f8ca43e ^
b96af395 ^
8f9ec2fb ^


b96af395 ^
8f9ec2fb ^
9f8ca43e ^
5497090a ^
8f9ec2fb ^

b96af395 ^
8f9ec2fb ^





f00fc595 ^
8f9ec2fb ^


b96af395 ^
8f9ec2fb ^
d4b4d018 ^
9f8ca43e ^
5497090a ^
d4b4d018 ^
5497090a ^
d4b4d018 ^

f00fc595 ^
8f9ec2fb ^


d4b4d018 ^



8b9f1750 ^
b96af395 ^

a3c025c5 ^







14b33e59 ^

2c9aa92f ^
8f9ec2fb ^
797a46d5 ^

9f8ca43e ^
b96af395 ^
d855af1f ^
5497090a ^
797a46d5 ^
d4e8d4a8 ^
797a46d5 ^
d4e8d4a8 ^
797a46d5 ^

d4e8d4a8 ^
b96af395 ^
8d4c2a09 ^

bc643692 ^
797a46d5 ^

d4e8d4a8 ^
b96af395 ^
8d4c2a09 ^



797a46d5 ^




d2244a2f ^



f00fc595 ^
12816015 ^

f00fc595 ^
12816015 ^

797a46d5 ^

002cbf13 ^

4e6778d7 ^



bc643692 ^
4e6778d7 ^





bc643692 ^
4e6778d7 ^




7efed68b ^
4f9f75dd ^
bc40cc49 ^
002cbf13 ^



711dd36f ^
f192d655 ^
7efed68b ^
4f9f75dd ^
f192d655 ^












bc40cc49 ^
f192d655 ^
f00fc595 ^
f192d655 ^




f00fc595 ^
f192d655 ^





9846759e ^













2c9aa92f ^
7efed68b ^
b96af395 ^
bc40cc49 ^
14b33e59 ^
797a46d5 ^
f00fc595 ^
14b33e59 ^



f00fc595 ^
14b33e59 ^




383d5bea ^

















6bf34cf3 ^
14b33e59 ^


7efed68b ^
14b33e59 ^

7efed68b ^

14b33e59 ^




7efed68b ^
14b33e59 ^
7efed68b ^
14b33e59 ^

7efed68b ^
95fe5a4a ^

14b33e59 ^



7efed68b ^
14b33e59 ^
7efed68b ^

14b33e59 ^



1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427