Revision 66719e36 image_creator/dialog_menu.py
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): |
Also available in: Unified diff