diff --git a/kibot/fil_subparts.py b/kibot/fil_subparts.py index 66363055a..8232cab82 100644 --- a/kibot/fil_subparts.py +++ b/kibot/fil_subparts.py @@ -99,10 +99,10 @@ def manf_code_qtypart(self, value): # Search for numbers, matching with simple, frac and decimal ones. string0_test = re.match(self._num_format, strings[0]) string1_test = re.match(self._num_format, strings[1]) - if string0_test and not(string1_test): + if string0_test and not string1_test: qty = strings[0].strip() part = strings[1].strip() - elif not(string0_test) and string1_test: + elif not string0_test and string1_test: qty = strings[1].strip() part = strings[0].strip() elif string0_test and string1_test: diff --git a/kibot/kicad/v5_sch.py b/kibot/kicad/v5_sch.py index 7f6c2e3f3..ac8cf709f 100644 --- a/kibot/kicad/v5_sch.py +++ b/kibot/kicad/v5_sch.py @@ -769,7 +769,7 @@ def visible(self, v): self.flags = "%04x" % ((int(self.flags) & 0xFFFE) | v) def is_visible(self): - return not(int(self.flags, 16) and 1) + return not (int(self.flags, 16) and 1) def get_height(self): """ Font height in mm """ diff --git a/kibot/kicad/v6_sch.py b/kibot/kicad/v6_sch.py index e1e5221f1..c7b4fad6d 100644 --- a/kibot/kicad/v6_sch.py +++ b/kibot/kicad/v6_sch.py @@ -1180,7 +1180,7 @@ def load(c, project, parent): def write(self, exp_hierarchy, cross): lib_id = self.lib_id - is_crossed = not(self.fitted or not self.included) + is_crossed = not (self.fitted or not self.included) native_cross = GS.ki7 and GS.global_cross_using_kicad dnp = False if native_cross else self.kicad_dnp if cross and (self.lib or self.local_name) and is_crossed: diff --git a/kibot/kiplot.py b/kibot/kiplot.py index f722e2985..ea08e37fa 100644 --- a/kibot/kiplot.py +++ b/kibot/kiplot.py @@ -951,7 +951,7 @@ def generate_one_example(dest_dir, types): if types and n not in types: logger.debug('- {}, not selected (PCB: {} SCH: {})'.format(n, o.is_pcb(), o.is_sch())) continue - if ((not(o.is_pcb() and GS.pcb_file) and not(o.is_sch() and GS.sch_file)) or + if ((not (o.is_pcb() and GS.pcb_file) and not (o.is_sch() and GS.sch_file)) or ((o.is_pcb() and o.is_sch()) and (not GS.pcb_file or not GS.sch_file))): logger.debug('- {}, skipped (PCB: {} SCH: {})'.format(n, o.is_pcb(), o.is_sch())) continue diff --git a/kibot/out_base.py b/kibot/out_base.py index 0e1ccf6a3..ab70ce672 100644 --- a/kibot/out_base.py +++ b/kibot/out_base.py @@ -108,7 +108,7 @@ def is_sch(self): def is_pcb(self): """ True for outputs that works on the PCB """ - return (not(self._sch_related) and not(self._none_related)) or self._both_related + return (not self._sch_related and not self._none_related) or self._both_related def get_targets(self, out_dir): """ Returns a list of targets generated by this output """ diff --git a/kibot/out_bom.py b/kibot/out_bom.py index 104660b45..75a7a12e4 100644 --- a/kibot/out_bom.py +++ b/kibot/out_bom.py @@ -326,8 +326,8 @@ def __init__(self): """ *Enable Specs worksheet creation. Contains specifications for the components. Works with only some KiCost APIs """ self.specs_columns = BoMColumns - """ [list(dict)|list(string)] Which columns are included in the Specs worksheet. Use `References` for the references, - 'Row' for the order and 'Sep' to separate groups at the same level. By default all are included. + """ [list(dict)|list(string)] Which columns are included in the Specs worksheet. Use `References` for the + references, 'Row' for the order and 'Sep' to separate groups at the same level. By default all are included. Column names are distributor specific, the following aren't: '_desc', '_value', '_tolerance', '_footprint', '_power', '_current', '_voltage', '_frequency', '_temp_coeff', '_manf', '_size' """ self.logo_scale = 2 diff --git a/kibot/out_gerber.py b/kibot/out_gerber.py index 30578529d..f79873153 100644 --- a/kibot/out_gerber.py +++ b/kibot/out_gerber.py @@ -46,8 +46,8 @@ def __init__(self): """ Disable aperture macros (workaround for buggy CAM software) (KiCad 6) """ super().__init__() # Gerbers are always 1:1 - del(self.scaling) - del(self.individual_page_scaling) + del self.scaling + del self.individual_page_scaling self._plot_format = PLOT_FORMAT_GERBER if GS.global_output is not None: self.gerber_job_file = GS.global_output diff --git a/kibot/out_panelize.py b/kibot/out_panelize.py index 01f1325d4..57ea59542 100644 --- a/kibot/out_panelize.py +++ b/kibot/out_panelize.py @@ -174,8 +174,8 @@ def __init__(self): self.spacing = 10 """ [number|string] The maximum spacing of the tabs. Used for *spacing* """ self.cutout = 1 - """ [number|string] When your design features open pockets on the side, this parameter specifies extra cutout depth in order to - ensure that a sharp corner of the pocket can be milled. Used for *full* """ + """ [number|string] When your design features open pockets on the side, this parameter specifies extra cutout + depth in order to ensure that a sharp corner of the pocket can be milled. Used for *full* """ self.tabfootprints = 'kikit:Tab' """ The footprint/s used for the *annotation* type. You can specify a list of footprints separated by comma """ self.tab_footprints = None diff --git a/tests/test_plot/test_position.py b/tests/test_plot/test_position.py index 201858985..3ee2711e8 100644 --- a/tests/test_plot/test_position.py +++ b/tests/test_plot/test_position.py @@ -52,10 +52,10 @@ def expect_position(ctx, file, comp, no_comp=(), inches=False, csv=False, neg_x= if neg_x: x = -x matches = res.pop(0) - assert(abs(float(x) - float(matches[0])) < 0.001), k - assert(abs(float(y) + float(matches[1])) < 0.001), k - assert(angle == float(matches[2]) % 360), k - assert(side == matches[3]), k + assert abs(float(x) - float(matches[0])) < 0.001, k + assert abs(float(y) + float(matches[1])) < 0.001, k + assert angle == float(matches[2]) % 360, k + assert side == matches[3], k # Components that must not be found texts = []