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