Skip to content

Commit

Permalink
Move submenus to MenuItem functions
Browse files Browse the repository at this point in the history
  • Loading branch information
jakogut committed Mar 24, 2016
1 parent abdea76 commit 98ee5bc
Showing 1 changed file with 14 additions and 19 deletions.
33 changes: 14 additions & 19 deletions kiwi/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,23 +37,6 @@ def __init__(self):

self.source_dir = '/mnt/source/'

source_items = [
('Network Filesystem (NFS)', MenuItem(self.prepare_nfs_source)),
#('Network Block Device (NBD)', MenuItem()),
('SCP/SFTP (SSH)', MenuItem(self.prepare_sshfs_source)),
('Block Device (USB, CD/DVD, etc.)', self.prepare_blk_source),
('---', MenuItem(separator=True)),
('OTHER (Path)', MenuItem(self.prepare_fs_source)),
]

source_submenu = Menu(self.d, source_items, 'Select Installation Source')

partitioning_items = [
('Auto-Prepare (erases the ENTIRE storage drive)', MenuItem(self.auto_prepare)),
]

partitioning_submenu = Menu(self.d, partitioning_items, title='Partition Drives')

advanced_items = [
('Filesystem options', MenuItem(self.fs_options)),
]
Expand All @@ -62,8 +45,8 @@ def __init__(self):

main_menu_items = [
('Configure Networking', MenuItem(self.configure_network)),
('Prepare Storage Device', partitioning_submenu),
('Select Installation Source', source_submenu),
('Prepare Storage Device', MenuItem(self.auto_prepare)),
('Select Installation Source', MenuItem(self.prepare_source)),
('Install OS', MenuItem(self.install_os)),
#('Install Bootloader', self.install_bootloader),
('Reboot', MenuItem(self.reboot)),
Expand Down Expand Up @@ -221,6 +204,18 @@ def mount_partitions(self):

self.logger.info('Mounted partitions successfully')

def prepare_source(self):
source_items = [
('Network Filesystem (NFS)', MenuItem(self.prepare_nfs_source)),
#('Network Block Device (NBD)', MenuItem()),
('SCP/SFTP (SSH)', MenuItem(self.prepare_sshfs_source)),
('Block Device (USB, CD/DVD, etc.)', self.prepare_blk_source),
('---', MenuItem(separator=True)),
('OTHER (Path)', MenuItem(self.prepare_fs_source)),
]

Menu(self.d, source_items, 'Select Installation Source').run()

def prepare_fs_source(self):
code, path = self.d.inputbox('Enter a UNIX path', width=40)
if code != self.d.OK: return
Expand Down

0 comments on commit 98ee5bc

Please sign in to comment.