#!/usr/bin/env python
+# -*- coding: iso-8859-1 -*-
+# Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
import getopt
import glob
s = 'static '
if params[0] == 'cls':
param = string.join(params[1:], ",")
- s = s+name+"("+param+");\n"
+ s = s+name+"("+param+");\n"
if len(name) > 1 \
and name[0:2] == '__' \
and name[len(name)-2:len(name)] != '__' \
private_member = True
output(" private:\n",(def_spos[0]+2,def_spos[1]))
else:
- s = name+"("+param+");\n"
+ s = name+"("+param+");\n"
if (doc_string!=""): comment_block.append(doc_string)
print_comment(def_spos)
output(s,def_spos)
root,ext = os.path.splitext(filename)
if ext==".py":
- filter(filename)
+ list(filter(filename))
else:
dump(filename)
sys.stderr.write("OK\n")
- except IOError,e:
+ except IOError as e:
sys.stderr.write(e[1]+"\n")
namespace=namespace+"::"+os.path.split(srcpath)[1]
else:
namespace=os.path.split(srcpath)[1]
- print "It's a package:",namespace
+ print("It's a package:",namespace)
sp = os.path.join(srcpath,"*")
sfiles = glob.glob(sp)
dp = os.path.join(destpath,"*")
destfile = os.path.join(destpath,basename)
if destfile==srcfile:
- print "WARNING: Input and output names are identical!"
+ print("WARNING: Input and output names are identical!")
sys.exit(1)
count+=1
try:
shutil.rmtree(dname)
except:
- print "Can't remove obsolete directory '%s'"%dname
+ print("Can't remove obsolete directory '%s'"%dname)
else:
try:
os.remove(dname)
except:
- print "Can't remove obsolete file '%s'"%dname
+ print("Can't remove obsolete file '%s'"%dname)
return count
try:
opts, args = getopt.getopt(sys.argv[1:], "hf", ["help"])
-except getopt.GetoptError,e:
- print e
+except getopt.GetoptError as e:
+ print(e)
sys.exit(1)
for o,a in opts:
sys.exit(1)
# Filter an entire Python source tree
- print '"%s" -> "%s"\n'%(args[0],args[1])
+ print('"%s" -> "%s"\n'%(args[0],args[1]))
c=convert(args[0],args[1])
- print "%d files"%(c)
+ print("%d files"%(c))