diff options
author | Patrick Totzke <patricktotzke@gmail.com> | 2013-07-01 10:51:04 -0500 |
---|---|---|
committer | Patrick Totzke <patricktotzke@gmail.com> | 2013-07-07 18:14:28 +0100 |
commit | d6806671c1ae96227acfb8504e98cf2278da5f90 (patch) | |
tree | f453d5cc8146852e7a1a9194f9ad60eadf644498 /alot/commands/__init__.py | |
parent | 949c5b17b48ed8e45d315ba9c55d3ace1b511cb3 (diff) |
pep8&pyflakes fixes
mostly automatically fixed
Diffstat (limited to 'alot/commands/__init__.py')
-rw-r--r-- | alot/commands/__init__.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/alot/commands/__init__.py b/alot/commands/__init__.py index 8af721ae..cadb6426 100644 --- a/alot/commands/__init__.py +++ b/alot/commands/__init__.py @@ -13,6 +13,7 @@ from alot.helper import split_commandstring class Command(object): + """base class for commands""" repeatable = False @@ -70,11 +71,13 @@ def lookup_parser(cmdname, mode): class CommandParseError(Exception): + """could not parse commandline string""" pass class CommandArgumentParser(argparse.ArgumentParser): + """ :class:`~argparse.ArgumentParser` that raises :class:`CommandParseError` instead of printing to `sys.stderr`""" @@ -86,6 +89,7 @@ class CommandArgumentParser(argparse.ArgumentParser): class registerCommand(object): + """ Decorator used to register a :class:`Command` as handler for command `name` in `mode` so that it @@ -166,7 +170,7 @@ def commandfactory(cmdline, mode='global'): cmdline = re.sub(r'"(.*)"', r'"\\"\1\\""', cmdline) try: args = split_commandstring(cmdline) - except ValueError, e: + except ValueError as e: raise CommandParseError(e.message) args = map(lambda x: alot.helper.string_decode(x, 'utf-8'), args) logging.debug('ARGS: %s' % args) |