Salome HOME
fix conflict: ctest requires SUBDIRS, not ADD_SUBDIRECTORY directives
[tools/medcoupling.git] / doc / doxygen / BuildPyExamplesFromCPP.py
index d30bc00a1cf1ebd6d2fc9ab6ec2858f226414f71..0daa9b508e8c86d2d2bf777dd42856ae09bcc086 100644 (file)
@@ -1,10 +1,10 @@
 #!/usr/bin/env python
-# Copyright (C) 2007-2013  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 # 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.
+# 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
@@ -64,6 +64,7 @@ def discardPythonFrom(contents):
     #
 #
 
+# Usage: BuildPyExamplesFromCPP.py <examples.in> <output directory>
 
 fCpp=file(sys.argv[1],"r")
 cppCont=fCpp.readlines() ; del fCpp
@@ -73,7 +74,11 @@ pyCont=Cpp2Python(pyCont)
 
 cppCont=discardPythonFrom(cppCont) # remove Python-only contents from Cpp
 
+# Save CPP and PY examples in two separate dox files
 outFileName=os.path.join(sys.argv[2],os.path.basename(sys.argv[1]))
 
-f=file(os.path.splitext(outFileName)[0]+".dox","w")
-f.writelines(cppCont+pyCont) ; del f
+f=file(os.path.splitext(outFileName)[0]+"CPP.dox","w")
+f.writelines(cppCont) ; del f
+
+f=file(os.path.splitext(outFileName)[0]+"PY.dox","w")
+f.writelines(pyCont) ; del f