Convert docstrings to reStructuredText

This commit also includes:

  - whitespace / code formatting fixes
  - slight syntax related changes: except <exception_name>, e -> except <exception_name> as e
  - 3 pointless instructions instances have been rewritten [sorted] (spotted by semi-automatic check)

The unrelated changes shouldn't have any real impact on whipper's behaviour.
This commit is contained in:
JoeLametta
2018-01-06 08:00:00 +00:00
parent 74e3f7b77d
commit 3b1bd242d0
32 changed files with 1069 additions and 722 deletions

View File

@@ -22,17 +22,19 @@ import re
class PathFilter(object):
"""
I filter path components for safe storage on file systems.
"""I filter path components for safe storage on file systems.
:ivar slashes: whether to convert slashes to dashes.
:vartype slashes:
:ivar quotes: whether to normalize quotes.
:vartype quotes:
:ivar fat: whether to strip characters illegal on FAT filesystems.
:vartype fat:
:ivar special: whether to strip special characters.
:vartype special:
"""
def __init__(self, slashes=True, quotes=True, fat=True, special=False):
"""
@param slashes: whether to convert slashes to dashes
@param quotes: whether to normalize quotes
@param fat: whether to strip characters illegal on FAT filesystems
@param special: whether to strip special characters
"""
self._slashes = slashes
self._quotes = quotes
self._fat = fat