Revision af01e887 image_creator/dialog_menu.py
b/image_creator/dialog_menu.py | ||
---|---|---|
621 | 621 |
image = session['image'] |
622 | 622 |
|
623 | 623 |
available = image.os.sysprep_params |
624 |
needed = image.os.needed_sysprep_params() |
|
624 |
needed = image.os.needed_sysprep_params |
|
625 |
names = needed.keys() |
|
625 | 626 |
|
626 | 627 |
if len(needed) == 0: |
627 | 628 |
return True |
628 | 629 |
|
629 | 630 |
fields = [] |
630 |
for param in needed: |
|
631 |
default = available[param.name] if param.name in available else "" |
|
632 |
fields.append(("%s: " % param.description, default, param.length)) |
|
631 |
for name in names: |
|
632 |
param = needed[name] |
|
633 |
default = available[name] if name in available else "" |
|
634 |
fields.append(("%s: " % param.description, default, param.maxlen)) |
|
633 | 635 |
|
634 | 636 |
txt = "Please provide the following system preparation parameters:" |
635 | 637 |
code, output = d.form(txt, height=13, width=WIDTH, form_height=len(fields), |
... | ... | |
640 | 642 |
|
641 | 643 |
sysprep_params = {} |
642 | 644 |
for i in range(len(fields)): |
643 |
if needed[i].validator(output[i]): |
|
644 |
image.os.sysprep_params[needed[i].name] = output[i] |
|
645 |
param = needed[names[i]] |
|
646 |
if param.validator(output[i]): |
|
647 |
image.os.sysprep_params[names[i]] = output[i] |
|
645 | 648 |
else: |
646 | 649 |
d.msgbox("The value you provided for parameter: %s is not valid" % |
647 | 650 |
name, width=SMALL_WIDTH) |
Also available in: Unified diff