Fixed B007 Loop control variable 'i' not used within the loop body.

This commit is contained in:
Salvador E. Tropea 2022-02-17 19:10:47 -03:00
parent 0ab3fb410c
commit 338a0cc3d4
7 changed files with 20 additions and 20 deletions

View File

@ -100,7 +100,7 @@ def write_csv(filename, ext, groups, headings, head_names, cfg):
# PCB info
if not (cfg.csv.hide_pcb_info and cfg.csv.hide_stats_info):
# Add some blank rows
for i in range(5):
for _ in range(5):
writer.writerow([])
# The info
write_stats(writer, cfg)

View File

@ -192,7 +192,7 @@ def create_col_fmt(col_fields, col_colors, fmt_cols):
for c in col_fields:
col_fmt.append(fmt_cols[bg_color(c)])
else:
for c in col_fields:
for _ in col_fields:
col_fmt.append(fmt_cols[0])
# Empty color
col_fmt.append(fmt_cols[-1])

View File

@ -574,7 +574,7 @@ def print_example_options(f, cls, name, indent, po, is_list=False):
first = True
if po:
obj.read_vals_from_po(po)
for k, v in obj.get_attrs_gen():
for k, _ in obj.get_attrs_gen():
help, alias, is_alias = obj.get_doc(k)
if is_alias:
f.write(ind_str+'# `{}` is an alias for `{}`\n'.format(k, alias))

View File

@ -1375,7 +1375,7 @@ class SheetInstance(object):
def parse(items):
name = 'sheet instance'
instances = []
for c, i in enumerate(items[1:]):
for c, _ in enumerate(items[1:]):
v = _check_symbol_value(items, c+1, name, 'path')
instance = SheetInstance()
instance.path = _check_str(v, 1, name+' path')
@ -1392,7 +1392,7 @@ class SymbolInstance(object):
def parse(items):
name = 'symbol instance'
instances = []
for c, i in enumerate(items[1:]):
for c, _ in enumerate(items[1:]):
v = _check_symbol_value(items, c+1, name, 'path')
instance = SymbolInstance()
instance.path = _check_str(v, 1, name+' path')
@ -1429,7 +1429,7 @@ class PCBLayer(object):
name = 'PCB stackup layer'
layer = PCBLayer()
layer.name = _check_str(items, 1, name)
for c, i in enumerate(items[2:]):
for i in items[2:]:
i_type = _check_is_symbol_list(i)
tname = name+' '+i_type
if i_type == 'type':

View File

@ -229,7 +229,7 @@ class Layer(Optionable):
@staticmethod
def _get_layers(d_layers):
layers = []
for n, id in d_layers.items():
for n in d_layers.keys():
layers.append(Layer.create_layer(n))
return layers

View File

@ -175,11 +175,11 @@ def test_sch_replace_1(test_dir):
files[file] = file + '-bak'
file = ctx.sch_file.replace('test_v5', 'sub-sheet')
files[file] = file + '-bak'
for k, v in files.items():
for v in files.values():
assert os.path.isfile(v), v
assert os.path.getsize(v) > 0
try:
for k, v in files.items():
for k in files.keys():
logging.debug(k)
cmd = ['/bin/bash', '-c', "date -d @`git log -1 --format='%at' -- " + k + "` +%Y-%m-%d_%H-%M-%S"]
text = run(cmd, stdout=PIPE, stderr=PIPE, universal_newlines=True).stdout.strip()

View File

@ -56,7 +56,7 @@ def _compress(uncompressed, bitsPerChar, getCharFromInt): # noqa: C901
else:
if context_w in context_dictionaryToCreate:
if ord(context_w[0]) < 256:
for i in range(context_numBits):
for _ in range(context_numBits):
context_data_val = (context_data_val << 1)
if context_data_position == bitsPerChar-1:
context_data_position = 0
@ -65,7 +65,7 @@ def _compress(uncompressed, bitsPerChar, getCharFromInt): # noqa: C901
else:
context_data_position += 1
value = ord(context_w[0])
for i in range(8):
for _ in range(8):
context_data_val = (context_data_val << 1) | (value & 1)
if context_data_position == bitsPerChar - 1:
context_data_position = 0
@ -77,7 +77,7 @@ def _compress(uncompressed, bitsPerChar, getCharFromInt): # noqa: C901
else:
value = 1
for i in range(context_numBits):
for _ in range(context_numBits):
context_data_val = (context_data_val << 1) | value
if context_data_position == bitsPerChar - 1:
context_data_position = 0
@ -87,7 +87,7 @@ def _compress(uncompressed, bitsPerChar, getCharFromInt): # noqa: C901
context_data_position += 1
value = 0
value = ord(context_w[0])
for i in range(16):
for _ in range(16):
context_data_val = (context_data_val << 1) | (value & 1)
if context_data_position == bitsPerChar - 1:
context_data_position = 0
@ -103,7 +103,7 @@ def _compress(uncompressed, bitsPerChar, getCharFromInt): # noqa: C901
del context_dictionaryToCreate[context_w]
else:
value = context_dictionary[context_w]
for i in range(context_numBits):
for _ in range(context_numBits):
context_data_val = (context_data_val << 1) | (value & 1)
if context_data_position == bitsPerChar - 1:
context_data_position = 0
@ -127,7 +127,7 @@ def _compress(uncompressed, bitsPerChar, getCharFromInt): # noqa: C901
if context_w != "":
if context_w in context_dictionaryToCreate:
if ord(context_w[0]) < 256:
for i in range(context_numBits):
for _ in range(context_numBits):
context_data_val = (context_data_val << 1)
if context_data_position == bitsPerChar-1:
context_data_position = 0
@ -136,7 +136,7 @@ def _compress(uncompressed, bitsPerChar, getCharFromInt): # noqa: C901
else:
context_data_position += 1
value = ord(context_w[0])
for i in range(8):
for _ in range(8):
context_data_val = (context_data_val << 1) | (value & 1)
if context_data_position == bitsPerChar - 1:
context_data_position = 0
@ -147,7 +147,7 @@ def _compress(uncompressed, bitsPerChar, getCharFromInt): # noqa: C901
value = value >> 1
else:
value = 1
for i in range(context_numBits):
for _ in range(context_numBits):
context_data_val = (context_data_val << 1) | value
if context_data_position == bitsPerChar - 1:
context_data_position = 0
@ -157,7 +157,7 @@ def _compress(uncompressed, bitsPerChar, getCharFromInt): # noqa: C901
context_data_position += 1
value = 0
value = ord(context_w[0])
for i in range(16):
for _ in range(16):
context_data_val = (context_data_val << 1) | (value & 1)
if context_data_position == bitsPerChar - 1:
context_data_position = 0
@ -173,7 +173,7 @@ def _compress(uncompressed, bitsPerChar, getCharFromInt): # noqa: C901
del context_dictionaryToCreate[context_w]
else:
value = context_dictionary[context_w]
for i in range(context_numBits):
for _ in range(context_numBits):
context_data_val = (context_data_val << 1) | (value & 1)
if context_data_position == bitsPerChar - 1:
context_data_position = 0
@ -190,7 +190,7 @@ def _compress(uncompressed, bitsPerChar, getCharFromInt): # noqa: C901
# Mark the end of the stream
value = 2
for i in range(context_numBits):
for _ in range(context_numBits):
context_data_val = (context_data_val << 1) | (value & 1)
if context_data_position == bitsPerChar - 1:
context_data_position = 0