From 95ec892065a312a038e1223b71fed6c967289c2b Mon Sep 17 00:00:00 2001 From: debianpepper Date: Tue, 12 Dec 2023 20:33:47 +0900 Subject: [PATCH] Testing: Module Changes Signed-off-by: debianpepper --- python_modules/build_iso.py | 58 ++++++++++++++----------------------- 1 file changed, 22 insertions(+), 36 deletions(-) diff --git a/python_modules/build_iso.py b/python_modules/build_iso.py index 83aaff00..a797f94a 100644 --- a/python_modules/build_iso.py +++ b/python_modules/build_iso.py @@ -108,25 +108,17 @@ class BuildXfce: """ Builds the ISO XFCE Depedning on the Arch """ current_working_directory = os.getcwd() dir_current = WRKING_DIR + current_working_directory - logger.info("Building a " + self.sbase + self.sarch[1:] + " bit ISO") + logger.info(f"Building a {self.sbase}{self.sarch[1:]} bit ISO") logger.info(dir_current) - # Set the config tree self.lb_helper() - # Start with the XFCE stuff self.xfce_helper() - # Run the specific classes self.infra_helper() - # Run the Build logger.info(CFG_READY) logger.info(START_LIVEBUILD) logger.info(dir_current) - self.lb_helper() run_cmd = 'sudo lb build' - current_working_directory = os.getcwd() os.chdir(HOME_FOLDER + FUSATO_ROOT) - # Set the build inidcator inflate_bubble.make_bld_xfce(self.sbase, self.sarch[1:]) - logger.info(dir_current) os.system(run_cmd) logger.info(BUILD_COMPLETED) logger.info(dir_current) @@ -274,7 +266,10 @@ class Decsions: """ Aguments used to tell the application what to build """ + + def __init__(self): + """ init the Decsions """ # Set up the terminal arguments self.argument_parser = argparse.ArgumentParser() self.argument_parser.add_argument("set", @@ -295,37 +290,28 @@ class Decsions: ) self.arguments = self.argument_parser.parse_args() # Then determine what desktop build to look for - if self.arguments.e == 'e-gnomefb': - self.dgnomefb() - elif self.arguments.e == 'e-xfce': - self.dxfce() - elif self.arguments.e == 'e-openbox': - self.dopenbox() + desktop_build_function = getattr(self, f'd{self.arguments.e[2:]}', None) + if desktop_build_function: + desktop_build_function() def dxfce(self): """ Arguments for the XFCE """ - if self.arguments.e == 'e-xfce': - if self.arguments.b == 'b-deb64': - readybuild() - BuildXfce("deb", "_64") - elif self.arguments.b == 'b-deb32': - readybuild() - BuildXfce("deb", "_32") - elif self.arguments.b == 'b-dev64': - readybuild() - BuildXfce("dev", "_64") - elif self.arguments.b == 'b-dev32': - readybuild() - BuildXfce("dev", "_32") - elif self.arguments.b == 'b-debarm': - readybuild() - BuildXfce("deb", "_arm") - elif self.arguments.b == 'b-devarm': - readybuild() - BuildXfce("dev", "_arm") - else: - logger.critical("You have not specified a build to process!") + build_type_mapping = { + 'b-deb64': ("deb", "_64"), + 'b-deb32': ("deb", "_32"), + 'b-dev64': ("dev", "_64"), + 'b-dev32': ("dev", "_32"), + 'b-debarm': ("deb", "_arm"), + 'b-devarm': ("dev", "_arm"), + } + + build_argument = self.arguments.b + if build_argument in build_type_mapping: + readybuild() + BuildXfce(*build_type_mapping[build_argument]) + else: + logger.critical("You have not specified a build to process!") def dgnomefb(self):