2020-02-18 04:12:19 +00:00
|
|
|
''' bring activitypub functions into the namespace '''
|
2020-09-17 20:02:52 +00:00
|
|
|
import inspect
|
|
|
|
import sys
|
|
|
|
|
2020-11-28 01:58:21 +00:00
|
|
|
from .base_activity import ActivityEncoder, PublicKey, Signature
|
2020-11-01 18:13:51 +00:00
|
|
|
from .base_activity import Link, Mention
|
2020-11-23 21:43:46 +00:00
|
|
|
from .base_activity import ActivitySerializerError
|
2020-11-28 01:58:21 +00:00
|
|
|
from .image import Image
|
2020-09-29 00:26:15 +00:00
|
|
|
from .note import Note, GeneratedNote, Article, Comment, Review, Quotation
|
2020-11-01 18:13:51 +00:00
|
|
|
from .note import Tombstone
|
2020-09-17 20:02:52 +00:00
|
|
|
from .interaction import Boost, Like
|
|
|
|
from .ordered_collection import OrderedCollection, OrderedCollectionPage
|
|
|
|
from .person import Person
|
|
|
|
from .book import Edition, Work, Author
|
2020-10-14 15:38:51 +00:00
|
|
|
from .verbs import Create, Delete, Undo, Update
|
2020-09-17 20:02:52 +00:00
|
|
|
from .verbs import Follow, Accept, Reject
|
|
|
|
from .verbs import Add, Remove
|
|
|
|
|
|
|
|
# this creates a list of all the Activity types that we can serialize,
|
|
|
|
# so when an Activity comes in from outside, we can check if it's known
|
|
|
|
cls_members = inspect.getmembers(sys.modules[__name__], inspect.isclass)
|
|
|
|
activity_objects = {c[0]: c[1] for c in cls_members \
|
|
|
|
if hasattr(c[1], 'to_model')}
|