summaryrefslogtreecommitdiff
path: root/pygments/filters
diff options
context:
space:
mode:
authorgbrandl <devnull@localhost>2007-05-04 08:42:07 +0200
committergbrandl <devnull@localhost>2007-05-04 08:42:07 +0200
commit9270113fff36124ff0b5c7b593a3a1c8cb595095 (patch)
tree822913f753ec66601e7063bafa2b5d1d3562f414 /pygments/filters
parent61baa23235b73b0272fad58e1c4a75a7320ff908 (diff)
downloadpygments-9270113fff36124ff0b5c7b593a3a1c8cb595095.tar.gz
[svn] Fix a few inconsistencies and nits, mainly in the docs.
Use the get_choice_opt function consistently.
Diffstat (limited to 'pygments/filters')
-rw-r--r--pygments/filters/__init__.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/pygments/filters/__init__.py b/pygments/filters/__init__.py
index 3268f660..416e85dd 100644
--- a/pygments/filters/__init__.py
+++ b/pygments/filters/__init__.py
@@ -18,7 +18,7 @@ import re
from pygments.token import String, Comment, Keyword, Name, Error, Whitespace, \
string_to_tokentype
from pygments.filter import Filter
-from pygments.util import get_list_opt, get_int_opt, get_bool_opt, \
+from pygments.util import get_list_opt, get_int_opt, get_bool_opt, get_choice_opt, \
ClassNotFound, OptionError
from pygments.plugin import find_plugin_filters
@@ -119,9 +119,7 @@ class KeywordCaseFilter(Filter):
def __init__(self, **options):
Filter.__init__(self, **options)
- case = options.get('case', 'lower')
- if case not in ('lower', 'upper', 'capitalize'):
- raise OptionError('unknown conversion method %r' % case)
+ case = get_choice_opt(options, 'case', ['lower', 'upper', 'capitalize'], 'lower')
self.convert = getattr(unicode, case)
def filter(self, lexer, stream):