2018-12-01 14:24:43 -05:00
|
|
|
#!/bin/python
|
|
|
|
import curses
|
2018-12-06 01:31:03 -05:00
|
|
|
import os
|
|
|
|
from lib.parse import parse
|
|
|
|
from lib.package import Category, Package
|
|
|
|
from lib.menu import Menu, ChecklistMenu
|
2018-12-01 14:24:43 -05:00
|
|
|
from lib.configure import configure
|
|
|
|
|
|
|
|
categories = parse('packages.yml')
|
|
|
|
|
2018-12-06 01:31:03 -05:00
|
|
|
run_installer = False
|
|
|
|
def run():
|
|
|
|
for category in [c for c in categories if c.enabled]:
|
|
|
|
for package in category.packages:
|
|
|
|
configure(package)
|
2018-12-01 14:24:43 -05:00
|
|
|
|
|
|
|
class App:
|
|
|
|
def __init__(self, stdscreen):
|
|
|
|
self.screen = stdscreen
|
|
|
|
curses.curs_set(0)
|
|
|
|
|
2018-12-06 01:31:03 -05:00
|
|
|
def exit_and_run():
|
|
|
|
global run_installer
|
|
|
|
run_installer = True
|
|
|
|
main_menu.exit()
|
|
|
|
|
|
|
|
package_options_menu = Category.config_menu(self.screen, categories)
|
|
|
|
|
|
|
|
main_menu = Menu(self.screen, 'Main Menu', [
|
|
|
|
('Package Options', package_options_menu.display),
|
|
|
|
('Run Installer', exit_and_run)
|
|
|
|
])
|
2018-12-01 14:24:43 -05:00
|
|
|
|
|
|
|
main_menu.display()
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
2018-12-06 01:31:03 -05:00
|
|
|
os.environ.setdefault('ESCDELAY', '0')
|
2018-12-01 14:24:43 -05:00
|
|
|
curses.wrapper(App)
|
2018-12-06 01:31:03 -05:00
|
|
|
if run_installer:
|
|
|
|
run()
|
2018-12-01 14:24:43 -05:00
|
|
|
|