From ba4ec39ada0b760703d01695a2bc55690c0e3e82 Mon Sep 17 00:00:00 2001 From: Patrick Totzke Date: Thu, 14 Jun 2012 22:17:12 +0100 Subject: cleanup docstring for BooleanAction --- alot/utils/booleanaction.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'alot/utils') diff --git a/alot/utils/booleanaction.py b/alot/utils/booleanaction.py index 9a8e8792..7bc81bb7 100644 --- a/alot/utils/booleanaction.py +++ b/alot/utils/booleanaction.py @@ -1,13 +1,6 @@ # Copyright (C) 2011-2012 Patrick Totzke # This file is released under the GNU GPL, version 3 or a later revision. # For further details see the COPYING file -""" -This defines the ConfigureAction for argparse found here: -http://code.google.com/p/argparse/issues/detail?id=2#c6 - -We use it to set booelan arguments for command parameters -to False using a `--no-` prefix. -""" import argparse import re @@ -15,6 +8,7 @@ import re TRUEISH = ['1', 't', 'true', 'yes', 'on'] FALSISH = ['0', 'f', 'false', 'no', 'off'] + def boolean(string): string = string.lower() if string in FALSISH: @@ -26,6 +20,9 @@ def boolean(string): class BooleanAction(argparse.Action): + """ + argparse action that can be used to store boolean values + """ def __init__(self, *args, **kwargs): kwargs['type'] = boolean kwargs['choices'] = TRUEISH + FALSISH -- cgit v1.2.3