Skip to content

Commit 95f93a8

Browse files
committed
add documentations
1 parent 891448e commit 95f93a8

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

social_posters/mastodon.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,9 @@ def authenticate(self) -> bool:
7373
self._auth_error = f"{type(exc).__name__}: {exc}"
7474
return False
7575

76+
"""
77+
Main Mastodon publishing logic
78+
"""
7679
def publish(self, post: Post) -> PostResult:
7780
error = self._ensure_ready_to_publish(post)
7881
if error:
@@ -153,7 +156,7 @@ def _post_thread(
153156

154157
"""
155158
Implement your own pipeline and consume it in a preview file
156-
for debugging purposes
159+
for previewing/debugging purposes
157160
Here, we build a pipeline from AdoptablePet (upstream input)
158161
-> Post -> Prepared Caption -> Caption Thread
159162
"""
@@ -310,6 +313,9 @@ def _safe_truncate(text: str, limit: int) -> tuple[str, str]:
310313

311314
return text[:cut].rstrip(), text[cut:].strip()
312315

316+
"""
317+
Override abstractions.py method
318+
"""
313319
def format_post(self, pet: AdoptablePet) -> Post:
314320
text = (
315321
f"Meet {pet.name}! This adorable {pet.breed} {pet.species} "

utils/pipeline.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
PipelineResult[T] + Callable[[T], U] -> PipelineResult[U]
77
88
For example:
9+
T:AdoptablePet -> (T:AdoptablePet -> U:Post) outputs U:Post
910
11+
Whole Pipeline:
1012
AdoptablePet -> Post -> PreparedCaption -> CaptionThread
1113
1214
The trace stores every intermediate phase value for preview/debug output,

0 commit comments

Comments
 (0)