Add missing docstrings.

This commit is contained in:
Bastian Kleineidam 2013-12-24 07:15:31 +01:00
parent e0a2558b2b
commit f3b435c2a6
3 changed files with 5 additions and 0 deletions

View file

@ -25,6 +25,7 @@ from .director import console
class LCArgumentParser(argparse.ArgumentParser):
"""Custom argument parser to format help text."""
def print_help(self, file=None):
"""Print a help message to stdout."""

View file

@ -127,6 +127,7 @@ _OctalPatt = re.compile(r"\\[0-3][0-7][0-7]")
_QuotePatt = re.compile(r"[\\].")
def unquote(str):
"""Remove string quoting."""
# If there aren't any doublequotes,
# then there can't be any special characters. See RFC 2109.
if len(str) < 2:

View file

@ -55,7 +55,10 @@ Epilog = u"\n".join((Retval, Examples))
# instantiate option parser and configure options
class ArgumentParser(LCArgumentParser):
"""Custom argument parser for error reporting."""
def error(self, message):
"""Print error and exit with error code 3."""
self.print_usage(sys.stderr)
self.exit(3, _('%s: error: %s\n') % (self.prog, message))