You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by br...@apache.org on 2020/02/10 22:44:58 UTC

[allura] 27/41: [#8349] python-modernize -n -w --no-diffs -f tuple_params .

This is an automated email from the ASF dual-hosted git repository.

brondsem pushed a commit to branch db/8349
in repository https://gitbox.apache.org/repos/asf/allura.git

commit a50dd4e20b07f4b7d3994c6a7ae5b38641733c1a
Author: Dave Brondsema <da...@brondsema.net>
AuthorDate: Mon Feb 10 15:17:49 2020 -0500

    [#8349] python-modernize -n -w --no-diffs -f tuple_params .
---
 Allura/allura/lib/utils.py                             | 2 +-
 Allura/allura/lib/widgets/forms.py                     | 2 +-
 ForgeUserStats/forgeuserstats/controllers/userstats.py | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Allura/allura/lib/utils.py b/Allura/allura/lib/utils.py
index 5439482..7cf1526 100644
--- a/Allura/allura/lib/utils.py
+++ b/Allura/allura/lib/utils.py
@@ -193,7 +193,7 @@ def chunked_list(l, n):
 def chunked_iter(iterable, max_size):
     '''return iterable 'chunks' from the iterable of max size max_size'''
     eiter = enumerate(iterable)
-    keyfunc = lambda (i, x): i // max_size
+    keyfunc = lambda i_x: i_x[0] // max_size
     for _, chunk in groupby(eiter, keyfunc):
         yield (x for i, x in chunk)
 
diff --git a/Allura/allura/lib/widgets/forms.py b/Allura/allura/lib/widgets/forms.py
index 45d4a7d..0c911c0 100644
--- a/Allura/allura/lib/widgets/forms.py
+++ b/Allura/allura/lib/widgets/forms.py
@@ -263,7 +263,7 @@ class PersonalDataForm(ForgeForm):
                 options=[ew.Option(py_value=" ", label=" -- Unknown -- ", selected=False)] +
                         [ew.Option(py_value=c, label=n, selected=False)
                          for c, n in sorted(list(country_names.items()),
-                                            key=lambda (k, v): v)],
+                                            key=lambda k_v: k_v[1])],
                 attrs={'onchange': 'selectTimezone(this.value)'}),
             ew.TextField(
                 name='city',
diff --git a/ForgeUserStats/forgeuserstats/controllers/userstats.py b/ForgeUserStats/forgeuserstats/controllers/userstats.py
index aa4e199..36818ae 100644
--- a/ForgeUserStats/forgeuserstats/controllers/userstats.py
+++ b/ForgeUserStats/forgeuserstats/controllers/userstats.py
@@ -136,7 +136,7 @@ class ForgeUserStatsController(BaseController):
                 else:
                     categories[cat] = 1
         categories = sorted(list(categories.items()),
-                            key=lambda (x, y): y, reverse=True)
+                            key=lambda x_y: x_y[1], reverse=True)
 
         ret_dict['lastmonth_logins'] = stats.getLastMonthLogins()
         ret_dict['categories'] = categories