Formatting

This commit is contained in:
Thomas Sileo 2018-07-21 01:05:51 +02:00
parent ad355df6c5
commit ea6be0ed8e
5 changed files with 9 additions and 4 deletions

3
.isort.cfg Normal file
View file

@ -0,0 +1,3 @@
[settings]
line_length=120
force_single_line=true

2
app.py
View file

@ -75,8 +75,8 @@ from config import VERSION
from config import _drop_db from config import _drop_db
from config import custom_cache_purge_hook from config import custom_cache_purge_hook
from utils.key import get_secret_key from utils.key import get_secret_key
from utils.media import Kind
from utils.lookup import lookup from utils.lookup import lookup
from utils.media import Kind
back = activitypub.MicroblogPubBackend() back = activitypub.MicroblogPubBackend()

View file

@ -72,7 +72,8 @@ def cache_actor(self, iri: str, also_cache_attachments: bool = True) -> None:
# Cache the actor info # Cache the actor info
DB.activities.update_one( 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}") log.info(f"actor cached for {iri}")

View file

@ -172,6 +172,7 @@
{% macro display_thread(thread, likes=[], shares=[]) -%} {% macro display_thread(thread, likes=[], shares=[]) -%}
{% for reply in thread %} {% for reply in thread %}
{{ reply }}
{% if reply._requested %} {% if reply._requested %}
{{ display_note(reply.activity.object, perma=True, ui=False, likes=likes, shares=shares, meta=reply.meta) }} {{ display_note(reply.activity.object, perma=True, ui=False, likes=likes, shares=shares, meta=reply.meta) }}
{% else %} {% else %}

View file

@ -1,8 +1,8 @@
import little_boxes.activitypub as ap
import json import json
import requests
import little_boxes.activitypub as ap
import mf2py import mf2py
import requests
def lookup(url: str) -> ap.BaseActivity: def lookup(url: str) -> ap.BaseActivity: