tsileo/little-boxes

README example does not work

Closed this issue · 2 comments

running the "Getting Started" example did not get me very far - upon instantiating a MyBackend object, i got the following error:

    def inbox_new(self, as_actor: ap.Person, activity: ap.Activity) -> None:
AttributeError: module 'little_boxes.activitypub' has no attribute 'Activity'

after changing 'ap.Activity' to 'ap.BaseActivity', i got this error:

    my_backend = MyBackend(db_con)
TypeError: Can't instantiate abstract class MyBackend with abstract methods activity_url, base_url, note_url

once i implemented the abstract methods activity_url, base_url, note_url, i got this error:

    me = ap.Person({})  # Init an actor
TypeError: __init__() takes 1 positional argument but 2 were given

after removing the empty dict from the call to the Person constructor, i got this error:

    outbox = ap.Outbox(me)
AttributeError: module 'little_boxes.activitypub' has no attribute 'Outbox'

at this point, i can "get started" no further - that 'Outbox' class does not exist in this code-base

i can understand "early development", but after 166 commits, shouldn't the most basic boilerplate functionality work? - isn't an inbox and outbox the primary fundamental core features of activity-pub? - (little_boxes.activitypub has no attribute Inbox either)

am i just confused? - i am not a huge python guy - i can only assume i have done something wrong - can this actually be used today to process activity-pub messages? - i only need the absolute basic activity-pub functionality for a demo

Hi,

The README does need an update, I will try to update it whenever I have time.

You can look at https://github.com/tsileo/microblog.pub for a real-world example (it's in the README).

And yes, it's used to process ActivityPub messages, but via microblog.pub, see: https://fediverse.network/microblogpub

Finally, keep in mind little-boxes is a low-level framework, and not something meant to be ready to use out the box. Maybe you should look for a different project.