diff --git a/image_creator/dialog_main.py b/image_creator/dialog_main.py index 16282c23496ce30480e9b8a18767e0f4c95faf14..7af17f2462b43c1630454c6b2c6ed0b87cb7489c 100644 --- a/image_creator/dialog_main.py +++ b/image_creator/dialog_main.py @@ -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="Running System") + extra_label="Bundle 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