Skip to content

Commit

Permalink
Bugfix divers
Browse files Browse the repository at this point in the history
  • Loading branch information
cedrick-f committed May 21, 2020
1 parent c733b0e commit a7fef28
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 22 deletions.
12 changes: 7 additions & 5 deletions src/Referentiel.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -3281,19 +3283,19 @@ 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():
for indic in getListeIndic(competence):
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
Expand Down
4 changes: 3 additions & 1 deletion src/file2bmp.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


#############################################################################
Expand All @@ -163,3 +163,5 @@ def file2imgfile(nf, defaut = ""):
elif ext in file_types['html']:
return html2imgfile(nf), True

else:
return None, False
11 changes: 6 additions & 5 deletions src/lien.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down
20 changes: 11 additions & 9 deletions src/objects_wx.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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",
Expand All @@ -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)
Expand Down Expand Up @@ -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()



Expand Down
4 changes: 2 additions & 2 deletions src/pysequence.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit a7fef28

Please sign in to comment.