Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
snf-image-creator
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
itminedu
snf-image-creator
Commits
02f71654
Commit
02f71654
authored
12 years ago
by
Nikos Skalkotos
Browse files
Options
Downloads
Patches
Plain Diff
Fix media selection in snf-mkimage
Make sure the user cannot select a directory as input media
parent
1fa75c4c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
image_creator/dialog_main.py
+6
-3
6 additions, 3 deletions
image_creator/dialog_main.py
with
6 additions
and
3 deletions
image_creator/dialog_main.py
+
6
−
3
View file @
02f71654
...
...
@@ -36,6 +36,7 @@
import
dialog
import
sys
import
os
import
stat
import
textwrap
import
signal
import
optparse
...
...
@@ -139,11 +140,13 @@ def select_file(d, media):
d
.
msgbox
(
"
The file `%s
'
you choose does not exist.
"
%
media
,
width
=
SMALL_WIDTH
)
else
:
break
mode
=
os
.
stat
(
media
).
st_mode
if
not
stat
.
S_ISDIR
(
mode
):
break
(
code
,
media
)
=
d
.
fselect
(
root
,
10
,
60
,
extra_button
=
1
,
title
=
"
Please select an input media.
"
,
extra_label
=
"
R
un
ning System
"
)
extra_label
=
"
B
un
dle Host
"
)
if
code
in
(
d
.
DIALOG_CANCEL
,
d
.
DIALOG_ESC
):
if
confirm_exit
(
d
,
"
You canceled the media selection dialog box.
"
):
sys
.
exit
(
0
)
...
...
@@ -151,7 +154,7 @@ def select_file(d, media):
media
=
None
continue
elif
code
==
d
.
DIALOG_EXTRA
:
media
=
'
/
'
return
'
/
'
return
media
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment