self.file_format = file_format
self.default = default
self.code = code
+ self.ssCode = ss_code
if user_name is None:
self.user_name = identifier
else:
def create_from_tuple(cata_tuple):
#print "Warning: Describing a catalog with a tuple is deprecated. " \
# "Please create a CatalogDescription instance directly."
- desc = CatalogDescription(code = cata_tuple[0],
- identifier = cata_tuple[1],
- cata_file_path = cata_tuple[2],
- file_format = cata_tuple[3])
-
- if len(cata_tuple) == 5:
- if cata_tuple[4] == "defaut":
- desc.default = True
- else:
- desc.file_format_in = cata_tuple[4]
+ if cata_tuple[0] == 'TELEMAC':
+ desc = CatalogDescription(code = cata_tuple[0],
+ ss_code = cata_tuple[1],
+ identifier = cata_tuple[0]+cata_tuple[1],
+ cata_file_path = cata_tuple[2],
+ file_format = cata_tuple[3],
+ file_format_in = cata_tuple[4])
+ else:
+ desc = CatalogDescription(code = cata_tuple[0],
+ identifier = cata_tuple[1],
+ cata_file_path = cata_tuple[2],
+ file_format = cata_tuple[3])
+
+ if len(cata_tuple) == 5:
+ if cata_tuple[4] == "defaut":
+ desc.default = True
+ else:
+ desc.file_format_in = cata_tuple[4]
return desc
if self.ssCode is None: liste_cata_possibles = all_cata_list
else:
for catalogue in all_cata_list:
- if catalogue.code == self.code and catalogue.file_format == self.ssCode: liste_cata_possibles.append(catalogue)
+ if catalogue.code == self.code and catalogue.ssCode == self.ssCode:
+ liste_cata_possibles.append(catalogue)
if len(liste_cata_possibles)==0:
- QMessageBox.critical(self.QWParent, tr("Import du catalogue"),
- tr("Pas de catalogue defini pour le code ") + self.code)
- self.appliEficas.close()
+ print("Pas de catalogue defini pour le code " + self.code)
+ #QMessageBox.critical(self.QWParent, tr("Import du catalogue"),
+ # tr("Pas de catalogue defini pour le code ") + self.code)
+ #self.appliEficas.close()
if self.appliEficas.salome == 0 : sys.exit(1)
return
else : cata_choice_list.append(cata)
if len(cata_choice_list) == 0:
- QMessageBox.critical(self.QWParent, tr("Import du catalogue"),
- tr("Aucun catalogue trouve"))
- self.appliEficas.close()
+ print("Aucun catalogue trouve")
+ #QMessageBox.critical(self.QWParent, tr("Import du catalogue"),
+ # tr("Aucun catalogue trouve"))
+ #self.appliEficas.close()
if self.appliEficas.salome == 0 : sys.exit(1)
elif len(cata_choice_list) == 1:
print(("Pas de catalogue pour code %s, version %s" %(self.code,self.versionCode)))
sys.exit(1)
else :
- self.appliEficas.close()
+ #self.appliEficas.close()
return
self.cata = self.importCata(self.fic_cata)
self.cata.modeleMetier = modeleMetier
if not self.cata :
- QMessageBox.critical( self.QWParent, tr("Import du catalogue"),tr("Impossible d'importer le catalogue ")+ self.fic_cata)
+ print("Impossible d'importer le catalogue "+ self.fic_cata)
+ #QMessageBox.critical( self.QWParent, tr("Import du catalogue"),tr("Impossible d'importer le catalogue ")+ self.fic_cata)
self.appliEficas.close()
if self.appliEficas.salome == 0 :
sys.exit(1)