[dialogwizard,gest_crans2] on utilise True et Flase pour cocher

Ignore-this: c1a8930338b851e26506652dd09db5d8

darcs-hash:20090916190224-bd074-087e2f6b311e24d212376f10e3fa45a6d151ab01.gz
This commit is contained in:
Antoine Durand-Gasselin 2009-09-16 21:02:24 +02:00
parent 42b74ec0e3
commit a62d0a2257
3 changed files with 37 additions and 26 deletions

View file

@ -70,16 +70,20 @@ class DialogStepGenerator():
sliste = []
for c in liste:
try:
sliste.append((c[0], c[1], dico.get(c[0], 'off')))
if dico.get(c[0], False): checked = 'on'
else: checked = 'off'
sliste.append((c[0], c[1], checked))
except Exception,e:
if c.get('show_cond', lambda x : True)(dico):
sliste.append((c['var'], c['item'], dico.get(c['var'], 'off')))
if dico.get(c['var'], False): checked = 'on'
else: checked = 'off'
sliste.append((c['var'], c['item'], checked))
rc, res = self.d.checklist(enonce, title = title, choices = sliste, **kw)
self._check_rc(rc)
for tag, item, status in liste:
if tag in res:
dico[tag] = 'on'
dico[tag] = True
else:
dico[tag] = 'off'
dico[tag] = False
return dico
return Step(fn)