diff options
author | strank <strank@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> | 2008-07-23 19:18:19 +0000 |
---|---|---|
committer | strank <strank@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> | 2008-07-23 19:18:19 +0000 |
commit | 909813ea5e93a2ce8809737f60791560b33c1e85 (patch) | |
tree | 8d6fc47c20f6d73499d1b8f1d0d7e4fd2deefdfc /parsers/rst/roles.py | |
parent | 537774fff163c1bbb528f4ac3c92ce42feacb33d (diff) | |
download | docutils-abolish-userstring.tar.gz |
Replace all has_key with the in operator.abolish-userstring
git-svn-id: http://svn.code.sf.net/p/docutils/code/branches/abolish-userstring@5607 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
Diffstat (limited to 'parsers/rst/roles.py')
-rw-r--r-- | parsers/rst/roles.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/parsers/rst/roles.py b/parsers/rst/roles.py index 1da1395e9..062d53e50 100644 --- a/parsers/rst/roles.py +++ b/parsers/rst/roles.py @@ -101,7 +101,7 @@ def role(role_name, language_module, lineno, reporter): messages = [] msg_text = [] - if _roles.has_key(normname): + if normname in _roles: return _roles[normname], messages if role_name: @@ -135,7 +135,7 @@ def role(role_name, language_module, lineno, reporter): messages.append(message) # Look the role up in the registry, and return it. - if _role_registry.has_key(canonicalname): + if canonicalname in _role_registry: role_fn = _role_registry[canonicalname] register_local_role(normname, role_fn) return role_fn, messages @@ -171,7 +171,7 @@ def set_implicit_options(role_fn): """ if not hasattr(role_fn, 'options') or role_fn.options is None: role_fn.options = {'class': directives.class_option} - elif not role_fn.options.has_key('class'): + elif 'class' not in role_fn.options: role_fn.options['class'] = directives.class_option def register_generic_role(canonical_name, node_class): @@ -294,7 +294,7 @@ def rfc_reference_role(role, rawtext, text, lineno, inliner, register_canonical_role('rfc-reference', rfc_reference_role) def raw_role(role, rawtext, text, lineno, inliner, options={}, content=[]): - if not options.has_key('format'): + if 'format' not in options: msg = inliner.reporter.error( 'No format (Writer name) is associated with this role: "%s".\n' 'The "raw" role cannot be used directly.\n' @@ -340,7 +340,7 @@ def set_classes(options): Auxiliary function to set options['classes'] and delete options['class']. """ - if options.has_key('class'): - assert not options.has_key('classes') + if 'class' in options: + assert 'classes' not in options options['classes'] = options['class'] del options['class'] |