Replaced call to Optionable expand_filename_sch by self.expand_dirname
- In Pre ERC, DRC and update XML
This commit is contained in:
parent
4f5b4c0619
commit
631cef7fd9
|
|
@ -34,7 +34,7 @@ class Run_DRC(BasePreFlight): # noqa: F821
|
||||||
load_board()
|
load_board()
|
||||||
out_pattern = GS.global_output if GS.global_output is not None else GS.def_global_output
|
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)
|
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):
|
def run(self):
|
||||||
check_script(CMD_PCBNEW_RUN_DRC, URL_PCBNEW_RUN_DRC, '1.4.0')
|
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])
|
cmd.extend(['-f', GS.filter_file])
|
||||||
if BasePreFlight.get_option('ignore_unconnected'): # noqa: F821
|
if BasePreFlight.get_option('ignore_unconnected'): # noqa: F821
|
||||||
cmd.append('-i')
|
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
|
# If we are in verbose mode enable debug in the child
|
||||||
cmd, video_remove = add_extra_options(cmd)
|
cmd, video_remove = add_extra_options(cmd)
|
||||||
logger.info('- Running the DRC')
|
logger.info('- Running the DRC')
|
||||||
ret = exec_with_retry(cmd)
|
ret = exec_with_retry(cmd)
|
||||||
if video_remove:
|
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):
|
if os.path.isfile(video_name):
|
||||||
os.remove(video_name)
|
os.remove(video_name)
|
||||||
if ret:
|
if ret:
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ class Run_ERC(BasePreFlight): # noqa: F821
|
||||||
load_sch()
|
load_sch()
|
||||||
out_pattern = GS.global_output if GS.global_output is not None else GS.def_global_output
|
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)
|
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):
|
def run(self):
|
||||||
check_eeschema_do()
|
check_eeschema_do()
|
||||||
|
|
@ -47,13 +47,13 @@ class Run_ERC(BasePreFlight): # noqa: F821
|
||||||
cmd.append('-w')
|
cmd.append('-w')
|
||||||
if GS.filter_file:
|
if GS.filter_file:
|
||||||
cmd.extend(['-f', 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
|
# If we are in verbose mode enable debug in the child
|
||||||
cmd, video_remove = add_extra_options(cmd)
|
cmd, video_remove = add_extra_options(cmd)
|
||||||
logger.info('- Running the ERC')
|
logger.info('- Running the ERC')
|
||||||
ret = exec_with_retry(cmd)
|
ret = exec_with_retry(cmd)
|
||||||
if video_remove:
|
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):
|
if os.path.isfile(video_name):
|
||||||
os.remove(video_name)
|
os.remove(video_name)
|
||||||
if ret:
|
if ret:
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,6 @@ from sys import (exit)
|
||||||
from .macros import macros, pre_class # noqa: F401
|
from .macros import macros, pre_class # noqa: F401
|
||||||
from .error import (KiPlotConfigurationError)
|
from .error import (KiPlotConfigurationError)
|
||||||
from .gs import (GS)
|
from .gs import (GS)
|
||||||
from .optionable import Optionable
|
|
||||||
from .kiplot import check_eeschema_do, exec_with_retry, add_extra_options
|
from .kiplot import check_eeschema_do, exec_with_retry, add_extra_options
|
||||||
from .misc import (CMD_EESCHEMA_DO, BOM_ERROR)
|
from .misc import (CMD_EESCHEMA_DO, BOM_ERROR)
|
||||||
from .log import (get_logger)
|
from .log import (get_logger)
|
||||||
|
|
@ -34,7 +33,7 @@ class Update_XML(BasePreFlight): # noqa: F821
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
check_eeschema_do()
|
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
|
# If we are in verbose mode enable debug in the child
|
||||||
cmd, video_remove = add_extra_options(cmd)
|
cmd, video_remove = add_extra_options(cmd)
|
||||||
logger.info('- Updating BoM in XML format')
|
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)
|
logger.error('Failed to update the BoM, error %d', ret)
|
||||||
exit(BOM_ERROR)
|
exit(BOM_ERROR)
|
||||||
if video_remove:
|
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):
|
if os.path.isfile(video_name):
|
||||||
os.remove(video_name)
|
os.remove(video_name)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue