summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgrubert <grubert@929543f6-e4f2-0310-98a6-ba3bd3dd1d04>2008-07-17 08:02:05 +0000
committergrubert <grubert@929543f6-e4f2-0310-98a6-ba3bd3dd1d04>2008-07-17 08:02:05 +0000
commit686d6be6c14328e41761f3511f6d71170b297c4d (patch)
tree008a633e961a0889790531cc627cbc062af8bf52
parent4c19396aab9c774c0cccffbb83fc50f65977d02a (diff)
downloaddocutils-686d6be6c14328e41761f3511f6d71170b297c4d.tar.gz
Change: has_key for dictionaries (not Nodes) to in-operator.abolish-userstring@5603
git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk/docutils/docutils@5602 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
-rw-r--r--writers/latex2e/__init__.py20
1 files changed, 10 insertions, 10 deletions
diff --git a/writers/latex2e/__init__.py b/writers/latex2e/__init__.py
index 3021f1645..a4245a173 100644
--- a/writers/latex2e/__init__.py
+++ b/writers/latex2e/__init__.py
@@ -296,13 +296,13 @@ class Babel:
return text.replace('"', self.double_quote_replacment)
def get_language(self):
- if self._ISO639_TO_BABEL.has_key(self.language):
+ if self.language in self._ISO639_TO_BABEL:
return self._ISO639_TO_BABEL[self.language]
else:
# support dialects.
- l = self.language.split("_")[0]
- if self._ISO639_TO_BABEL.has_key(l):
- return self._ISO639_TO_BABEL[l]
+ lang = self.language.split("_")[0]
+ if lang in self._ISO639_TO_BABEL:
+ return self._ISO639_TO_BABEL[lang]
return None
@@ -428,7 +428,7 @@ class Table:
def set(self,attr,value):
self._attrs[attr] = value
def get(self,attr):
- if self._attrs.has_key(attr):
+ if attr in self._attrs:
return self._attrs[attr]
return None
def get_vertical_bar(self):
@@ -831,7 +831,7 @@ class LaTeXTranslator(nodes.NodeVisitor):
#"iso-8859-8": "" # hebrew
#"iso-8859-10": "" # latin6, more complete iso-8859-4
}
- if tr.has_key(docutils_encoding.lower()):
+ if docutils_encoding.lower() in tr:
return tr[docutils_encoding.lower()]
# convert: latin-1 and utf-8 and similar things
return docutils_encoding.replace("_", "").replace("-", "").lower()
@@ -867,7 +867,7 @@ class LaTeXTranslator(nodes.NodeVisitor):
return text
def ensure_math(self, text):
- if not self.__dict__.has_key('ensure_math_re'):
+ if not 'ensure_math_re' in self.__dict__:
chars = {
# lnot,pm,twosuperior,threesuperior,mu,onesuperior,times,div
'latin1' : '\xac\xb1\xb2\xb3\xb5\xb9\xd7\xf7' ,
@@ -891,10 +891,10 @@ class LaTeXTranslator(nodes.NodeVisitor):
# compile the regexps once. do it here so one can see them.
#
# first the braces.
- if not self.__dict__.has_key('encode_re_braces'):
+ if not 'encode_re_braces' in self.__dict__:
self.encode_re_braces = re.compile(r'([{}])')
text = self.encode_re_braces.sub(r'{\\\1}',text)
- if not self.__dict__.has_key('encode_re_bslash'):
+ if not 'encode_re_bslash' in self.__dict__:
# find backslash: except in the form '{\{}' or '{\}}'.
self.encode_re_bslash = re.compile(r'(?<!{)(\\)(?![{}]})')
# then the backslash: except in the form from line above:
@@ -1418,7 +1418,7 @@ class LaTeXTranslator(nodes.NodeVisitor):
enum_type = "arabic"
if node.has_key('enumtype'):
enum_type = node['enumtype']
- if enum_style.has_key(enum_type):
+ if enum_type in enum_style:
enum_type = enum_style[enum_type]
counter_name = "listcnt%d" % len(self._enumeration_counters)