diff --git a/src/Referentiel.py b/src/Referentiel.py index d6f7a5ae..7e11116f 100644 --- a/src/Referentiel.py +++ b/src/Referentiel.py @@ -3267,8 +3267,10 @@ def getDernierNiveauArbre(dic): # # Ajout des compétences du tronc commun # +# print("_dicoGrpIndicateur", self.code) self._dicoGrpIndicateur = {} for code, comp in self._dicoCompetences.items(): +# print(" ", code) if ref.tr_com != []: t = ref.tr_com[0] # print " ++", t, REFERENTIELS.keys() @@ -3281,7 +3283,7 @@ def getDernierNiveauArbre(dic): d = {} - for p in self.parties.keys(): + for p in self.parties: d[p] = [] for comp, competence in self._dicoIndicateurs[code].items(): @@ -3289,11 +3291,11 @@ def getDernierNiveauArbre(dic): for part in indic.poids: if part in d: d[part].append(comp) - - for p in self.parties.keys(): + + for p in self.parties: d[p] = list(set(d[p])) - - if all(len(d[part]) > 0 for part in d): +# print(" ",d) + if any(len(d[part]) > 0 for part in d): self._dicoGrpIndicateur[code] = d # if self._parent.Code == "EE-SI": # print " ", self._dicoCompetences diff --git a/src/file2bmp.py b/src/file2bmp.py index 9ca23239..2cdcc913 100644 --- a/src/file2bmp.py +++ b/src/file2bmp.py @@ -143,7 +143,7 @@ def wximg2file(img): # print(temp_name) # with tempfile.NamedTemporaryFile() as resultFile: img.SaveFile(temp_name, wx.BITMAP_TYPE_PNG) - return temp_name, True + return temp_name ############################################################################# @@ -163,3 +163,5 @@ def file2imgfile(nf, defaut = ""): elif ext in file_types['html']: return html2imgfile(nf), True + else: + return None, False diff --git a/src/lien.py b/src/lien.py index cd38c958..5138072d 100644 --- a/src/lien.py +++ b/src/lien.py @@ -380,7 +380,7 @@ def setBitmap(self, bmp = None): elif self.ok: - bmp = file2bmp(self.lien.path) + bmp = file2bmp(self.path) if bmp is not None and bmp is not wx.NullBitmap: self.image = bmp @@ -414,11 +414,12 @@ def getImageFile(self): ATTENTION : les fichiers temporaires doivent être effacés """ - if self.image is not None and self.image is not wx.NullBitmap: - nf = wximg2file(self.image) - elif self.ok: - nf = file2imgfile(self.lien.path) + if self.ok: + nf = file2imgfile(self.path) + + elif self.image is not None and self.image is not wx.NullBitmap: + nf = wximg2file(self.image) else: return None, None diff --git a/src/objects_wx.py b/src/objects_wx.py index 20248341..dd213b4d 100644 --- a/src/objects_wx.py +++ b/src/objects_wx.py @@ -11513,7 +11513,7 @@ def __init__(self, parent, tache, revue = 0): lstPhases = [prj.phases[k][1] for k in prj.listPhases if not k in prj.listPhasesEval] titre = wx.StaticText(pageGen, -1, "Phase : ") - c00.Add(titre, flag = wx.EXPAND) + c00.Add(titre, flag = wx.ALIGN_CENTER_VERTICAL) # pageGen.sizer.Add(titre, (0,0), flag = wx.ALIGN_CENTER_VERTICAL | wx.ALIGN_RIGHT|wx.LEFT, border = 5) if tache.phase in TOUTES_REVUES_SOUT: @@ -11525,7 +11525,7 @@ def __init__(self, parent, tache, revue = 0): txtPhas = wx.StaticText(pageGen, -1, "") # pageGen.sizer.Add(txtPhas, (0,1), (1,1), flag = wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT|wx.ALL, border = 5) self.txtPhas = txtPhas - c00.Add(txtPhas, flag = wx.EXPAND) + c00.Add(txtPhas, flag = wx.ALIGN_CENTER_VERTICAL) else: cbPhas = combo_adv.BitmapComboBox(pageGen, -1, "Sélectionner la phase", @@ -11541,7 +11541,7 @@ def __init__(self, parent, tache, revue = 0): cbPhas.SetItemBitmap(i, scaleImage(constantes.imagesTaches[k].GetBitmap(), 24*SSCALE, 24*SSCALE)) pageGen.Bind(wx.EVT_COMBOBOX, self.EvtComboBox, cbPhas) self.cbPhas = cbPhas - c00.Add(cbPhas, flag = wx.EXPAND) + c00.Add(cbPhas, flag = wx.ALIGN_CENTER_VERTICAL) # pageGen.sizer.Add(cbPhas, (0,1), flag = wx.EXPAND|wx.ALL, border = 2) c0.Add(c00, flag = wx.EXPAND) @@ -16412,15 +16412,17 @@ def OnItemCheck(self, event, item = None): # cases = self.GetItemWindow(item, self.colEleves) # print(" ", cases) - - etat = self.GetItem3StateValue(item) - if etat == wx.CHK_UNDETERMINED: - etat = wx.CHK_UNCHECKED - self.MiseAJourCheckbox(item, etat = etat) + if self.IsItem3State(item): + etat = self.GetItem3StateValue(item) + if etat == wx.CHK_UNDETERMINED: + etat = wx.CHK_UNCHECKED + self.MiseAJourCheckbox(item, etat = etat) self.AjouterEnleverCompetencesItem(item) - self.GetItemWindow(item, self.colEleves).Actualiser() + cases = self.GetItemWindow(item, self.colEleves) + if cases is not None: + cases.Actualiser() diff --git a/src/pysequence.py b/src/pysequence.py index 849ebf56..c100a010 100644 --- a/src/pysequence.py +++ b/src/pysequence.py @@ -13742,6 +13742,8 @@ def GetEvaluabilite(self, complet = False, compil = False): prj = self.GetProjetRef() ref = self.GetReferentiel() # print(prj._dicoGrpIndicateur) +# print(prj._dicoCompetences) +# print(prj._dicoIndicateurs) # dicPoids = self.GetReferentiel().dicoPoidsIndicateurs_prj dicIndicateurs = self.GetDicIndicateurs() # print(" ", dicIndicateurs) @@ -13838,8 +13840,6 @@ def getPoids(competence, code, poidsGrp): ev[disc][part][grp] = [tx, tx >= seuil[disc][part]] ev_tot[disc][part][1] = ev_tot[disc][part][1] and ev[disc][part][grp][1] -# print(" ", ev, ev_tot, seuil) - # print(">>>", ev, ev_tot, seuil) if compil: