From a78d75f290278501b5d8130dc58420952a13e1a1 Mon Sep 17 00:00:00 2001 From: Dean Troyer Date: Thu, 26 Jun 2014 17:06:38 -0500 Subject: Fix PEP8 H405 errors Change-Id: Id9ea03e7d88148f84bffe1b18b5b4315e6123012 --- openstackclient/common/parseractions.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'openstackclient/common/parseractions.py') diff --git a/openstackclient/common/parseractions.py b/openstackclient/common/parseractions.py index 644472d8..8f6008e2 100644 --- a/openstackclient/common/parseractions.py +++ b/openstackclient/common/parseractions.py @@ -19,9 +19,11 @@ import argparse class KeyValueAction(argparse.Action): - """A custom action to parse arguments as key=value pairs. - Ensures that dest is a dict + """A custom action to parse arguments as key=value pairs + + Ensures that ``dest`` is a dict """ + def __call__(self, parser, namespace, values, option_string=None): # Make sure we have an empty dict rather than None if getattr(namespace, self.dest, None) is None: @@ -35,7 +37,14 @@ class KeyValueAction(argparse.Action): class RangeAction(argparse.Action): - """A custom action to parse a single value or a range of values.""" + """A custom action to parse a single value or a range of values + + Parses single integer values or a range of integer values delimited + by a colon and returns a tuple of integers: + '4' sets ``dest`` to (4, 4) + '6:9' sets ``dest`` to (6, 9) + """ + def __call__(self, parser, namespace, values, option_string=None): range = values.split(':') if len(range) == 0: -- cgit v1.2.1