[Flake8] Small changes suggested by flake8 5.0.4

This commit is contained in:
Salvador E. Tropea 2023-08-11 13:33:54 -03:00
parent 6f3dd0cabc
commit 49973b49cb
9 changed files with 16 additions and 16 deletions

View File

@ -99,10 +99,10 @@ class Subparts(BaseFilter): # noqa: F821
# 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:

View File

@ -769,7 +769,7 @@ class SchematicField(object):
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 """

View File

@ -1180,7 +1180,7 @@ class SchematicComponentV6(SchematicComponent):
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:

View File

@ -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

View File

@ -108,7 +108,7 @@ class BaseOutput(RegOutput):
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 """

View File

@ -326,8 +326,8 @@ class BoMXLSX(BoMLinkable):
""" *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

View File

@ -46,8 +46,8 @@ class GerberOptions(AnyLayerOptions):
""" 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

View File

@ -174,8 +174,8 @@ class PanelizeTabs(PanelOptionsWithPlugin):
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

View File

@ -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 = []