1
0
Fork 0
mirror of synced 2024-06-10 22:34:40 +12:00
bulk-downloader-for-reddit/bdfr/archive_entry/comment_archive_entry.py

22 lines
592 B
Python
Raw Normal View History

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import logging
import praw.models
2021-04-12 19:58:32 +12:00
from bdfr.archive_entry.base_archive_entry import BaseArchiveEntry
logger = logging.getLogger(__name__)
class CommentArchiveEntry(BaseArchiveEntry):
def __init__(self, comment: praw.models.Comment):
super(CommentArchiveEntry, self).__init__(comment)
def compile(self) -> dict:
self.source.refresh()
self.post_details = self._convert_comment_to_dict(self.source)
2022-12-03 18:11:17 +13:00
self.post_details["submission_title"] = self.source.submission.title
return self.post_details