我们从Python开源项目中,提取了以下4个代码示例,用于说明如何使用praw.models()。
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
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