v0.5.0-alpha
Pre-release
Pre-release
Update Log
aPRAWBase
- aPRAWBase can now be loaded as lazy objects.
- Added overridable method
fetch()
and implemented forclass Comment
,class Redditor
,class Submission
. - Private members were refactored with an
_
(i.e._reddit
or_data
). - The
__repr__()
method was implemented returning a string in the format of<{class} {id_attribute}='{id}'>
. - Keeping track of attributes returned by the API with
_data_attrs
.
Comments
class Comment
is now reactive based on the ReactivePy library.- Using
Comment.on_change()
orComment.attribute.on_change()
, change handlers can be assigned to the object and are called whenever a comment is refreshed and attributes change. Comment.monitor()
starts a loop based on theclass ExponentialCounter
used in streams to monitor a comment and repeatedly callfetch()
.
- Using
Comment Forrests:
- The
class CommentForrest
was added as well asclass MoreChildren
, based on theclass Listing
.- Comment forests can contain
class Comment
as well asclass MoreComments
. CommentForrest.replace_more()
will replace allclass MoreComments
within the tree asynchronously.class CommentForrest
is used inSubmission.comments
as well asComment.replies
class MoreChildren
is a listing for responses from the/morechildren
endpoint.
- Comment forests can contain
- The
class MoreComments
acts as an async generator and will grab further comments in batches of 100 until the list has been exhausted.- Using
MoreComments.comments()
will fetch all the comments and return a flattened list. MoreComments.parent()
will return the parent submission or comment.depth
member attribute can be modified to adjust the depth of the comment tree when fetching more comments withclass MoreComments
.
- Using
Other
- Add
Reddit.close()
to properly close openClientSession
s.
Fixes
- Streams such as
Subreddit.new.stream()
were fixed as previously they would ignore all new posts. User.get_auth_session()
andget_client_session()
are now asynchronous methods to ensure a running event loop.- Fix use of
random.random()
inclass ExponentialCounter
.
Tests
test_comment_forrest_replace_more
was added using a large /r/facepalm thread.- Test comments were replaced by those made by the bot account to avoid failures based on online data.
- Tests for old implementations of more children were removed.
Note: aPRAW v0.5.0-alpha has ReactivePy >= 1.9.0.dev0 as a requirement.