From 9267acec8aac2bdc5ab600f1a23ca59de53cdb84 Mon Sep 17 00:00:00 2001 From: Pascale Noyret Date: Fri, 18 Jun 2010 15:15:56 +0000 Subject: [PATCH] pour map --- generator/generator_s_poly_st_1.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/generator/generator_s_poly_st_1.py b/generator/generator_s_poly_st_1.py index 158c829c..683b1a1a 100644 --- a/generator/generator_s_poly_st_1.py +++ b/generator/generator_s_poly_st_1.py @@ -84,12 +84,16 @@ class s_poly_st_1Generator(MapGenerator): """ def verifie(self): - if len(self.listeCODE) != len(set(self.listeCODE)): + liste=[] + for i in self.listeCODE: + liste.append(i.keys()[0]) + if len(liste) != len(set(liste)): raise AsException("il n'est pas prevu d avoir deux fois le meme code dans ce schema") def PYGMEE(self,execution) : dicoPygmee=self.dictMCVal["PYGMEE"] + self.dictPYGMEE=dicoPygmee monFichier=self.config.PATH_PYGMEE+"/pygmee_input.txt" #Lecture du fichier a trous @@ -121,8 +125,8 @@ class s_poly_st_1Generator(MapGenerator): def BENHUR(self,execution) : dicoBenhur=self.dictMCVal["BENHUR"] - if ("PYGMEE" in self.dictMCVal.keys()) and '_PYGMEE_TAILLE' in self.dictMCVal['PYGMEE']: - dicoBenhur["_PYGMEE_TAILLE"]=self.dictMCVal["PYGMEE"]['_PYGMEE_TAILLE'] + if hasattr(self,'dictPYGMEE') and '_PYGMEE_TAILLE' in self.dictMCVal['PYGMEE']: + dicoBenhur["_PYGMEE_TAILLE"]=self.dictPYGMEE['_PYGMEE_TAILLE'] else : dicoBenhur["_PYGMEE_TAILLE"]=0 print "Attention la variable Taille_VER non definie" @@ -172,10 +176,9 @@ class s_poly_st_1Generator(MapGenerator): print "dans PYGMEEYACS" return "" - def ASTER(self) : + def ASTER(self,execution) : print "Generation de ASTER" dicoAster=self.dictMCVal["ASTER"] - dicoPygmee=self.dictMCVal["PYGMEE"] nom_racine=self.config.PATH_MODULE+"/"+self.config.NAME_SCHEME+"/"+self.config.NAME_SCHEME nom_fichier_ASTER=nom_racine+"_aster.comm" @@ -183,7 +186,7 @@ class s_poly_st_1Generator(MapGenerator): f = file(self.config.repIni+"/s_poly_st_1_aster_template.comm","r") chaine = f.read() f.close() - chaine2=self.remplaceDICO(chaine,dicoPygmee) + chaine2=self.remplaceDICO(chaine,self.dictPYGMEE) chaine=self.remplaceDICO(chaine2,dicoAster) f=open(nom_fichier_ASTER,'wb') @@ -198,7 +201,7 @@ class s_poly_st_1Generator(MapGenerator): else: return "" - def GMSH(self) : + def GMSH(self,execution) : dicoGmsh=self.dictMCVal["GMSH"] if ('_GMSH_LANCEMENT' in dicoGmsh.keys()) and dicoGmsh['_GMSH_LANCEMENT'] == 'oui': commande="cd "+self.config.PATH_MODULE+";" -- 2.39.2