[PATCH 6 of 7 Massmailing cube] Flake8: fix errors

Nsukami Patrick ndkpatt at gmail.com
Wed Jun 12 18:57:51 CEST 2019


# HG changeset patch
# User Nsukami Patrick <ndkpatt at gmail dot com>
# Date 1560358429 0
#      Wed Jun 12 16:53:49 2019 +0000
# Node ID 641beca6bd5aa76341b716ffa2b658d994e220d9
# Parent  d03d7bbfa9a545213f263b59468087f3b144f644
Flake8: fix errors

* E128 continuation line under-indented for visual indent
* E128 continuation line under-indented for visual indent
* E128 continuation line under-indented for visual indent
* E128 continuation line under-indented for visual indent
* E125 continuation line with same indent as next logical line
* E501 line too long (108 > 100 characters)

diff --git a/cubicweb_massmailing/views.py b/cubicweb_massmailing/views.py
--- a/cubicweb_massmailing/views.py
+++ b/cubicweb_massmailing/views.py
@@ -106,7 +106,7 @@
         return sorted(reduce(operator.and_, attrs))
 
     def build_substitutions_help(self):
-        insertLink = u'<a href="javascript: cw.widgets.insertText(\'%%(%s)s\', \'emailarea\');">%%(%s)s</a>'
+        insertLink = u'<a href="javascript: cw.widgets.insertText(\'%%(%s)s\', \'emailarea\');">%%(%s)s</a>'  # noqa: E501
         substs = (u'<div class="substitution">%s</div>' % (insertLink % (subst, subst))
                   for subst in self.get_allowed_substitutions())
         helpmsg = self._cw._('You can use any of the following substitutions in your text')
diff --git a/test/unittest_massmailing.py b/test/unittest_massmailing.py
--- a/test/unittest_massmailing.py
+++ b/test/unittest_massmailing.py
@@ -45,9 +45,9 @@
             rset = req.execute('CWUser X')
             form = self.vreg['forms'].select('massmailing', req, rset)
             self.assertEqual(['creation_date', 'cwuri', 'eid', 'firstname',
-                          'last_login_time', 'login', 'modification_date',
-                          'surname'],
-                         form.get_allowed_substitutions())
+                              'last_login_time', 'login', 'modification_date',
+                              'surname'],
+                             form.get_allowed_substitutions())
 
     def test_view(self):
         with self.admin_access.web_request() as req:
@@ -71,8 +71,8 @@
             cnx.commit()
             rset = cnx.execute('CWUser X')
         with self.admin_access.web_request(subject='tôtô', sender=u'S. Thénô <stheno at dactylo.fr>',
-                               recipient=[str(eid) for eid, in rset],
-            mailbody='hôp %(firstname)s %(surname)s') as req:
+                                           recipient=[str(eid) for eid, in rset],
+                                           mailbody='hôp %(firstname)s %(surname)s') as req:
             ctrl = self.vreg['controllers'].select('sendmail', req)
             with self.assertRaises(Redirect) as cm:
                 ctrl.publish()


More information about the cubicweb-devel mailing list