summaryrefslogtreecommitdiff
path: root/alot/utils
diff options
context:
space:
mode:
authorPatrick Totzke <patricktotzke@gmail.com>2012-06-14 22:17:12 +0100
committerPatrick Totzke <patricktotzke@gmail.com>2012-06-14 22:17:12 +0100
commitba4ec39ada0b760703d01695a2bc55690c0e3e82 (patch)
treea995e49a4cfd9abb1da4385da9acc98bd474a5b3 /alot/utils
parent50d407dfd0ceb5f889c232c89b48965a6f229bc4 (diff)
cleanup docstring for BooleanAction
Diffstat (limited to 'alot/utils')
-rw-r--r--alot/utils/booleanaction.py11
1 files changed, 4 insertions, 7 deletions
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 <patricktotzke@gmail.com>
# 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