Avoid using ambiguous variable name "l"

Fixes the issue E741 reported by flake8 >= 3.8.
https://www.flake8rules.com/rules/E741.html
This commit is contained in:
Philipp Wolfer
2020-05-12 14:38:01 +02:00
parent 20332e8260
commit ee8b88cf2a
4 changed files with 9 additions and 9 deletions

View File

@@ -73,8 +73,8 @@ class CDLookupDialog(PicardDialog):
_("Labels"), _("Catalog #s"), _("Barcode")])
self.ui.submit_button.setIcon(QtGui.QIcon(":/images/cdrom.png"))
if self.releases:
def myjoin(l):
return "\n".join(l)
def myjoin(values):
return "\n".join(values)
self.ui.results_view.setCurrentIndex(0)
selected = None

View File

@@ -153,7 +153,7 @@ class InterfaceOptionsPage(OptionsPage):
self.ui = Ui_InterfaceOptionsPage()
self.ui.setupUi(self)
self.ui.ui_language.addItem(_('System default'), '')
language_list = [(l[0], l[1], _(l[2])) for l in UI_LANGUAGES]
language_list = [(lang[0], lang[1], _(lang[2])) for lang in UI_LANGUAGES]
def fcmp(x):
return locale.strxfrm(x[2])

View File

@@ -155,8 +155,8 @@ def shorten_path(path, length, mode):
length: Maximum number of code points / bytes allowed in a node.
mode: One of SHORTEN_BYTES, SHORTEN_UTF16, SHORTEN_UTF16_NFD.
"""
def shorten(n, l):
return n and shorten_filename(n, l, mode).strip() or ""
def shorten(name, length):
return name and shorten_filename(name, length, mode).strip() or ""
dirpath, filename = os.path.split(path)
fileroot, ext = os.path.splitext(filename)
return os.path.join(
@@ -203,8 +203,8 @@ def _make_win_short_filename(relpath, reserved=0):
remaining = MAX_DIRPATH_LEN - reserved
# to make things more readable...
def shorten(p, l):
return shorten_path(p, l, mode=SHORTEN_UTF16)
def shorten(path, length):
return shorten_path(path, length, mode=SHORTEN_UTF16)
xlength = _get_utf16_length
# shorten to MAX_NODE_LEN from the beginning

View File

@@ -106,13 +106,13 @@ class Testbytes2human(PicardTestCase):
@staticmethod
def _save_expected_to(path, a_list):
with open(path, 'wb') as f:
f.writelines([l + "\n" for l in a_list])
f.writelines([line + "\n" for line in a_list])
f.close()
@staticmethod
def _read_expected_from(path):
with open(path, 'r') as f:
lines = [l.rstrip("\n") for l in f.readlines()]
lines = [line.rstrip("\n") for line in f.readlines()]
f.close()
return lines