]> SALOME platform Git repositories - tools/medcoupling.git/blob - v8_work/ModifyNamespace.py
Salome HOME
Useful valgrind suppr file for SWIG ...
[tools/medcoupling.git] / v8_work / ModifyNamespace.py
1 import os
2 rep=("namespace ParaMEDMEM","namespace MEDCoupling")
3 rep=("ParaMEDMEM::","MEDCoupling::")
4 #rep=("ParaMEDMEMImpl::","MEDCouplingImpl::")
5
6 #rep=("_ParaMEDMEM__","_MEDCoupling__")
7 #rep=("ParaMEDMEM_","MEDCoupling_")
8 #rep=("ParaMEDMEMData","MEDCouplingData")
9
10 #rep=("ParaMEDMEM_1","MEDCoupling_1")
11
12 def rep0(fi,rep):
13     f=file(fi) ; lines=f.readlines() ; del f
14     lines2=[line.replace(*rep) for line in lines]
15     if lines2!=lines:
16         f=file(fi,"w") ; f.writelines(lines2) ; f.flush()
17         return 1
18     else:
19         return 0
20
21 def rep1(dirname,rep):
22     i=0
23     for fi in os.listdir(dirname):
24         fi2=os.path.join(dirname,fi)
25         if not os.path.isfile(fi2):
26             continue
27         i+=rep0(fi2,rep)
28     return i
29
30 dirs=["MEDCoupling","MEDCoupling/Test","MEDLoader","MEDLoader/Swig","MEDLoader/Test","MEDPartitioner","MEDPartitioner/Test","MEDPartitioner_Swig","RENUMBER","RENUMBER_Swig","INTERP_KERNELTest","ParaMEDMEM","ParaMEDLoader","ParaMEDMEMTest","ParaMEDMEM_Swig","doc/user/doxygen/fakesources","doc/user/doxygen/doxy2swig","doc/user/doxygen/doxfiles","/home/H87074/salome/DEV/modules/src/MED/src/MEDCouplingCorba","/home/H87074/salome/DEV/modules/src/MED/src/MEDCouplingCorba/Client","/home/H87074/salome/DEV/modules/src/MED/src/MEDCouplingCorba/Test","/home/H87074/salome/DEV/modules/src/MED/src/MEDCalc/cmp","/home/H87074/salome/DEV/modules/src/MED/src/MEDCalculator","/home/H87074/salome/DEV/modules/src/MED/src/MEDCalculator/Swig","/home/H87074/salome/DEV/modules/src/MED/src/MEDCalculator/Test","/home/H87074/salome/DEV/modules/src/PARAVIS/src/Plugins/MEDReader/IO"]
31 dirname=dirs[-1]
32 i=0
33 print(rep1(dirname,rep))
34 """for r,dirs,fis in os.walk(dirname):
35     for fi in fis:
36         if os.path.splitext(fi)[1] not in [".dox",".doxy"]:
37             continue
38         i+=rep0(os.path.join(r,fi),rep)
39
40 print i"""