From 6d1105da81f570c5030578c92a96d0651bb15a0f Mon Sep 17 00:00:00 2001 From: Baizley Date: Sat, 1 Feb 2020 00:28:59 +0100 Subject: [PATCH] Correct enumerations unpacking. --- gramps/gen/filters/rules/_rule.py | 8 ++++---- gramps/gen/lib/test/date_test.py | 6 +++--- gramps/gen/plug/report/_book.py | 2 +- gramps/gen/plug/report/_options.py | 4 ++-- gramps/gui/editors/displaytabs/surnametab.py | 4 ++-- gramps/gui/selectors/baseselector.py | 6 +++--- gramps/gui/views/listview.py | 2 +- gramps/gui/widgets/fanchart.py | 16 ++++++++-------- gramps/gui/widgets/grampletpane.py | 2 +- gramps/plugins/docgen/cairodoc.py | 2 +- 10 files changed, 26 insertions(+), 26 deletions(-) diff --git a/gramps/gen/filters/rules/_rule.py b/gramps/gen/filters/rules/_rule.py index 42e8371c9..59f71011d 100644 --- a/gramps/gen/filters/rules/_rule.py +++ b/gramps/gen/filters/rules/_rule.py @@ -81,12 +81,12 @@ class Rule: if self.nrprepare == 0: if self.use_regex: self.regex = [None]*len(self.labels) - for i in enumerate(self.labels): - if self.list[i]: + for index, label in enumerate(self.labels): + if self.list[index]: try: - self.regex[i] = re.compile(self.list[i], re.I) + self.regex[index] = re.compile(self.list[index], re.I) except re.error: - self.regex[i] = re.compile('') + self.regex[index] = re.compile('') self.match_substring = self.match_regex self.prepare(db, user) self.nrprepare += 1 diff --git a/gramps/gen/lib/test/date_test.py b/gramps/gen/lib/test/date_test.py index 7d101be75..8b21454db 100644 --- a/gramps/gen/lib/test/date_test.py +++ b/gramps/gen/lib/test/date_test.py @@ -235,8 +235,8 @@ class ParserDateTest(BaseDateTest): Date displayer and parser tests. """ def do_case(self, testset): - for date_format in enumerate(get_date_formats()): - set_format(date_format) + for index, date_format in enumerate(get_date_formats()): + set_format(index) for dateval in date_tests[testset]: datestr = _dd.display(dateval) @@ -245,7 +245,7 @@ class ParserDateTest(BaseDateTest): "dateval fails is_equal in format %d:\n" " '%s' != '%s'\n" " '%s' != '%s'\n" % - (date_format, dateval, ndate, + (index, dateval, ndate, dateval.__dict__, ndate.__dict__)) def test_basic(self): diff --git a/gramps/gen/plug/report/_book.py b/gramps/gen/plug/report/_book.py index b8711b8d4..24d560e62 100644 --- a/gramps/gen/plug/report/_book.py +++ b/gramps/gen/plug/report/_book.py @@ -556,7 +556,7 @@ class BookList: b_f.write(' ' '\n' % (size[0], size[1])) if book.get_margins(): - for pos in enumerate(book.get_margins()): + for pos, margin in enumerate(book.get_margins()): b_f.write(' \n' % ( pos, book.get_margin(pos))) diff --git a/gramps/gen/plug/report/_options.py b/gramps/gen/plug/report/_options.py index 2e8869a64..d29ccb4c9 100644 --- a/gramps/gen/plug/report/_options.py +++ b/gramps/gen/plug/report/_options.py @@ -497,9 +497,9 @@ class OptionListCollection(_options.OptionListCollection): % (size[0], size[1])) if option_list.get_margins(): margins = option_list.get_margins() - for pos in enumerate(margins): + for pos, margin in enumerate(margins): file.write(' \n' - % (pos, margins[pos])) + % (pos, margin)) if option_list.get_style_name(): file.write('