Black/isort

This commit is contained in:
Thomas Sileo
2018-06-16 22:02:10 +02:00
parent c5295524c7
commit d9362adb25
16 changed files with 814 additions and 672 deletions

View File

@@ -1,4 +1,7 @@
from typing import Optional, Dict, List, Any
from typing import Any
from typing import Dict
from typing import List
from typing import Optional
import requests

View File

@@ -1,11 +1,11 @@
import logging
from urllib.parse import urlparse
import requests
from urllib.parse import urlparse
from Crypto.PublicKey import RSA
from .urlutils import check_url
from .errors import ActivityNotFoundError
from .urlutils import check_url
logger = logging.getLogger(__name__)

View File

@@ -1,14 +1,21 @@
import typing
import re
import re
import typing
from typing import Any
from typing import Dict
from typing import List
from typing import Optional
from typing import Tuple
from typing import Type
from typing import Union
from bleach.linkifier import Linker
from markdown import markdown
from bleach.linkifier import Linker
from markdown import markdown
from utils.webfinger import get_actor_url
from config import USERNAME, BASE_URL, ID
from config import ACTOR_SERVICE
from typing import List, Optional, Tuple, Dict, Any, Union, Type
from config import ACTOR_SERVICE
from config import BASE_URL
from config import ID
from config import USERNAME
from utils.webfinger import get_actor_url
def set_attrs(attrs, new=False):

View File

@@ -3,19 +3,20 @@
Mastodon instances won't accept requests that are not signed using this scheme.
"""
from datetime import datetime
from urllib.parse import urlparse
from typing import Any, Dict, Optional
import base64
import hashlib
import logging
from datetime import datetime
from typing import Any
from typing import Dict
from typing import Optional
from urllib.parse import urlparse
from Crypto.Hash import SHA256
from Crypto.Signature import PKCS1_v1_5
from flask import request
from requests.auth import AuthBase
from Crypto.Signature import PKCS1_v1_5
from Crypto.Hash import SHA256
logger = logging.getLogger(__name__)

View File

@@ -1,6 +1,5 @@
import os
import binascii
import os
from typing import Callable
from little_boxes.key import Key

View File

@@ -1,13 +1,12 @@
from pyld import jsonld
import base64
import hashlib
from datetime import datetime
from typing import Any
from typing import Dict
from Crypto.Signature import PKCS1_v1_5
from Crypto.Hash import SHA256
import base64
from typing import Any, Dict
from Crypto.Signature import PKCS1_v1_5
from pyld import jsonld
# cache the downloaded "schemas", otherwise the library is super slow
# (https://github.com/digitalbazaar/pyld/issues/70)

View File

@@ -1,8 +1,9 @@
import requests
from urllib.parse import urlparse
from .urlutils import check_url
import requests
from .errors import ActivityNotFoundError
from .urlutils import check_url
class ObjectService(object):

View File

@@ -1,11 +1,12 @@
import ipaddress
from urllib.parse import urlparse
import ipaddress
import opengraph
import requests
from bs4 import BeautifulSoup
from .urlutils import is_url_valid, check_url
from .urlutils import check_url
from .urlutils import is_url_valid
def links_from_note(note):

View File

@@ -1,7 +1,7 @@
import ipaddress
import logging
import os
import socket
import ipaddress
from urllib.parse import urlparse
from . import strtobool

View File

@@ -1,13 +1,13 @@
from urllib.parse import urlparse
from typing import Dict, Any
from typing import Optional
import logging
from typing import Any
from typing import Dict
from typing import Optional
from urllib.parse import urlparse
import requests
from .urlutils import check_url
logger = logging.getLogger(__name__)