def withCommentListener(self, commentListener):
"""Set a commentListener function. Comments will not be repeated.
http://praw.readthedocs.io/en/latest/code_overview/models/comment.html
:param commentListener: function(redditInstance, comment)
:return: self
"""
self.__commentListener = commentListener
return self
python类models()的实例源码
def withSubmissionListener(self, submissionListener):
"""Set a submissionListener function. Submissions will not be repeated.
http://praw.readthedocs.io/en/latest/code_overview/models/submission.html
:param submissionListener: function(redditInstance, submission)
:return: self
"""
self.__submissionListener = submissionListener
return self
def withMentionListener(self, commentListener):
"""Set a mentionListener function. Comments will not be repeated.
http://praw.readthedocs.io/en/latest/code_overview/models/comment.html
:param commentListener: function(redditInstance, comment)
:return: self
"""
self.__mentionListener = commentListener
return self
def withPMListener(self, pmListener):
"""Set a pmListener function. PMs will not be repeated.
http://praw.readthedocs.io/en/latest/code_overview/models/message.html
:param pmListener: function(redditInstance, message)
:return: self
"""
self.__pmListener = pmListener
return self