diff options
author | gbrandl <devnull@localhost> | 2007-05-04 08:42:07 +0200 |
---|---|---|
committer | gbrandl <devnull@localhost> | 2007-05-04 08:42:07 +0200 |
commit | 9270113fff36124ff0b5c7b593a3a1c8cb595095 (patch) | |
tree | 822913f753ec66601e7063bafa2b5d1d3562f414 /pygments/filters | |
parent | 61baa23235b73b0272fad58e1c4a75a7320ff908 (diff) | |
download | pygments-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__.py | 6 |
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): |