Tweak the README

This commit is contained in:
Thomas Sileo 2018-06-10 17:08:13 +02:00
parent b0cf350ec6
commit eb25a28679

View file

@ -5,11 +5,7 @@ Tiny ActivityPub framework written in Python, both database and server agnostic.
## Getting Started ## Getting Started
```python ```python
from little_boxes.activitypub import BaseBackend from little_boxes import activitypub as ap
from little_boxes.activitypub import use_backend
from little_boxes.activitypub import Outbox
from little_boxes.activitypub import Person
from little_boxes.activitypub import Follow
from mydb import db_client from mydb import db_client
@ -31,11 +27,11 @@ class MyBackend(BaseBackend):
db_con = db_client() db_con = db_client()
my_backend = MyBackend(db_con) my_backend = MyBackend(db_con)
use_backend(my_backend) ap.use_backend(my_backend)
me = Person({}) # Init an actor me = ap.Person({}) # Init an actor
outbox = Outbox(me) outbox = ap.Outbox(me)
follow = Follow(actor=me, object='http://iri-i-want-follow') follow = ap.Follow(actor=me, object='http://iri-i-want-follow')
outbox.post(follow) outbox.post(follow)
``` ```