本文整理汇总了Python中spambayes.Options._函数的典型用法代码示例。如果您正苦于以下问题:Python _函数的具体用法?Python _怎么用?Python _使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了_函数的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: onShowclues
def onShowclues(self, key, subject, tokens='0'):
"""Show clues for a message - linked from the Review page."""
tokens = bool(int(tokens)) # needs the int, as bool('0') is True
self._writePreamble(_("Message clues"),
parent=('review', _('Review')))
sourceCorpus = None
message = None
if self.state.unknownCorpus.get(key) is not None:
sourceCorpus = self.state.unknownCorpus
elif self.state.hamCorpus.get(key) is not None:
sourceCorpus = self.state.hamCorpus
elif self.state.spamCorpus.get(key) is not None:
sourceCorpus = self.state.spamCorpus
if sourceCorpus is not None:
message = sourceCorpus.get(key).as_string()
if message is not None:
# For Macs?
message = message.replace('\r\n', '\n').replace('\r', '\n')
results = self._buildCluesTable(message, subject, tokens)
del results.classifyAnother
self.write(results)
else:
self.write(_("<p>Can't find message %r. Maybe it expired.</p>") %
key)
self._writePostamble()