lint: reformat python code with black
This commit is contained in:
parent
331beb01b4
commit
a406a7974b
88 changed files with 2579 additions and 1608 deletions
|
@ -52,8 +52,15 @@ class BlockMirrorAutomation(BaseAutomation):
|
|||
if rotated:
|
||||
activity = Activity(
|
||||
activity_type="block",
|
||||
text=(f"[{self.short_name}] ♻ Rotated {len(rotated)} proxies️️: \n"
|
||||
+ "\n".join([f"* {proxy_domain} ({origin_domain})" for proxy_domain, origin_domain in rotated]))
|
||||
text=(
|
||||
f"[{self.short_name}] ♻ Rotated {len(rotated)} proxies️️: \n"
|
||||
+ "\n".join(
|
||||
[
|
||||
f"* {proxy_domain} ({origin_domain})"
|
||||
for proxy_domain, origin_domain in rotated
|
||||
]
|
||||
)
|
||||
),
|
||||
)
|
||||
db.session.add(activity)
|
||||
activity.notify()
|
||||
|
@ -79,15 +86,15 @@ class BlockMirrorAutomation(BaseAutomation):
|
|||
|
||||
|
||||
def active_proxy_urls() -> List[str]:
|
||||
return [proxy.url for proxy in Proxy.query.filter(
|
||||
Proxy.deprecated.is_(None),
|
||||
Proxy.destroyed.is_(None)
|
||||
).all()]
|
||||
return [
|
||||
proxy.url
|
||||
for proxy in Proxy.query.filter(
|
||||
Proxy.deprecated.is_(None), Proxy.destroyed.is_(None)
|
||||
).all()
|
||||
]
|
||||
|
||||
|
||||
def proxy_by_url(url: str) -> Optional[Proxy]:
|
||||
return Proxy.query.filter( # type: ignore[no-any-return]
|
||||
Proxy.deprecated.is_(None),
|
||||
Proxy.destroyed.is_(None),
|
||||
Proxy.url == url
|
||||
Proxy.deprecated.is_(None), Proxy.destroyed.is_(None), Proxy.url == url
|
||||
).first()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue