2 def __init__(self,ntuple):
5 def __convert__(self,valeur):
6 if type(valeur) == types.StringType:
8 if len(valeur) != self.ntuple:
13 return "Tuple de %s elements" % self.ntuple
20 def inverseDico(dicoSource) :
21 #---------------------------
23 for (clef,valeur) in dicoSource.items():
24 if not(type(valeur) is tuple):
25 dicoInverse[valeur]=clef
28 if elt not in dicoInverse : dicoInverse[elt]={}
29 dicoInverse[elt][att]=clef
32 dictSIMPEficasXML= { 'typ' : 'nomTypeAttendu',
34 'min' : 'minOccurences',
35 'max' : 'maxOccurences',
37 'position' : 'portee',
38 'validators' : 'validators' ,
40 'defaut' : 'valeurDef' ,
41 'into' : ('plageValeur','into'),
42 'val_min' : ('plageValeur','borneInf'),
43 'val_max' : ('plageValeur','borneSup'),
44 'ang' : ('doc','ang'),
46 'docu' : ('doc','docu'),
49 dictSIMPXMLEficas= inverseDico(dictSIMPEficasXML)
53 dictFACTEficasXML = { 'statut' : 'statut',
54 'min' : 'minOccurences',
55 'max' : 'maxOccurences',
56 'ang' : ('doc','ang'),
58 'docu' : ('doc','docu'),
60 'validators' : 'validators' ,
63 dictFACTXMLEficas = inverseDico(dictFACTEficasXML)
65 dictBLOCEficasXML = { 'statut' : 'statut',
66 'ang' : ('doc','ang'),
69 'condition' : 'condition' ,
72 dictBLOCXMLEficas = inverseDico(dictBLOCEficasXML)
74 dictPROCEficasXML = { 'nom' : 'nom',
76 'ang' : ('doc','ang'),
78 'docu' : ('doc','docu'),
81 dictPROCXMLEficas = inverseDico(dictPROCEficasXML)
83 dictOPEREficasXML = dictPROCEficasXML
84 dictOPERXMLEficas = dictPROCXMLEficas
86 dictPourCast = { 'I' : int, 'R' : float, 'bool' : bool , }
87 dictNomsDesTypes = { 'I' : 'xs:int', 'R' : 'xs:float', bool : 'xs:boolean' , 'TXM' : 'xs:string', 'Fichier' : 'xs:string', 'Repertoire':'xs:string', 'FichierNoAbs' : 'xs:string', 'FichierOuRepertoire':'xs:string' }
89 listeParamDeTypeTypeAttendu = ( 'defaut', 'sug', 'val_min', 'val_max', 'into', 'intoSug')
90 listeParamDeTypeStr = ('fr', 'docu', 'ang', 'nom' )
92 listeParamTjsSequence = ('into' , 'intoSug')
93 listeParamSelonType = ('defaut', 'sug', 'into', 'intoSug')
95 if __name__ == "__main__":
97 pp=pprint.PrettyPrinter(indent=4)
98 print ('dictSIMPEficasXML')
99 pp.pprint(dictSIMPEficasXML)
101 print ('dictSIMPXMLEficas')
102 pp.pprint(dictSIMPXMLEficas)
104 print ('dictFACTEficasXML')
105 pp.pprint(dictFACTEficasXML)
107 print ('dictFACTXMLEficas')
108 pp.pprint(dictFACTXMLEficas)
110 print ('dictPROCEficasXML')
111 pp.pprint(dictPROCEficasXML)
113 print ('dictPROCXMLEficas')
114 pp.pprint(dictPROCXMLEficas)
116 print ('dictNomsDesTypes')
117 pp.pprint(dictNomsDesTypes )