diff --git a/kibot/__main__.py b/kibot/__main__.py index a8f29b1a..07640e50 100644 --- a/kibot/__main__.py +++ b/kibot/__main__.py @@ -108,7 +108,7 @@ def solve_schematic(a_schematic, a_board_file, config): else: sch = base+'.kicad_sch' if os.path.isfile(sch): - schematic = sch # pragma: no cover (Ki6) + schematic = sch if not schematic: schematics = glob('*.sch')+glob('*.kicad_sch') if len(schematics) == 1: @@ -219,7 +219,7 @@ def set_locale(): def detect_kicad(): # Check if we have to run the nightly KiCad build nightly = False - if os.environ.get('KIAUS_USE_NIGHTLY'): # pragma: no cover (Ki6) + if os.environ.get('KIAUS_USE_NIGHTLY'): # pragma: no cover (nightly) # Path to the Python module pcbnew_path = '/usr/lib/kicad-nightly/lib/python3/dist-packages' sys_path.insert(0, pcbnew_path) @@ -263,7 +263,7 @@ def detect_kicad(): # KICAD_PATH isn't good on my system. # The kicad-nightly package overwrites the regular package!! GS.kicad_share_path = '/usr/share/kicad' - if GS.ki6(): # pragma: no cover (Ki6) + if GS.ki6(): GS.kicad_conf_path = pcbnew.GetSettingsManager().GetUserSettingsPath() if nightly: # Nightly Debian packages uses `/usr/share/kicad-nightly/kicad-nightly.env` as an environment extension diff --git a/kibot/gs.py b/kibot/gs.py index 6b90a4f0..f00113a3 100644 --- a/kibot/gs.py +++ b/kibot/gs.py @@ -147,7 +147,7 @@ class GS(object): @staticmethod def get_pcb_comment(title_block, num): - if GS.ki6(): # pragma: no cover (Ki6) + if GS.ki6(): # Backward compatibility ... what's this? # Also: Maintaining the same numbers used before (and found in the file) is asking too much? return title_block.GetComment(num) @@ -163,13 +163,13 @@ class GS(object): @staticmethod def get_modules(): - if GS.ki6(): # pragma: no cover (Ki6) + if GS.ki6(): return GS.board.GetFootprints() return GS.board.GetModules() @staticmethod def get_modules_board(board): - if GS.ki6(): # pragma: no cover (Ki6) + if GS.ki6(): return board.GetFootprints() return board.GetModules() @@ -177,7 +177,7 @@ class GS(object): def get_aux_origin(): if GS.board is None: return (0, 0) - if GS.ki6(): # pragma: no cover (Ki6) + if GS.ki6(): settings = GS.board.GetDesignSettings() return settings.GetAuxOrigin() return GS.board.GetAuxOrigin() diff --git a/kibot/kiplot.py b/kibot/kiplot.py index eaeec5a9..655c9568 100644 --- a/kibot/kiplot.py +++ b/kibot/kiplot.py @@ -289,7 +289,7 @@ def get_board_comps_data(comps): c.virtual = True else: c.tht = True - else: # pragma: no cover (Ki6) + else: # KiCad 6 if attrs & MOD_SMD: c.smd = True diff --git a/kibot/layer.py b/kibot/layer.py index 56ef9489..3de162f0 100644 --- a/kibot/layer.py +++ b/kibot/layer.py @@ -189,7 +189,7 @@ class Layer(Optionable): elif layer in Layer._pcb_layers: ext = [Layer.create_layer(layer)] # Give compatibility for the KiCad 5 default names (automagically renamed by KiCad 6) - elif GS.ki6() and layer in Layer.KICAD6_RENAME: # pragma: no cover (Ki6) + elif GS.ki6() and layer in Layer.KICAD6_RENAME: ext = [Layer.create_layer(Layer.KICAD6_RENAME[layer])] elif layer in Layer.DEFAULT_LAYER_NAMES: ext = [Layer.create_layer(layer)] diff --git a/kibot/out_base.py b/kibot/out_base.py index 28dff433..0d30116b 100644 --- a/kibot/out_base.py +++ b/kibot/out_base.py @@ -12,7 +12,7 @@ if not GS.kicad_version_n: # When running the regression tests we need it from kibot.__main__ import detect_kicad detect_kicad() -if GS.ki6(): # pragma: no cover (Ki6) +if GS.ki6(): # New name, no alias ... from pcbnew import FP_SHAPE, wxPoint, LSET else: @@ -186,7 +186,7 @@ class VariantOptions(BaseOptions): @staticmethod def create_module_element(m): if GS.ki6(): - return FP_SHAPE(m) # pragma: no cover (Ki6) + return FP_SHAPE(m) return EDGE_MODULE(m) @staticmethod diff --git a/kibot/out_dxf.py b/kibot/out_dxf.py index ce6a2bf1..aa80f9fb 100644 --- a/kibot/out_dxf.py +++ b/kibot/out_dxf.py @@ -8,7 +8,7 @@ from .out_any_layer import AnyLayer from .drill_marks import DrillMarks from .gs import GS from .macros import macros, document, output_class # noqa: F401 -if GS.ki6(): # pragma: no cover (Ki6) +if GS.ki6(): from pcbnew import DXF_UNITS_MILLIMETERS, DXF_UNITS_INCHES else: DXF_UNITS_MILLIMETERS = 1 diff --git a/kibot/out_gerber.py b/kibot/out_gerber.py index 1436216c..411bc9a0 100644 --- a/kibot/out_gerber.py +++ b/kibot/out_gerber.py @@ -64,7 +64,7 @@ class GerberOptions(AnyLayerOptions): if GS.ki5(): po.SetLineWidth(FromMM(self.line_width)) else: - po.SetDisableGerberMacros(self.disable_aperture_macros) # pragma: no cover (Ki6) + po.SetDisableGerberMacros(self.disable_aperture_macros) po.gerber_job_file = self.gerber_job_file def read_vals_from_po(self, po): @@ -88,7 +88,7 @@ class GerberOptions(AnyLayerOptions): self.line_width = ToMM(po.GetLineWidth()) else: # disableapertmacros - self.disable_aperture_macros = po.GetDisableGerberMacros() # pragma: no cover (Ki6) + self.disable_aperture_macros = po.GetDisableGerberMacros() @output_class diff --git a/kibot/out_position.py b/kibot/out_position.py index a39fc15d..bb2e5360 100644 --- a/kibot/out_position.py +++ b/kibot/out_position.py @@ -191,7 +191,7 @@ class PositionOptions(VariantOptions): @staticmethod def is_pure_smd_6(m): - return m.GetAttributes() & (MOD_THROUGH_HOLE | MOD_SMD) == MOD_SMD # pragma: no cover (Ki6) + return m.GetAttributes() & (MOD_THROUGH_HOLE | MOD_SMD) == MOD_SMD @staticmethod def is_not_virtual_5(m): @@ -199,13 +199,13 @@ class PositionOptions(VariantOptions): @staticmethod def is_not_virtual_6(m): - return not (m.GetAttributes() & MOD_EXCLUDE_FROM_POS_FILES) # pragma: no cover (Ki6) + return not (m.GetAttributes() & MOD_EXCLUDE_FROM_POS_FILES) @staticmethod def get_attr_tests(): if GS.ki5(): return PositionOptions.is_pure_smd_5, PositionOptions.is_not_virtual_5 - return PositionOptions.is_pure_smd_6, PositionOptions.is_not_virtual_6 # pragma: no cover (Ki6) + return PositionOptions.is_pure_smd_6, PositionOptions.is_not_virtual_6 def get_targets(self, out_dir): ext = self._expand_ext