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 = CatalogDescription(code = cata_tuple[0],
- identifier = cata_tuple[1],
- cata_file_path = cata_tuple[2],
- file_format = cata_tuple[3],
- file_format_in = cata_tuple[4])
+ if len(cata_tuple) == 5:
+ if cata_tuple[4] == "defaut":
+ desc.default = True
+ else:
+ desc.file_format_in = cata_tuple[4]
return desc
self.jdc = self.readFile(self.fichier)
else :
self.jdc=jdc
- if units is not None:
+ if self.jdc is not None and units is not None:
self.jdc.recorded_units=units
self.jdc.old_recorded_units=units
else:
else:
print "Catalog description cannot be interpreted: ", catalogue
- # TODO: Remove this filter. Normally, CONFIGURATION should only define the catalogs for this code anyway.
- # Non pas pour Map qui a une notion de sscode
- for catalogue in all_cata_list:
- #print catalogue.code
- #print catalogue.file_format
- if catalogue.code == self.code :
- if (self.ssCode == None) or (self.ssCode == catalogue.file_format):
- liste_cata_possibles.append(catalogue)
+ # This filter is only useful for codes that have subcodes (like MAP).
+ # Otherwise, the "code" attribute of the catalog description can (should) be None.
+ if self.ssCode is None:
+ liste_cata_possibles = all_cata_list
+ else:
+ for catalogue in all_cata_list:
+ #print catalogue.code
+ #print catalogue.file_format
+ if catalogue.code == self.code and catalogue.file_format == self.ssCode:
+ liste_cata_possibles.append(catalogue)
#print "___________"
#print self.ssCode
#print self.code
if len(liste_cata_possibles)==0:
- QMessageBox.critical( self.QWParent, "Import du catalogue","Pas de catalogue defini pour le code %s" % self.code)
+ QMessageBox.critical(self.QWParent, "Import du catalogue",
+ u"Pas de catalogue défini pour le code %s" % self.code)
self.appliEficas.close()
if self.appliEficas.salome == 0 :
sys.exit(1)
-# Choix des catalogues
import os
-#rep_cata=os.path.dirname(os.path.abspath(__file__))
-rep_cata=os.getcwd()
+from Editeur.catadesc import CatalogDescription
+
+# Choix des catalogues
catalogues = (
-# (code,version,catalogue,formatIn,formatOut)
- ('OPENTURNS_STUDY','V8',os.path.join(rep_cata,'OpenTURNS_Cata_Study_V8.py'),'openturns_study'),
+ CatalogDescription(identifier = "OPENTURNS_STUDY_V8",
+ cata_file_path = os.path.join(os.getcwd(), 'OpenTURNS_Cata_Study_V8.py'),
+ file_format = "openturns_study"),
)
-
-# Choix des catalogues
import os
-rep_cata=os.getcwd()
+from Editeur.catadesc import CatalogDescription
+
+# Choix des catalogues
catalogues = (
-# (code,version,catalogue,formatIn,formatOut)
- #('OPENTURNS_WRAPPER','V1',os.path.join(rep_cata,'OpenTURNS_Cata_Wrapper_V1.py'),'openturns_wrapper','wrapper'),
- ('OPENTURNS_WRAPPER','V3',os.path.join(rep_cata,'OpenTURNS_Cata_Wrapper_V4.py'),'openturns_wrapper','wrapper'),
- #('OPENTURNS','Wrapper',os.path.join(rep_cata,'OpenTURNS_Cata_Wrapper_V1.py'),'openturns'),
+ CatalogDescription(identifier = "OPENTURNS_WRAPPER_V4",
+ cata_file_path = os.path.join(os.getcwd(), 'OpenTURNS_Cata_Wrapper_V4.py'),
+ file_format = "openturns_wrapper"),
)
-