From 74bea5a5e2472d462fb3d46ad191650ad15782a3 Mon Sep 17 00:00:00 2001 From: Michel Zou Date: Tue, 15 Jan 2013 16:13:42 +0100 Subject: [PATCH] Fixed python3 bindings generation. --- bindings/doxy2swig.py | 9 ++++----- 1 files changed, 4 insertions(+), 5 deletions(-) diff --git a/bindings/doxy2swig.py b/bindings/doxy2swig.py index c6c972c..cf4c52b 100644 --- a/bindings/doxy2swig.py +++ b/bindings/doxy2swig.py @@ -33,7 +33,6 @@ from xml.dom import minidom import re import textwrap import sys -import types import os.path import optparse @@ -150,7 +149,7 @@ class Doxy2SWIG: def add_text(self, value): """Adds text corresponding to `value` into `self.pieces`.""" - if type(value) in (types.ListType, types.TupleType): + if isinstance(value, (list, tuple)): self.pieces.extend(value) else: self.pieces.append(value) @@ -210,7 +209,7 @@ class Doxy2SWIG: kind = node.attributes['kind'].value if kind in ('class', 'struct'): prot = node.attributes['prot'].value - if prot <> 'public': + if prot != 'public': return names = ('compoundname', 'briefdescription', 'detaileddescription', 'includes') @@ -281,7 +280,7 @@ class Doxy2SWIG: if name[:8] == 'operator': # Don't handle operators yet. return - if not first.has_key('definition') or \ + if not 'definition' in first or \ kind in ['variable', 'typedef']: return @@ -373,7 +372,7 @@ class Doxy2SWIG: if not os.path.exists(fname): fname = os.path.join(self.my_dir, fname) if not self.quiet: - print "parsing file: %s"%fname + print( "parsing file: %s"%fname ) p = Doxy2SWIG(fname, self.include_function_definition, self.quiet) p.generate() self.pieces.extend(self.clean_pieces(p.pieces)) -- 1.7.1