#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
""" Convert files to the file format generated by lyx 1.2"""
j = find_token(lines, "\\end_float", i+1)
floattype = lines[i].split()[1]
- if not floats.has_key(floattype):
+ if floattype not in floats:
document.warning("Error! Unknown float type " + floattype)
floattype = "fig"
def is_empty(lines):
" Are all the lines empty?"
- return filter(is_nonempty_line, lines) == []
+ return list(filter(is_nonempty_line, lines)) == []
move_rexp = re.compile(r"\\(family|series|shape|size|emph|numeric|bar|noun|end_deeper)")
tmp.append(line)
if is_empty(tmp):
- if filter(lambda x:x != "", tmp) != []:
+ if [x for x in tmp if x != ""] != []:
if new == []:
# This is not necessary, but we want the output to be
# as similar as posible to the lyx format