import logging
import sys
from parseur import FactNode
+import regles
#debug=1
debug=0
jdc.reset(jdc.getSource())
-#----------------------------------------
-def renameCommande(jdc,command,new_name):
-#----------------------------------------
+#-----------------------------------------------------------------
+def renameCommande(jdc,command,new_name,ensemble=regles.SansRegle):
+#-----------------------------------------------------------------
# nom de la commande "ancien format" , nom de la commande " nouveau format "
for c in jdc.root.childNodes:
if c.name != command:continue
+ if ensemble.verif(c) == 0 : continue
if debug:print "Renommage de:",c.name,new_name ,c.lineno,c.colno
logging.info("Renommage de: %s, %s, %s, %s en %s",c.name,"",c.lineno,c.colno,new_name)
s=jdc.getLines()[c.lineno-1]
jdc.reset(jdc.getSource())
+#-----------------------------------------------------------
+def renameCommandeSiRegle(jdc,command,new_name,liste_regles):
+#-----------------------------------------------------------
+
+ mesRegles=regles.ensembleRegles(liste_regles)
+ renameCommande(jdc,command,new_name,mesRegles)
+