Abhilash Raj pushed to branch master at GNU Mailman / Mailman Core
Commits:
d6f22b0c by Abhilash Raj at 2020-05-12T14:19:33-07:00
Make pep8 happy.
- - - - -
491c1c64 by Abhilash Raj at 2020-05-12T21:46:12+00:00
Merge branch 'fix-pep8' into 'master'
Make pep8 happy.
See merge request mailman/mailman!638
- - - - -
6 changed files:
- src/mailman/chains/tests/test_headers.py
- src/mailman/database/alembic/versions/d151c0b8d6f7_bounce_parameters.py
- src/mailman/handlers/cook_headers.py
- src/mailman/model/member.py
- src/mailman/rest/tests/test_systemconf.py
- src/mailman/rules/moderation.py
Changes:
=====================================
src/mailman/chains/tests/test_headers.py
=====================================
@@ -367,8 +367,8 @@ A message body.
links_2 = get_links()
# The link rules both have the same name...
self.assertEqual(
- [l.rule.name for l in links_1],
- [l.rule.name for l in links_2],
+ [link.rule.name for link in links_1],
+ [link.rule.name for link in links_2],
)
# ...and are actually the identical objects.
for link1, link2 in zip(links_1, links_2):
=====================================
src/mailman/database/alembic/versions/d151c0b8d6f7_bounce_parameters.py
=====================================
@@ -19,7 +19,7 @@ down_revision = '83339e4039da'
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
- for table, col, col_type, nullable in(
+ for table, col, col_type, nullable in (
('member', 'bounce_score', sa.Integer(), True),
('member', 'last_bounce_received', sa.DateTime(), True),
('member', 'last_warning_sent', sa.DateTime(), True),
=====================================
src/mailman/handlers/cook_headers.py
=====================================
@@ -50,7 +50,7 @@ def uheader(mlist, s, header_name=None, continuation_ws='\t',
maxlinelen=None):
if '\n' in s:
s = '{} [...]'.format(s.split('\n')[0])
log.warning('Header {} contains a newline, truncating it.'.format(
- header_name, s))
+ header_name))
return Header(s, charset, maxlinelen, header_name, continuation_ws)
@@ -142,7 +142,7 @@ def process(mlist, msg, msgdata):
# is already in From and Reply-To in this case.
if (mlist.personalize is Personalization.full
and mlist.reply_goes_to_list is not # noqa: W503
- ReplyToMunging.point_to_list
+ ReplyToMunging.point_to_list # noqa: E127
and not mlist.anonymous_list): # noqa: W503
# Watch out for existing Cc headers, merge, and remove dups. Note
# that RFC 2822 says only zero or one Cc header is allowed.
=====================================
src/mailman/model/member.py
=====================================
@@ -236,9 +236,9 @@ class MembershipManager:
query = store.query(Member).join(
MailingList, Member.list_id == MailingList._list_id).join(
Member.preferences).filter(and_(
- MailingList.process_bounces == True,
- Member.total_warnings_sent <
MailingList.bounce_you_are_disabled_warnings, # noqa: E501
- Preferences.delivery_status == DeliveryStatus.by_bounces))
+ MailingList.process_bounces == True, # noqa: E712
+ Member.total_warnings_sent <
MailingList.bounce_you_are_disabled_warnings, # noqa: E501
+ Preferences.delivery_status == DeliveryStatus.by_bounces))
# XXX(maxking): This is IMO a query that *should* work, but I haven't
# been able to get it to work in my tests. It could be due to lack of
@@ -254,7 +254,7 @@ class MembershipManager:
for member in query.all():
if (member.last_warning_sent +
- member.mailing_list.bounce_you_are_disabled_warnings_interval)
<= now(): # noqa: E501
+
member.mailing_list.bounce_you_are_disabled_warnings_interval) <= now(): #
noqa: E501
yield member
@dbconnection
@@ -266,12 +266,12 @@ class MembershipManager:
query = store.query(Member).join(
MailingList, Member.list_id == MailingList._list_id).join(
Member.preferences).filter(and_(
- MailingList.process_bounces == True,
- Member.total_warnings_sent >=
MailingList.bounce_you_are_disabled_warnings, # noqa: E501
- Preferences.delivery_status == DeliveryStatus.by_bounces))
+ MailingList.process_bounces == True, # noqa: E712
+ Member.total_warnings_sent >=
MailingList.bounce_you_are_disabled_warnings, # noqa: E501
+ Preferences.delivery_status == DeliveryStatus.by_bounces))
for member in query.all():
if ((member.last_warning_sent +
- member.mailing_list.bounce_you_are_disabled_warnings_interval)
<= now() or # noqa: E501
- member.mailing_list.bounce_you_are_disabled_warnings == 0):
+
member.mailing_list.bounce_you_are_disabled_warnings_interval) <= now() or #
noqa: E501
+ member.mailing_list.bounce_you_are_disabled_warnings == 0):
yield member
=====================================
src/mailman/rest/tests/test_systemconf.py
=====================================
@@ -62,8 +62,7 @@ class TestSystemConfiguration(unittest.TestCase):
del json['http_etag']
self.assertEqual(json, dict(
cache_lifetime='7d',
- org_domain_data_url= # noqa: E251
- 'https://publicsuffix.org/list/public_suffix_list.dat',
+
org_domain_data_url='https://publicsuffix.org/list/public_suffix_list.dat', #
noqa: E501
resolver_lifetime='5s',
resolver_timeout='3s',
self_link='http://localhost:9001/3.0/system/configuration/dmarc',
=====================================
src/mailman/rules/moderation.py
=====================================
@@ -149,7 +149,8 @@ class NonmemberModeration:
for sender in msg.senders:
nonmember = mlist.nonmembers.get_member(sender)
assert nonmember is not None, (
- "sender didn't get subscribed as a nonmember".format(sender))
+ "sender {} didn't get subscribed as a nonmember".format(sender)
+ )
# Check the '*_these_nonmembers' properties first. XXX These are
# legacy attributes from MM2.1; their database type is 'pickle' and
# they should eventually get replaced.
View it on GitLab:
https://gitlab.com/mailman/mailman/-/compare/dd447da69644cfaaa172b5d7df5e92a436149a1f...491c1c64098772ec021071be19cfb8dc2782b12e
--
View it on GitLab:
https://gitlab.com/mailman/mailman/-/compare/dd447da69644cfaaa172b5d7df5e92a436149a1f...491c1c64098772ec021071be19cfb8dc2782b12e
You're receiving this email because of your account on gitlab.com.
_______________________________________________
Mailman-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/mailman-checkins.python.org/
Member address: [email protected]