1
0
mirror of https://github.com/Foltik/dotfiles synced 2024-11-24 04:22:50 -05:00
dotfiles/install.py
2018-12-06 01:31:03 -05:00

42 lines
1.0 KiB
Python
Executable File

#!/bin/python
import curses
import os
from lib.parse import parse
from lib.package import Category, Package
from lib.menu import Menu, ChecklistMenu
from lib.configure import configure
categories = parse('packages.yml')
run_installer = False
def run():
for category in [c for c in categories if c.enabled]:
for package in category.packages:
configure(package)
class App:
def __init__(self, stdscreen):
self.screen = stdscreen
curses.curs_set(0)
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)
])
main_menu.display()
if __name__ == '__main__':
os.environ.setdefault('ESCDELAY', '0')
curses.wrapper(App)
if run_installer:
run()