[V3 Travis] Update travis to not skip pipfile lock... (#1678)

* Update travis to not sip pipfile lock

update pipfile dependencies

additional black formatting pass to conform to black 18.5b

* .

* pin async timeout until further discussion of 3.5 support

* .
This commit is contained in:
Michael H
2018-05-18 21:48:22 -04:00
committed by palmtree5
parent 55afc7eb33
commit d3f406a34a
35 changed files with 214 additions and 297 deletions

View File

@@ -36,9 +36,10 @@ class AntiSpam:
self.__discard_after = max([x.period for x in self.__intervals])
def __interval_check(self, interval: AntiSpamInterval):
return len(
[t for t in self.__event_timestamps if (t + interval.period) > datetime.utcnow()]
) >= interval.frequency
return (
len([t for t in self.__event_timestamps if (t + interval.period) > datetime.utcnow()])
>= interval.frequency
)
@property
def spammy(self):

View File

@@ -235,8 +235,8 @@ def pagify(
while len(in_text) > page_length:
this_page_len = page_length
if escape_mass_mentions:
this_page_len -= (
in_text.count("@here", 0, page_length) + in_text.count("@everyone", 0, page_length)
this_page_len -= in_text.count("@here", 0, page_length) + in_text.count(
"@everyone", 0, page_length
)
closest_delim = (in_text.rfind(d, 1, this_page_len) for d in delims)
if priority:
@@ -315,7 +315,5 @@ def escape(text: str, *, mass_mentions: bool = False, formatting: bool = False)
text = text.replace("@everyone", "@\u200beveryone")
text = text.replace("@here", "@\u200bhere")
if formatting:
text = (
text.replace("`", "\\`").replace("*", "\\*").replace("_", "\\_").replace("~", "\\~")
)
text = text.replace("`", "\\`").replace("*", "\\*").replace("_", "\\_").replace("~", "\\~")
return text

View File

@@ -52,9 +52,8 @@ async def menu(
RuntimeError
If either of the notes above are violated
"""
if (
not all(isinstance(x, discord.Embed) for x in pages)
and not all(isinstance(x, str) for x in pages)
if not all(isinstance(x, discord.Embed) for x in pages) and not all(
isinstance(x, str) for x in pages
):
raise RuntimeError("All pages must be of the same type")
for key, value in controls.items():

View File

@@ -79,10 +79,10 @@ def get_audit_reason(author: discord.Member, reason: str = None):
The formatted audit log reason.
"""
return "Action requested by {} (ID {}). Reason: {}".format(
author, author.id, reason
) if reason else "Action requested by {} (ID {}).".format(
author, author.id
return (
"Action requested by {} (ID {}). Reason: {}".format(author, author.id, reason)
if reason
else "Action requested by {} (ID {}).".format(author, author.id)
)