Revision 66719e36

b/image_creator/dialog_menu.py
110 110
def upload_image(session):
111 111
    d = session["dialog"]
112 112
    dev = session['device']
113
    meta = session['metadata']
113 114
    size = dev.size
114 115

  
115 116
    if "account" not in session:
116
        d.msgbox("You need to provide your ~okeanos account before you "
117
        d.msgbox("You need to provide your ~okeanos credentials before you "
117 118
                 "can upload images to pithos+", width=SMALL_WIDTH)
118 119
        return False
119 120

  
120 121
    while 1:
121
        init = session["upload"] if "upload" in session else ''
122
        if 'upload' in session:
123
            init = session['upload']
124
        elif 'OS' in meta:
125
            init = "%s.diskdump" % meta['OS']
126
        else:
127
            init = ""
122 128
        (code, answer) = d.inputbox("Please provide a filename:", init=init,
123 129
                                    width=WIDTH)
124 130

  
......
209 215
            d.msgbox("Registration name cannot be empty", width=SMALL_WIDTH)
210 216
            continue
211 217

  
212
        ret = d.yesno("Make the image public?\\nA public image is accessible"
218
        ret = d.yesno("Make the image public?\\nA public image is accessible "
213 219
                      "by every user of the service.", defaultno=1,
214 220
                      width=WIDTH)
215 221
        if ret not in (0, 1):
......
283 289
        if choice == "Account":
284 290
            default_item = "Account"
285 291
            (code, answer) = d.inputbox(
286
                "Please provide your ~okeanos token:",
292
                "Please provide your ~okeanos authentication token:",
287 293
                init=session["account"]['auth_token'] if "account" in session
288 294
                else '', width=WIDTH)
289 295
            if code in (d.DIALOG_CANCEL, d.DIALOG_ESC):
b/image_creator/dialog_wizard.py
77 77
                msg = "All necessary information has been gathered:\n\n"
78 78
                for page in self.pages:
79 79
                    msg += " * %s\n" % page.info
80
                msg += "\nConfirm and Proceed."
80
                msg += "\nContinue with the image creation process?"
81 81

  
82 82
                ret = self.d.yesno(
83
                    msg, width=PAGE_WIDTH, height=12, ok_label="Yes",
84
                    cancel="Back", extra_button=1, extra_label="Quit",
85
                    title="Confirmation")
83
                    msg, width=PAGE_WIDTH, height=8 + len(self.pages),
84
                    ok_label="Yes", cancel="Back", extra_button=1,
85
                    extra_label="Quit", title="Confirmation")
86 86

  
87 87
                if ret == self.d.DIALOG_CANCEL:
88 88
                    idx -= 1
......
100 100
    PREV = -1
101 101

  
102 102
    def __init__(self, **kargs):
103
        if 'validate' in kargs:
104
            validate = kargs['validate']
105
        else:
106
            validate = lambda x: x
103
        validate = kargs['validate'] if 'validate' in kargs else lambda x: x
107 104
        setattr(self, "validate", validate)
108 105

  
109
        if 'display' in kargs:
110
            display = kargs['display']
111
        else:
112
            display = lambda x: x
106
        display = kargs['display'] if 'display' in kargs else lambda x: x
113 107
        setattr(self, "display", display)
114 108

  
115 109
    def run(self, session, index, total):

Also available in: Unified diff