Fixed B007 Loop control variable 'i' not used within the loop body.
This commit is contained in:
parent
0ab3fb410c
commit
338a0cc3d4
|
|
@ -100,7 +100,7 @@ def write_csv(filename, ext, groups, headings, head_names, cfg):
|
||||||
# PCB info
|
# PCB info
|
||||||
if not (cfg.csv.hide_pcb_info and cfg.csv.hide_stats_info):
|
if not (cfg.csv.hide_pcb_info and cfg.csv.hide_stats_info):
|
||||||
# Add some blank rows
|
# Add some blank rows
|
||||||
for i in range(5):
|
for _ in range(5):
|
||||||
writer.writerow([])
|
writer.writerow([])
|
||||||
# The info
|
# The info
|
||||||
write_stats(writer, cfg)
|
write_stats(writer, cfg)
|
||||||
|
|
|
||||||
|
|
@ -192,7 +192,7 @@ def create_col_fmt(col_fields, col_colors, fmt_cols):
|
||||||
for c in col_fields:
|
for c in col_fields:
|
||||||
col_fmt.append(fmt_cols[bg_color(c)])
|
col_fmt.append(fmt_cols[bg_color(c)])
|
||||||
else:
|
else:
|
||||||
for c in col_fields:
|
for _ in col_fields:
|
||||||
col_fmt.append(fmt_cols[0])
|
col_fmt.append(fmt_cols[0])
|
||||||
# Empty color
|
# Empty color
|
||||||
col_fmt.append(fmt_cols[-1])
|
col_fmt.append(fmt_cols[-1])
|
||||||
|
|
|
||||||
|
|
@ -574,7 +574,7 @@ def print_example_options(f, cls, name, indent, po, is_list=False):
|
||||||
first = True
|
first = True
|
||||||
if po:
|
if po:
|
||||||
obj.read_vals_from_po(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)
|
help, alias, is_alias = obj.get_doc(k)
|
||||||
if is_alias:
|
if is_alias:
|
||||||
f.write(ind_str+'# `{}` is an alias for `{}`\n'.format(k, alias))
|
f.write(ind_str+'# `{}` is an alias for `{}`\n'.format(k, alias))
|
||||||
|
|
|
||||||
|
|
@ -1375,7 +1375,7 @@ class SheetInstance(object):
|
||||||
def parse(items):
|
def parse(items):
|
||||||
name = 'sheet instance'
|
name = 'sheet instance'
|
||||||
instances = []
|
instances = []
|
||||||
for c, i in enumerate(items[1:]):
|
for c, _ in enumerate(items[1:]):
|
||||||
v = _check_symbol_value(items, c+1, name, 'path')
|
v = _check_symbol_value(items, c+1, name, 'path')
|
||||||
instance = SheetInstance()
|
instance = SheetInstance()
|
||||||
instance.path = _check_str(v, 1, name+' path')
|
instance.path = _check_str(v, 1, name+' path')
|
||||||
|
|
@ -1392,7 +1392,7 @@ class SymbolInstance(object):
|
||||||
def parse(items):
|
def parse(items):
|
||||||
name = 'symbol instance'
|
name = 'symbol instance'
|
||||||
instances = []
|
instances = []
|
||||||
for c, i in enumerate(items[1:]):
|
for c, _ in enumerate(items[1:]):
|
||||||
v = _check_symbol_value(items, c+1, name, 'path')
|
v = _check_symbol_value(items, c+1, name, 'path')
|
||||||
instance = SymbolInstance()
|
instance = SymbolInstance()
|
||||||
instance.path = _check_str(v, 1, name+' path')
|
instance.path = _check_str(v, 1, name+' path')
|
||||||
|
|
@ -1429,7 +1429,7 @@ class PCBLayer(object):
|
||||||
name = 'PCB stackup layer'
|
name = 'PCB stackup layer'
|
||||||
layer = PCBLayer()
|
layer = PCBLayer()
|
||||||
layer.name = _check_str(items, 1, name)
|
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)
|
i_type = _check_is_symbol_list(i)
|
||||||
tname = name+' '+i_type
|
tname = name+' '+i_type
|
||||||
if i_type == 'type':
|
if i_type == 'type':
|
||||||
|
|
|
||||||
|
|
@ -229,7 +229,7 @@ class Layer(Optionable):
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _get_layers(d_layers):
|
def _get_layers(d_layers):
|
||||||
layers = []
|
layers = []
|
||||||
for n, id in d_layers.items():
|
for n in d_layers.keys():
|
||||||
layers.append(Layer.create_layer(n))
|
layers.append(Layer.create_layer(n))
|
||||||
return layers
|
return layers
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -175,11 +175,11 @@ def test_sch_replace_1(test_dir):
|
||||||
files[file] = file + '-bak'
|
files[file] = file + '-bak'
|
||||||
file = ctx.sch_file.replace('test_v5', 'sub-sheet')
|
file = ctx.sch_file.replace('test_v5', 'sub-sheet')
|
||||||
files[file] = file + '-bak'
|
files[file] = file + '-bak'
|
||||||
for k, v in files.items():
|
for v in files.values():
|
||||||
assert os.path.isfile(v), v
|
assert os.path.isfile(v), v
|
||||||
assert os.path.getsize(v) > 0
|
assert os.path.getsize(v) > 0
|
||||||
try:
|
try:
|
||||||
for k, v in files.items():
|
for k in files.keys():
|
||||||
logging.debug(k)
|
logging.debug(k)
|
||||||
cmd = ['/bin/bash', '-c', "date -d @`git log -1 --format='%at' -- " + k + "` +%Y-%m-%d_%H-%M-%S"]
|
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()
|
text = run(cmd, stdout=PIPE, stderr=PIPE, universal_newlines=True).stdout.strip()
|
||||||
|
|
|
||||||
|
|
@ -56,7 +56,7 @@ def _compress(uncompressed, bitsPerChar, getCharFromInt): # noqa: C901
|
||||||
else:
|
else:
|
||||||
if context_w in context_dictionaryToCreate:
|
if context_w in context_dictionaryToCreate:
|
||||||
if ord(context_w[0]) < 256:
|
if ord(context_w[0]) < 256:
|
||||||
for i in range(context_numBits):
|
for _ in range(context_numBits):
|
||||||
context_data_val = (context_data_val << 1)
|
context_data_val = (context_data_val << 1)
|
||||||
if context_data_position == bitsPerChar-1:
|
if context_data_position == bitsPerChar-1:
|
||||||
context_data_position = 0
|
context_data_position = 0
|
||||||
|
|
@ -65,7 +65,7 @@ def _compress(uncompressed, bitsPerChar, getCharFromInt): # noqa: C901
|
||||||
else:
|
else:
|
||||||
context_data_position += 1
|
context_data_position += 1
|
||||||
value = ord(context_w[0])
|
value = ord(context_w[0])
|
||||||
for i in range(8):
|
for _ in range(8):
|
||||||
context_data_val = (context_data_val << 1) | (value & 1)
|
context_data_val = (context_data_val << 1) | (value & 1)
|
||||||
if context_data_position == bitsPerChar - 1:
|
if context_data_position == bitsPerChar - 1:
|
||||||
context_data_position = 0
|
context_data_position = 0
|
||||||
|
|
@ -77,7 +77,7 @@ def _compress(uncompressed, bitsPerChar, getCharFromInt): # noqa: C901
|
||||||
|
|
||||||
else:
|
else:
|
||||||
value = 1
|
value = 1
|
||||||
for i in range(context_numBits):
|
for _ in range(context_numBits):
|
||||||
context_data_val = (context_data_val << 1) | value
|
context_data_val = (context_data_val << 1) | value
|
||||||
if context_data_position == bitsPerChar - 1:
|
if context_data_position == bitsPerChar - 1:
|
||||||
context_data_position = 0
|
context_data_position = 0
|
||||||
|
|
@ -87,7 +87,7 @@ def _compress(uncompressed, bitsPerChar, getCharFromInt): # noqa: C901
|
||||||
context_data_position += 1
|
context_data_position += 1
|
||||||
value = 0
|
value = 0
|
||||||
value = ord(context_w[0])
|
value = ord(context_w[0])
|
||||||
for i in range(16):
|
for _ in range(16):
|
||||||
context_data_val = (context_data_val << 1) | (value & 1)
|
context_data_val = (context_data_val << 1) | (value & 1)
|
||||||
if context_data_position == bitsPerChar - 1:
|
if context_data_position == bitsPerChar - 1:
|
||||||
context_data_position = 0
|
context_data_position = 0
|
||||||
|
|
@ -103,7 +103,7 @@ def _compress(uncompressed, bitsPerChar, getCharFromInt): # noqa: C901
|
||||||
del context_dictionaryToCreate[context_w]
|
del context_dictionaryToCreate[context_w]
|
||||||
else:
|
else:
|
||||||
value = context_dictionary[context_w]
|
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)
|
context_data_val = (context_data_val << 1) | (value & 1)
|
||||||
if context_data_position == bitsPerChar - 1:
|
if context_data_position == bitsPerChar - 1:
|
||||||
context_data_position = 0
|
context_data_position = 0
|
||||||
|
|
@ -127,7 +127,7 @@ def _compress(uncompressed, bitsPerChar, getCharFromInt): # noqa: C901
|
||||||
if context_w != "":
|
if context_w != "":
|
||||||
if context_w in context_dictionaryToCreate:
|
if context_w in context_dictionaryToCreate:
|
||||||
if ord(context_w[0]) < 256:
|
if ord(context_w[0]) < 256:
|
||||||
for i in range(context_numBits):
|
for _ in range(context_numBits):
|
||||||
context_data_val = (context_data_val << 1)
|
context_data_val = (context_data_val << 1)
|
||||||
if context_data_position == bitsPerChar-1:
|
if context_data_position == bitsPerChar-1:
|
||||||
context_data_position = 0
|
context_data_position = 0
|
||||||
|
|
@ -136,7 +136,7 @@ def _compress(uncompressed, bitsPerChar, getCharFromInt): # noqa: C901
|
||||||
else:
|
else:
|
||||||
context_data_position += 1
|
context_data_position += 1
|
||||||
value = ord(context_w[0])
|
value = ord(context_w[0])
|
||||||
for i in range(8):
|
for _ in range(8):
|
||||||
context_data_val = (context_data_val << 1) | (value & 1)
|
context_data_val = (context_data_val << 1) | (value & 1)
|
||||||
if context_data_position == bitsPerChar - 1:
|
if context_data_position == bitsPerChar - 1:
|
||||||
context_data_position = 0
|
context_data_position = 0
|
||||||
|
|
@ -147,7 +147,7 @@ def _compress(uncompressed, bitsPerChar, getCharFromInt): # noqa: C901
|
||||||
value = value >> 1
|
value = value >> 1
|
||||||
else:
|
else:
|
||||||
value = 1
|
value = 1
|
||||||
for i in range(context_numBits):
|
for _ in range(context_numBits):
|
||||||
context_data_val = (context_data_val << 1) | value
|
context_data_val = (context_data_val << 1) | value
|
||||||
if context_data_position == bitsPerChar - 1:
|
if context_data_position == bitsPerChar - 1:
|
||||||
context_data_position = 0
|
context_data_position = 0
|
||||||
|
|
@ -157,7 +157,7 @@ def _compress(uncompressed, bitsPerChar, getCharFromInt): # noqa: C901
|
||||||
context_data_position += 1
|
context_data_position += 1
|
||||||
value = 0
|
value = 0
|
||||||
value = ord(context_w[0])
|
value = ord(context_w[0])
|
||||||
for i in range(16):
|
for _ in range(16):
|
||||||
context_data_val = (context_data_val << 1) | (value & 1)
|
context_data_val = (context_data_val << 1) | (value & 1)
|
||||||
if context_data_position == bitsPerChar - 1:
|
if context_data_position == bitsPerChar - 1:
|
||||||
context_data_position = 0
|
context_data_position = 0
|
||||||
|
|
@ -173,7 +173,7 @@ def _compress(uncompressed, bitsPerChar, getCharFromInt): # noqa: C901
|
||||||
del context_dictionaryToCreate[context_w]
|
del context_dictionaryToCreate[context_w]
|
||||||
else:
|
else:
|
||||||
value = context_dictionary[context_w]
|
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)
|
context_data_val = (context_data_val << 1) | (value & 1)
|
||||||
if context_data_position == bitsPerChar - 1:
|
if context_data_position == bitsPerChar - 1:
|
||||||
context_data_position = 0
|
context_data_position = 0
|
||||||
|
|
@ -190,7 +190,7 @@ def _compress(uncompressed, bitsPerChar, getCharFromInt): # noqa: C901
|
||||||
|
|
||||||
# Mark the end of the stream
|
# Mark the end of the stream
|
||||||
value = 2
|
value = 2
|
||||||
for i in range(context_numBits):
|
for _ in range(context_numBits):
|
||||||
context_data_val = (context_data_val << 1) | (value & 1)
|
context_data_val = (context_data_val << 1) | (value & 1)
|
||||||
if context_data_position == bitsPerChar - 1:
|
if context_data_position == bitsPerChar - 1:
|
||||||
context_data_position = 0
|
context_data_position = 0
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue