diff --git a/kiplot/config_reader.py b/kiplot/config_reader.py index 71e69ec8..bbaf0bea 100644 --- a/kiplot/config_reader.py +++ b/kiplot/config_reader.py @@ -38,7 +38,7 @@ def config_error(msg): class CfgYamlReader(object): def __init__(self): - super(CfgYamlReader, self).__init__() + super().__init__() def _check_version(self, v): if not isinstance(v, dict): diff --git a/kiplot/drill_marks.py b/kiplot/drill_marks.py index bcd83a8e..4ecb84b2 100644 --- a/kiplot/drill_marks.py +++ b/kiplot/drill_marks.py @@ -1,6 +1,9 @@ from pcbnew import (PCB_PLOT_PARAMS) from .error import KiPlotConfigurationError from kiplot.macros import macros, document, output_class # noqa: F401 +from . import log + +logger = log.get_logger(__name__) class DrillMarks(object): @@ -19,6 +22,7 @@ class DrillMarks(object): } def __init__(self): + super().__init__() with document: self._drill_marks = 'full' """ what to use to indicate the drill places, can be none, small or full (for real scale) """ # pragma: no cover diff --git a/kiplot/optionable.py b/kiplot/optionable.py index 4b5dad8e..57caa289 100644 --- a/kiplot/optionable.py +++ b/kiplot/optionable.py @@ -17,6 +17,7 @@ class Optionable(object): _num_range_re = compile(r"\[number=.*\] \[(-?\d+),(-?\d+)\]") def __init__(self, name, description): + super().__init__() self._name = name self._description = description self._unkown_is_error = True diff --git a/kiplot/out_any_drill.py b/kiplot/out_any_drill.py index 0c2739af..94d2ccb6 100644 --- a/kiplot/out_any_drill.py +++ b/kiplot/out_any_drill.py @@ -11,7 +11,7 @@ logger = log.get_logger(__name__) class DrillMap(Optionable): def __init__(self, name, description): - super(DrillMap, self).__init__(name, description) + super().__init__(name, description) with document: self.type = 'pdf' """ [hpgl,ps,gerber,dxf,svg,pdf] format for a graphical drill map """ @@ -19,7 +19,7 @@ class DrillMap(Optionable): class DrillReport(Optionable): def __init__(self, name, description): - super(DrillReport, self).__init__(name, description) + super().__init__(name, description) with document: self.filename = '' """ name of the drill report. Not generated unless a name is specified """ @@ -27,7 +27,7 @@ class DrillReport(Optionable): class AnyDrill(BaseOutput): def __init__(self, name, type, description): - super(AnyDrill, self).__init__(name, type, description) + super().__init__(name, type, description) # Options with document: self.use_aux_axis_as_origin = False diff --git a/kiplot/out_any_layer.py b/kiplot/out_any_layer.py index 7a0824f1..08362c2e 100644 --- a/kiplot/out_any_layer.py +++ b/kiplot/out_any_layer.py @@ -12,7 +12,7 @@ logger = log.get_logger(__name__) class AnyLayer(BaseOutput): """ Base class for: DXF, Gerber, HPGL, PDF, PS and SVG """ def __init__(self, name, type, description): - super(AnyLayer, self).__init__(name, type, description) + super().__init__(name, type, description) # We need layers, so we define it self._layers = None # Options diff --git a/kiplot/out_base.py b/kiplot/out_base.py index b7b1a3c6..e54ea97f 100644 --- a/kiplot/out_base.py +++ b/kiplot/out_base.py @@ -8,7 +8,7 @@ class BaseOutput(Optionable): _registered = {} def __init__(self, name, type, description): - super(BaseOutput, self).__init__(name, description) + super().__init__(name, description) self._type = type self._sch_related = False self._unkown_is_error = False @@ -16,7 +16,7 @@ class BaseOutput(Optionable): def config(self, outdir, options, layers): self._outdir = outdir self._layers = layers - super(BaseOutput, self).config(options) + super().config(options) @staticmethod def attr2longopt(attr): diff --git a/kiplot/out_excellon.py b/kiplot/out_excellon.py index 35f3a70e..2c33258e 100644 --- a/kiplot/out_excellon.py +++ b/kiplot/out_excellon.py @@ -10,7 +10,7 @@ class Excellon(AnyDrill): You can create a map file for documentation purposes. This output is what you get from the 'File/Fabrication output/Drill Files' menu in pcbnew. """ def __init__(self, name, type, description): - super(Excellon, self).__init__(name, type, description) + super().__init__(name, type, description) with document: self.metric_units = True """ use metric units instead of inches """ diff --git a/kiplot/out_gerb_drill.py b/kiplot/out_gerb_drill.py index 17c6c9b9..b323d8cd 100644 --- a/kiplot/out_gerb_drill.py +++ b/kiplot/out_gerb_drill.py @@ -10,7 +10,7 @@ class Gerb_Drill(AnyDrill): You can create a map file for documentation purposes. This output is what you get from the 'File/Fabrication output/Drill Files' menu in pcbnew. """ def __init__(self, name, type, description): - super(Gerb_Drill, self).__init__(name, type, description) + super().__init__(name, type, description) def _configure_writer(self, board, offset): drill_writer = GERBER_WRITER(board) diff --git a/kiplot/out_gerber.py b/kiplot/out_gerber.py index c93316b9..29ff9053 100644 --- a/kiplot/out_gerber.py +++ b/kiplot/out_gerber.py @@ -10,7 +10,7 @@ class Gerber(AnyLayer): This is the main fabrication format for the PCB. This output is what you get from the File/Plot menu in pcbnew. """ def __init__(self, name, type, description): - super(Gerber, self).__init__(name, type, description) + super().__init__(name, type, description) self._plot_format = PLOT_FORMAT_GERBER # Options with document: diff --git a/kiplot/out_hpgl.py b/kiplot/out_hpgl.py index cf8afb86..9857328b 100644 --- a/kiplot/out_hpgl.py +++ b/kiplot/out_hpgl.py @@ -11,8 +11,7 @@ class HPGL(AnyLayer, DrillMarks): Exports the PCB for plotters and laser printers. This output is what you get from the File/Plot menu in pcbnew. """ def __init__(self, name, type, description): - AnyLayer.__init__(self, name, type, description) - DrillMarks.__init__(self) + super().__init__(name, type, description) self._plot_format = PLOT_FORMAT_HPGL # Options with document: diff --git a/kiplot/out_ibom.py b/kiplot/out_ibom.py index 8e6eae77..715ce322 100644 --- a/kiplot/out_ibom.py +++ b/kiplot/out_ibom.py @@ -17,7 +17,7 @@ class IBoM(BaseOutput): # noqa: F821 For more information: https://github.com/INTI-CMNB/InteractiveHtmlBom This output is what you get from the InteractiveHtmlBom plug-in (pcbnew). """ def __init__(self, name, type, description): - super(IBoM, self).__init__(name, type, description) + super().__init__(name, type, description) self._sch_related = True # Options with document: diff --git a/kiplot/out_kibom.py b/kiplot/out_kibom.py index d30b6975..a015d3d6 100644 --- a/kiplot/out_kibom.py +++ b/kiplot/out_kibom.py @@ -17,7 +17,7 @@ class KiBoM(BaseOutput): # noqa: F821 For more information: https://github.com/INTI-CMNB/KiBoM This output is what you get from the 'Tools/Generate Bill of Materials' menu in eeschema. """ def __init__(self, name, type, description): - super(KiBoM, self).__init__(name, type, description) + super().__init__(name, type, description) self._sch_related = True # Options with document: diff --git a/kiplot/out_pdf.py b/kiplot/out_pdf.py index f6c90741..d4d7b161 100644 --- a/kiplot/out_pdf.py +++ b/kiplot/out_pdf.py @@ -2,6 +2,9 @@ from pcbnew import (PLOT_FORMAT_PDF, FromMM, ToMM) from kiplot.out_any_layer import AnyLayer from kiplot.drill_marks import DrillMarks from kiplot.macros import macros, document, output_class # noqa: F401 +from . import log + +logger = log.get_logger(__name__) @output_class @@ -11,8 +14,7 @@ class PDF(AnyLayer, DrillMarks): Note that this output isn't the best for documating your project. This output is what you get from the File/Plot menu in pcbnew. """ def __init__(self, name, type, description): - AnyLayer.__init__(self, name, type, description) - DrillMarks.__init__(self) + super().__init__(name, type, description) self._plot_format = PLOT_FORMAT_PDF # Options with document: diff --git a/kiplot/out_pdf_pcb_print.py b/kiplot/out_pdf_pcb_print.py index 2c409721..55906584 100644 --- a/kiplot/out_pdf_pcb_print.py +++ b/kiplot/out_pdf_pcb_print.py @@ -18,7 +18,7 @@ class PDF_Pcb_Print(BaseOutput): # noqa: F821 This is the main format to document your PCB. This output is what you get from the 'File/Print' menu in pcbnew. """ def __init__(self, name, type, description): - super(PDF_Pcb_Print, self).__init__(name, type, description) + super().__init__(name, type, description) # We need layers, so we define it self._layers = None # Options diff --git a/kiplot/out_pdf_sch_print.py b/kiplot/out_pdf_sch_print.py index 16d2c6d1..6796240a 100644 --- a/kiplot/out_pdf_sch_print.py +++ b/kiplot/out_pdf_sch_print.py @@ -16,7 +16,7 @@ class PDF_Sch_Print(BaseOutput): # noqa: F821 This is the main format to document your schematic. This output is what you get from the 'File/Print' menu in eeschema. """ def __init__(self, name, type, description): - super(PDF_Sch_Print, self).__init__(name, type, description) + super().__init__(name, type, description) self._sch_related = True # Options with document: diff --git a/kiplot/out_position.py b/kiplot/out_position.py index 33dad138..4964f319 100644 --- a/kiplot/out_position.py +++ b/kiplot/out_position.py @@ -11,7 +11,7 @@ class Position(BaseOutput): # noqa: F821 Generates the file with position information for the PCB components, used by the pick and place machine. This output is what you get from the 'File/Fabrication output/Footprint poistion (.pos) file' menu in pcbnew. """ def __init__(self, name, type, description): - super(Position, self).__init__(name, type, description) + super().__init__(name, type, description) # Options with document: self.format = 'ASCII' diff --git a/kiplot/out_ps.py b/kiplot/out_ps.py index 69ffa90f..3cf831e0 100644 --- a/kiplot/out_ps.py +++ b/kiplot/out_ps.py @@ -11,8 +11,7 @@ class PS(AnyLayer, DrillMarks): Exports the PCB to a format suitable for printing. This output is what you get from the File/Plot menu in pcbnew. """ def __init__(self, name, type, description): - AnyLayer.__init__(self, name, type, description) - DrillMarks.__init__(self) + super().__init__(name, type, description) self._plot_format = PLOT_FORMAT_POST # Options with document: diff --git a/kiplot/out_step.py b/kiplot/out_step.py index e85aeb6e..3026b60e 100644 --- a/kiplot/out_step.py +++ b/kiplot/out_step.py @@ -17,7 +17,7 @@ class STEP(BaseOutput): # noqa: F821 This is the most common 3D format for exchange purposes. This output is what you get from the 'File/Export/STEP' menu in pcbnew. """ def __init__(self, name, type, description): - super(STEP, self).__init__(name, type, description) + super().__init__(name, type, description) # Options with document: self.metric_units = True diff --git a/kiplot/out_svg.py b/kiplot/out_svg.py index 8c236841..306cfc49 100644 --- a/kiplot/out_svg.py +++ b/kiplot/out_svg.py @@ -11,8 +11,7 @@ class SVG(AnyLayer, DrillMarks): Unlike bitmaps SVG drawings can be scaled without losing resolution. This output is what you get from the File/Plot menu in pcbnew. """ def __init__(self, name, type, description): - AnyLayer.__init__(self, name, type, description) - DrillMarks.__init__(self) + super().__init__(name, type, description) self._plot_format = PLOT_FORMAT_SVG # Options with document: diff --git a/tests/yaml_samples/pdf.kiplot.yaml b/tests/yaml_samples/pdf.kiplot.yaml index 90272014..3e106534 100644 --- a/tests/yaml_samples/pdf.kiplot.yaml +++ b/tests/yaml_samples/pdf.kiplot.yaml @@ -9,7 +9,6 @@ outputs: options: exclude_edge_layer: false exclude_pads_from_silkscreen: false - use_aux_axis_as_origin: false plot_sheet_reference: false plot_footprint_refs: true plot_footprint_values: true