From ea6be0ed8e5da5a500871d9b442c1f5c33ec4732 Mon Sep 17 00:00:00 2001 From: Thomas Sileo Date: Sat, 21 Jul 2018 01:05:51 +0200 Subject: [PATCH] Formatting --- .isort.cfg | 3 +++ app.py | 2 +- tasks.py | 3 ++- templates/utils.html | 1 + utils/lookup.py | 4 ++-- 5 files changed, 9 insertions(+), 4 deletions(-) create mode 100644 .isort.cfg diff --git a/.isort.cfg b/.isort.cfg new file mode 100644 index 0000000..0ed7634 --- /dev/null +++ b/.isort.cfg @@ -0,0 +1,3 @@ +[settings] +line_length=120 +force_single_line=true diff --git a/app.py b/app.py index c830251..91b6ab0 100644 --- a/app.py +++ b/app.py @@ -75,8 +75,8 @@ from config import VERSION from config import _drop_db from config import custom_cache_purge_hook from utils.key import get_secret_key -from utils.media import Kind from utils.lookup import lookup +from utils.media import Kind back = activitypub.MicroblogPubBackend() diff --git a/tasks.py b/tasks.py index f348ded..7824cd3 100644 --- a/tasks.py +++ b/tasks.py @@ -72,7 +72,8 @@ def cache_actor(self, iri: str, also_cache_attachments: bool = True) -> None: # Cache the actor info DB.activities.update_one( - {"remote_id": iri}, {"$set": {"meta.actor": activitypub._actor_to_meta(actor)}} + {"remote_id": iri}, + {"$set": {"meta.actor": activitypub._actor_to_meta(actor)}}, ) log.info(f"actor cached for {iri}") diff --git a/templates/utils.html b/templates/utils.html index 3f267b5..6d4b84a 100644 --- a/templates/utils.html +++ b/templates/utils.html @@ -172,6 +172,7 @@ {% macro display_thread(thread, likes=[], shares=[]) -%} {% for reply in thread %} +{{ reply }} {% if reply._requested %} {{ display_note(reply.activity.object, perma=True, ui=False, likes=likes, shares=shares, meta=reply.meta) }} {% else %} diff --git a/utils/lookup.py b/utils/lookup.py index 65c2c19..abd0d6f 100644 --- a/utils/lookup.py +++ b/utils/lookup.py @@ -1,8 +1,8 @@ -import little_boxes.activitypub as ap import json -import requests +import little_boxes.activitypub as ap import mf2py +import requests def lookup(url: str) -> ap.BaseActivity: