style: Format code with black and isort

This commit is contained in:
deepsource-autofix[bot] 2023-08-08 19:48:37 +00:00 committed by GitHub
parent 6cb1fabcac
commit 63ba1be87d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 10 deletions

View File

@ -2,10 +2,11 @@
# python -m src.__main__
# python -m src # also works because __main__ is the default module
import argparse
import asyncio
import os
from pathlib import Path
from sys import exit, stderr
import asyncio
import dotenv
from loguru import logger

View File

@ -1,8 +1,10 @@
# This is a scriprt to undo the changes made by adblock-zerotrust.py
import requests
import httpx
import asyncio
import httpx
import requests
from . import utils

View File

@ -1,8 +1,8 @@
import asyncio
import pathlib
import requests
import asyncio
import httpx
import requests
from . import utils
@ -48,13 +48,11 @@ def split_list(blocklists):
return lists
async def upload_to_cloudflare(lists, account_id: str, token: str) -> None:
async def upload_to_cloudflare(lists, account_id: str, token: str) -> None:
async with httpx.AsyncClient() as client:
for i, lst in enumerate(lists):
list_name = f"adblock-list-{i + 1}"
url = (
f"https://api.cloudflare.com/client/v4/accounts/{account_id}/gateway/lists"
)
url = f"https://api.cloudflare.com/client/v4/accounts/{account_id}/gateway/lists"
headers = {
"Authorization": f"Bearer {token}",
"Content-Type": "application/json",
@ -79,7 +77,6 @@ async def upload_to_cloudflare(lists, account_id: str, token: str) -> None:
exit(1)
def create_dns_policy(lists, account_id: str, token: str) -> None:
url = f"https://api.cloudflare.com/client/v4/accounts/{account_id}/gateway/rules"
headers = {