projects
/
snf-image-creator
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'develop'
[snf-image-creator]
/
image_creator
/
dialog_menu.py
diff --git
a/image_creator/dialog_menu.py
b/image_creator/dialog_menu.py
index
1e74970
..
4f24b1e
100644
(file)
--- a/
image_creator/dialog_menu.py
+++ b/
image_creator/dialog_menu.py
@@
-217,13
+217,26
@@
def register_image(session):
"register it", width=SMALL_WIDTH)
return False
"register it", width=SMALL_WIDTH)
return False
+ name = ""
+ description = session['metadata']['DESCRIPTION'] if 'DESCRIPTION' in \
+ session['metadata'] else ""
+
while 1:
while 1:
- (code, answer) = d.inputbox("Please provide a registration name:",
- width=WIDTH)
+ fields = [
+ ("Registration name:", name, 60),
+ ("Description (optional):", description, 80)]
+
+ (code, output) = d.form(
+ "Please provide the following registration info:", height=11,
+ width=WIDTH, form_height=2, fields=fields)
+
if code in (d.DIALOG_CANCEL, d.DIALOG_ESC):
return False
if code in (d.DIALOG_CANCEL, d.DIALOG_ESC):
return False
- name = answer.strip()
+ name, description = output
+ name = name.strip()
+ description = description.strip()
+
if len(name) == 0:
d.msgbox("Registration name cannot be empty", width=SMALL_WIDTH)
continue
if len(name) == 0:
d.msgbox("Registration name cannot be empty", width=SMALL_WIDTH)
continue
@@
-238,6
+251,7
@@
def register_image(session):
break
break
+ session['metadata']['DESCRIPTION'] = description
metadata = {}
metadata.update(session['metadata'])
if 'task_metadata' in session:
metadata = {}
metadata.update(session['metadata'])
if 'task_metadata' in session: