From c2af395145a8362ac17ed1373da4f8dfb29b881e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Luttringer?= Date: Tue, 26 Jun 2012 18:36:41 +0200 Subject: [PATCH] remove run_setup and run_parser --- installsystems/image.py | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-) diff --git a/installsystems/image.py b/installsystems/image.py index 9bbc1da..1c3e7dc 100644 --- a/installsystems/image.py +++ b/installsystems/image.py @@ -968,7 +968,10 @@ class PackageImage(Image): # run parser scripts to extend extparser # those scripts should only extand the parser or produce error if run_parser: - self.run_parser({"parser": extparser}) + self.run_scripts("parser", + lambda: self.select_scripts("parser"), + "/", + {"parser": extparser}) # call parser (again), with full options arrow("Parsing command line") # Catch exception in custom argparse action @@ -978,26 +981,13 @@ class PackageImage(Image): raise ISError("Argument parser", e) # run setup scripts if run_setup: - self.run_setup({"namespace": args}) + self.run_scripts("setup", + lambda: self.select_scripts("setup"), + "/", + {"namespace": args}) # return the building time return int(time.time() - t0) - def run_parser(self, global_dict): - ''' - Run parser scripts - ''' - if global_dict is None: - global_dict = {} - self.run_scripts("parser", lambda: self.select_scripts("parser"), "/", global_dict) - - def run_setup(self, global_dict=None): - ''' - Run setup scripts - ''' - if global_dict is None: - global_dict = {} - self.run_scripts("setup", lambda: self.select_scripts("setup"), "/", global_dict) - def select_scripts(self, directory): ''' Generator of tuples (fp,fn,fc) of scripts witch are allocatable -- GitLab