Skip to content

Commit

Permalink
[Flake8] Small changes suggested by flake8 5.0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
set-soft committed Aug 11, 2023
1 parent 6f3dd0c commit 49973b4
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions kibot/fil_subparts.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion kibot/kicad/v5_sch.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 """
Expand Down
2 changes: 1 addition & 1 deletion kibot/kicad/v6_sch.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion kibot/kiplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion kibot/out_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 """
Expand Down
4 changes: 2 additions & 2 deletions kibot/out_bom.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions kibot/out_gerber.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions kibot/out_panelize.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions tests/test_plot/test_position.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = []
Expand Down

0 comments on commit 49973b4

Please sign in to comment.