From 21db9f2a1ee5c7c4ff373903a2f832c0ea790c95 Mon Sep 17 00:00:00 2001 From: "flyingscorpio@arch-desktop" Date: Mon, 1 Feb 2021 19:22:53 +0100 Subject: [PATCH] Add do_dependency, make vim a dependency of neovim, make process_program a private method --- install.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/install.py b/install.py index db32988..a8aaa03 100755 --- a/install.py +++ b/install.py @@ -311,6 +311,12 @@ class Installer: self.base_dir.chdir() + def do_dependency(self, *programs: str) -> None: + """Process a program from the config file as a dependency of another program.""" + + for program in programs: + self._process_program(program) + def do_symlink(self, src: str, dest: str, condition: str = "true") -> None: """Make a symlink to a file.""" @@ -403,14 +409,14 @@ class Installer: programs = list(self.conf.keys()) for program in programs: if ui.ask_yes_no("Do you wish to install {}?".format(program)): - self.process_program(program) + self._process_program(program) else: ui.info_2("Skipping {}".format(program)) else: for program in programs: - self.process_program(program) + self._process_program(program) - def process_program(self, program: str) -> None: + def _process_program(self, program: str) -> None: """Install one program (called by self.process()). Call indivdual methods from the conf file.