From 631cef7fd90b7937653fd7f945a89b8b766219de Mon Sep 17 00:00:00 2001 From: Diego Capusotto Date: Wed, 15 Dec 2021 17:03:56 -0300 Subject: [PATCH] Replaced call to Optionable expand_filename_sch by self.expand_dirname - In Pre ERC, DRC and update XML --- kibot/pre_drc.py | 6 +++--- kibot/pre_erc.py | 6 +++--- kibot/pre_update_xml.py | 5 ++--- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/kibot/pre_drc.py b/kibot/pre_drc.py index 85c035d2..7f28be86 100644 --- a/kibot/pre_drc.py +++ b/kibot/pre_drc.py @@ -34,7 +34,7 @@ class Run_DRC(BasePreFlight): # noqa: F821 load_board() out_pattern = GS.global_output if GS.global_output is not None else GS.def_global_output name = Optionable.expand_filename_pcb(self, out_pattern) - return [os.path.abspath(os.path.join(Optionable.expand_filename_pcb(self, GS.out_dir), name))] + return [os.path.abspath(os.path.join(self.expand_dirname(GS.out_dir), name))] def run(self): check_script(CMD_PCBNEW_RUN_DRC, URL_PCBNEW_RUN_DRC, '1.4.0') @@ -45,13 +45,13 @@ class Run_DRC(BasePreFlight): # noqa: F821 cmd.extend(['-f', GS.filter_file]) if BasePreFlight.get_option('ignore_unconnected'): # noqa: F821 cmd.append('-i') - cmd.extend([GS.pcb_file, Optionable.expand_filename_pcb(self, GS.out_dir)]) + cmd.extend([GS.pcb_file, self.expand_dirname(GS.out_dir)]) # If we are in verbose mode enable debug in the child cmd, video_remove = add_extra_options(cmd) logger.info('- Running the DRC') ret = exec_with_retry(cmd) if video_remove: - video_name = os.path.join(Optionable.expand_filename_pcb(self, GS.out_dir), 'pcbnew_run_drc_screencast.ogv') + video_name = os.path.join(self.expand_dirname(GS.out_dir), 'pcbnew_run_drc_screencast.ogv') if os.path.isfile(video_name): os.remove(video_name) if ret: diff --git a/kibot/pre_erc.py b/kibot/pre_erc.py index 0b23da9b..961010d3 100644 --- a/kibot/pre_erc.py +++ b/kibot/pre_erc.py @@ -34,7 +34,7 @@ class Run_ERC(BasePreFlight): # noqa: F821 load_sch() out_pattern = GS.global_output if GS.global_output is not None else GS.def_global_output name = Optionable.expand_filename_sch(self, out_pattern) - return [os.path.abspath(os.path.join(Optionable.expand_filename_sch(self, GS.out_dir), name))] + return [os.path.abspath(os.path.join(self.expand_dirname(GS.out_dir), name))] def run(self): check_eeschema_do() @@ -47,13 +47,13 @@ class Run_ERC(BasePreFlight): # noqa: F821 cmd.append('-w') if GS.filter_file: cmd.extend(['-f', GS.filter_file]) - cmd.extend([GS.sch_file, Optionable.expand_filename_sch(self, GS.out_dir)]) + cmd.extend([GS.sch_file, self.expand_dirname(GS.out_dir)]) # If we are in verbose mode enable debug in the child cmd, video_remove = add_extra_options(cmd) logger.info('- Running the ERC') ret = exec_with_retry(cmd) if video_remove: - video_name = os.path.join(Optionable.expand_filename_sch(self, GS.out_dir), 'run_erc_eeschema_screencast.ogv') + video_name = os.path.join(self.expand_dirname(GS.out_dir), 'run_erc_eeschema_screencast.ogv') if os.path.isfile(video_name): os.remove(video_name) if ret: diff --git a/kibot/pre_update_xml.py b/kibot/pre_update_xml.py index e5da5d25..ff99f26d 100644 --- a/kibot/pre_update_xml.py +++ b/kibot/pre_update_xml.py @@ -8,7 +8,6 @@ from sys import (exit) from .macros import macros, pre_class # noqa: F401 from .error import (KiPlotConfigurationError) from .gs import (GS) -from .optionable import Optionable from .kiplot import check_eeschema_do, exec_with_retry, add_extra_options from .misc import (CMD_EESCHEMA_DO, BOM_ERROR) from .log import (get_logger) @@ -34,7 +33,7 @@ class Update_XML(BasePreFlight): # noqa: F821 def run(self): check_eeschema_do() - cmd = [CMD_EESCHEMA_DO, 'bom_xml', GS.sch_file, Optionable.expand_filename_sch(self, GS.out_dir)] + cmd = [CMD_EESCHEMA_DO, 'bom_xml', GS.sch_file, self.expand_dirname(GS.out_dir)] # If we are in verbose mode enable debug in the child cmd, video_remove = add_extra_options(cmd) logger.info('- Updating BoM in XML format') @@ -43,6 +42,6 @@ class Update_XML(BasePreFlight): # noqa: F821 logger.error('Failed to update the BoM, error %d', ret) exit(BOM_ERROR) if video_remove: - video_name = os.path.join(Optionable.expand_filename_sch(self, GS.out_dir), 'bom_xml_eeschema_screencast.ogv') + video_name = os.path.join(self.expand_dirname(GS.out_dir), 'bom_xml_eeschema_screencast.ogv') if os.path.isfile(video_name): os.remove(video_name)