Revision 6b7eb528 image_creator/dialog_menu.py

b/image_creator/dialog_menu.py
217 217
                 "register it", width=SMALL_WIDTH)
218 218
        return False
219 219

  
220
    name = ""
221
    description = session['metadata']['DESCRIPTION'] if 'DESCRIPTION' in \
222
        session['metadata'] else ""
223

  
220 224
    while 1:
221
        (code, answer) = d.inputbox("Please provide a registration name:",
222
                                    width=WIDTH)
225
        fields = [
226
            ("Registration name:", name, 60),
227
            ("Description (optional):", description, 80)]
228

  
229
        (code, output) = d.form(
230
            "Please provide the following registration info:", height=11,
231
            width=WIDTH, form_height=2, fields=fields)
232

  
223 233
        if code in (d.DIALOG_CANCEL, d.DIALOG_ESC):
224 234
            return False
225 235

  
226
        name = answer.strip()
236
        name, description = output
237
        name = name.strip()
238
        description = description.strip()
239

  
227 240
        if len(name) == 0:
228 241
            d.msgbox("Registration name cannot be empty", width=SMALL_WIDTH)
229 242
            continue
......
238 251

  
239 252
        break
240 253

  
254
    session['metadata']['DESCRIPTION'] = description
241 255
    metadata = {}
242 256
    metadata.update(session['metadata'])
243 257
    if 'task_metadata' in session:

Also available in: Unified diff