This allows us to add a Description field in register. This can be
used to update the DESCRIPTION image property
"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 ""
+
- (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, 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
+ session['metadata']['DESCRIPTION'] = description
metadata = {}
metadata.update(session['metadata'])
if 'task_metadata' in session:
metadata = {}
metadata.update(session['metadata'])
if 'task_metadata' in session: