From ba48cfd3064fae3e92efdc976d6992e17acd9e07 Mon Sep 17 00:00:00 2001 From: Pascale Noyret Date: Mon, 12 Jul 2010 15:19:23 +0000 Subject: [PATCH] =?utf8?q?Pour=20format=20map.=20tous=20les=20sscodes=20li?= =?utf8?q?sent=20d=20map=20format=5Fin=20ajout=C3=A9=20aux=20catalogues?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- Editeur/catadesc.py | 16 ++++++++++++---- InterfaceQT4/readercata.py | 5 ++++- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/Editeur/catadesc.py b/Editeur/catadesc.py index ff0d8686..ad5d099a 100644 --- a/Editeur/catadesc.py +++ b/Editeur/catadesc.py @@ -23,7 +23,7 @@ class CatalogDescription: def __init__(self, identifier, cata_file_path, file_format = "python", default = False, code = None, user_name = None, - selectable = True): + selectable = True, file_format_in = "python"): """ This class can be used to describe an Eficas catalog. @@ -65,15 +65,23 @@ class CatalogDescription: else: self.user_name = user_name self.selectable = selectable + self.file_format_in = file_format_in @staticmethod def create_from_tuple(cata_tuple): - print "Warning: Describing a catalog with a tuple is deprecated. " \ - "Please create a CatalogDescription instance directly." + #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 and cata_tuple[4] == "defaut": + 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]) return desc diff --git a/InterfaceQT4/readercata.py b/InterfaceQT4/readercata.py index a8829081..d6119edb 100644 --- a/InterfaceQT4/readercata.py +++ b/InterfaceQT4/readercata.py @@ -105,6 +105,7 @@ class READERCATA: if self.version_code == cata.identifier: self.fic_cata = cata.cata_file_path self.appliEficas.format_fichier = cata.file_format + self.appliEficas.format_fichier_in = cata.file_format_in else: cata_choice_list = [] for cata in liste_cata_possibles: @@ -123,6 +124,7 @@ class READERCATA: self.fic_cata = cata_choice_list[0].cata_file_path self.version_code = cata_choice_list[0].identifier self.appliEficas.format_fichier = cata_choice_list[0].file_format + self.appliEficas.format_fichier_in = cata_choice_list[0].file_format_in lab=QString("Eficas ") lab+=QString(self.VERSION_EFICAS) lab+=QString(" pour ") @@ -260,6 +262,7 @@ class READERCATA: self.fic_cata = cata.cata_file_path self.version_code = self.version_cata self.appliEficas.format_fichier = cata.file_format + self.appliEficas.format_fichier_in = cata.file_format_in lab+=self.version_cata self.appliEficas.setWindowTitle(lab) #qApp.mainWidget().setCaption(lab) @@ -274,7 +277,7 @@ class READERCATA: #print self.fic_cata_clef f=open(self.fic_cata_clef) except: - print "Pas de fichier associe contenant des clefs documentaires" + #print "Pas de fichier associe contenant des clefs documentaires" return dict_clef_docu={} -- 2.39.2