Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
itminedu
snf-image-creator
Commits
66719e36
Commit
66719e36
authored
Mar 19, 2013
by
Nikos Skalkotos
Browse files
Minor code and messages cleanup
parent
769526cb
Changes
2
Hide whitespace changes
Inline
Side-by-side
image_creator/dialog_menu.py
View file @
66719e36
...
...
@@ -110,15 +110,21 @@ class metadata_monitor(object):
def
upload_image
(
session
):
d
=
session
[
"dialog"
]
dev
=
session
[
'device'
]
meta
=
session
[
'metadata'
]
size
=
dev
.
size
if
"account"
not
in
session
:
d
.
msgbox
(
"You need to provide your ~okeanos
account
before you "
d
.
msgbox
(
"You need to provide your ~okeanos
credentials
before you "
"can upload images to pithos+"
,
width
=
SMALL_WIDTH
)
return
False
while
1
:
init
=
session
[
"upload"
]
if
"upload"
in
session
else
''
if
'upload'
in
session
:
init
=
session
[
'upload'
]
elif
'OS'
in
meta
:
init
=
"%s.diskdump"
%
meta
[
'OS'
]
else
:
init
=
""
(
code
,
answer
)
=
d
.
inputbox
(
"Please provide a filename:"
,
init
=
init
,
width
=
WIDTH
)
...
...
@@ -209,7 +215,7 @@ def register_image(session):
d
.
msgbox
(
"Registration name cannot be empty"
,
width
=
SMALL_WIDTH
)
continue
ret
=
d
.
yesno
(
"Make the image public?
\\
nA public image is accessible"
ret
=
d
.
yesno
(
"Make the image public?
\\
nA public image is accessible
"
"by every user of the service."
,
defaultno
=
1
,
width
=
WIDTH
)
if
ret
not
in
(
0
,
1
):
...
...
@@ -283,7 +289,7 @@ def kamaki_menu(session):
if
choice
==
"Account"
:
default_item
=
"Account"
(
code
,
answer
)
=
d
.
inputbox
(
"Please provide your ~okeanos token:"
,
"Please provide your ~okeanos
authentication
token:"
,
init
=
session
[
"account"
][
'auth_token'
]
if
"account"
in
session
else
''
,
width
=
WIDTH
)
if
code
in
(
d
.
DIALOG_CANCEL
,
d
.
DIALOG_ESC
):
...
...
image_creator/dialog_wizard.py
View file @
66719e36
...
...
@@ -77,12 +77,12 @@ class Wizard:
msg
=
"All necessary information has been gathered:
\n\n
"
for
page
in
self
.
pages
:
msg
+=
" * %s
\n
"
%
page
.
info
msg
+=
"
\n
Con
firm and P
roce
ed.
"
msg
+=
"
\n
Con
tinue with the image creation p
roce
ss?
"
ret
=
self
.
d
.
yesno
(
msg
,
width
=
PAGE_WIDTH
,
height
=
12
,
ok_label
=
"Y
es
"
,
cancel
=
"Back"
,
extra_button
=
1
,
extra_label
=
"Quit"
,
title
=
"Confirmation"
)
msg
,
width
=
PAGE_WIDTH
,
height
=
8
+
len
(
self
.
pag
es
)
,
ok_label
=
"Yes"
,
cancel
=
"Back"
,
extra_button
=
1
,
extra_label
=
"Quit"
,
title
=
"Confirmation"
)
if
ret
==
self
.
d
.
DIALOG_CANCEL
:
idx
-=
1
...
...
@@ -100,16 +100,10 @@ class WizardPage(object):
PREV
=
-
1
def
__init__
(
self
,
**
kargs
):
if
'validate'
in
kargs
:
validate
=
kargs
[
'validate'
]
else
:
validate
=
lambda
x
:
x
validate
=
kargs
[
'validate'
]
if
'validate'
in
kargs
else
lambda
x
:
x
setattr
(
self
,
"validate"
,
validate
)
if
'display'
in
kargs
:
display
=
kargs
[
'display'
]
else
:
display
=
lambda
x
:
x
display
=
kargs
[
'display'
]
if
'display'
in
kargs
else
lambda
x
:
x
setattr
(
self
,
"display"
,
display
)
def
run
(
self
,
session
,
index
,
total
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment