From: Richard Heck Date: Mon, 14 Feb 2011 02:28:13 +0000 (+0000) Subject: Simple fixes to get layout2layout working with Python 3. These are all that the 2to3... X-Git-Tag: 2.0.0~751 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=e6ec7bdce547f55f8eb6df72155bceecd93d6b2a;p=features.git Simple fixes to get layout2layout working with Python 3. These are all that the 2to3 script reported. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37646 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/lib/scripts/layout2layout.py b/lib/scripts/layout2layout.py index a36438eb95..857776b321 100644 --- a/lib/scripts/layout2layout.py +++ b/lib/scripts/layout2layout.py @@ -666,7 +666,7 @@ def convert(lines): # This emulates the hardcoded article style numbering of 1.3 # if counter != "": - if counters.has_key(style): + if style in counters: if labelstring_line < 0: lines.insert(i, '%sLabelString "%s"' % (space1, counters[style])) i += 1 @@ -675,7 +675,7 @@ def convert(lines): lines[labelstring_line] = re_LabelString.sub( r'\1\2\3%s' % new_labelstring.replace("\\", "\\\\"), lines[labelstring_line]) - if appendixcounters.has_key(style): + if style in appendixcounters: if labelstringappendix_line < 0: lines.insert(i, '%sLabelStringAppendix "%s"' % (space1, appendixcounters[style])) i += 1 @@ -690,7 +690,7 @@ def convert(lines): i += 1 # Add the TocLevel setting for sectioning styles - if toclevel == "" and toclevels.has_key(style) and maxcounter <= toclevels[style]: + if toclevel == "" and style in toclevels and maxcounter <= toclevels[style]: lines.insert(i, '%s\tTocLevel %d' % (space1, toclevels[style])) i += 1