Formatting

This commit is contained in:
Thomas Sileo 2019-08-01 22:25:58 +02:00
parent 5b9a0cb286
commit 56f4fb2ce2
9 changed files with 18 additions and 21 deletions

17
app.py
View file

@ -34,9 +34,8 @@ import blueprints.indieauth
import blueprints.tasks
import blueprints.well_known
import config
from core.meta import Box
from core.activitypub import embed_collection
from blueprints.api import _api_required
from blueprints.tasks import TaskError
from config import DB
from config import HEADERS
from config import ID
@ -44,12 +43,14 @@ from config import ME
from config import MEDIA_CACHE
from config import VERSION
from core import activitypub
from core.activitypub import embed_collection
from core.db import find_one_activity
from core.meta import Box
from core.meta import MetaKey
from core.meta import _meta
from core.meta import is_public
from core.meta import by_remote_id
from core.meta import in_outbox
from core.meta import is_public
from core.shared import MY_PERSON
from core.shared import _add_answers_to_question
from core.shared import _build_thread
@ -61,12 +62,10 @@ from core.shared import noindex
from core.shared import paginated_query
from core.shared import post_to_outbox
from core.tasks import Tasks
from blueprints.tasks import TaskError
from utils import now
from utils.key import get_secret_key
from utils.template_filters import filters
app = Flask(__name__)
app.secret_key = get_secret_key("flask")
app.register_blueprint(filters)
@ -566,11 +565,9 @@ def outbox_detail(item_id):
@app.route("/outbox/<item_id>/activity")
def outbox_activity(item_id):
data = find_one_activity({
**in_outbox(),
**by_remote_id(back.activity_url(item_id)),
**is_public(),
})
data = find_one_activity(
{**in_outbox(), **by_remote_id(back.activity_url(item_id)), **is_public()}
)
if not data:
abort(404)

View file

@ -19,10 +19,10 @@ from passlib.hash import bcrypt
from u2flib_server import u2f
import config
from core.activitypub import Box
from config import DB
from config import ID
from config import PASS
from core.activitypub import Box
from core.shared import MY_PERSON
from core.shared import _build_thread
from core.shared import _Response

View file

@ -24,24 +24,24 @@ from little_boxes.errors import NotFromOutboxError
from werkzeug.utils import secure_filename
import config
from core.meta import Box
from config import ADMIN_API_KEY
from config import BASE_URL
from config import DB
from config import DEBUG_MODE
from config import ID
from config import JWT
from config import MEDIA_CACHE
from config import ADMIN_API_KEY
from config import _drop_db
from core import activitypub
from core.meta import Box
from core.meta import MetaKey
from core.meta import _meta
from core.shared import MY_PERSON
from core.shared import _Response
from core.shared import back
from core.shared import csrf
from core.shared import post_to_outbox
from core.shared import login_required
from core.shared import post_to_outbox
from core.tasks import Tasks
from utils import now

View file

@ -14,10 +14,10 @@ from little_boxes.httpsig import HTTPSigAuth
from requests.exceptions import HTTPError
import config
from core.activitypub import Box
from config import DB
from core import activitypub
from core import gc
from core.activitypub import Box
from core.meta import MetaKey
from core.meta import _meta
from core.notifications import set_inbox_flags

View file

@ -9,8 +9,8 @@ from flask import request
from little_boxes import activitypub as ap
import config
from core.meta import Box
from config import DB
from core.meta import Box
blueprint = flask.Blueprint("well_known", __name__)

View file

@ -29,7 +29,7 @@ from config import ME
from config import USER_AGENT
from config import USERNAME
from core.meta import Box
from tasks import Tasks
from core.tasks import Tasks
logger = logging.getLogger(__name__)

View file

@ -1,7 +1,7 @@
from enum import Enum
from enum import unique
from typing import Dict
from typing import Any
from typing import Dict
from typing import Optional
from config import DB

View file

@ -8,12 +8,12 @@ from typing import List
from little_boxes import activitypub as ap
from core.meta import Box
from config import DAYS_TO_KEEP
from config import ID
from config import ME
from config import MEDIA_CACHE
from core import activitypub
from core.meta import Box
from utils.migrations import DB
back = activitypub.MicroblogPubBackend()

View file

@ -19,11 +19,11 @@ from little_boxes import activitypub as ap
from little_boxes.activitypub import format_datetime
from poussetaches import PousseTaches
from core.meta import Box
from core.activitypub import _answer_key
from config import DB
from config import ME
from core import activitypub
from core.activitypub import _answer_key
from core.meta import Box
from core.tasks import Tasks
_Response = Union[flask.Response, werkzeug.wrappers.Response, str]