本文整理汇总了Python中Mailman.Utils.reap方法的典型用法代码示例。如果您正苦于以下问题:Python Utils.reap方法的具体用法?Python Utils.reap怎么用?Python Utils.reap使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mailman.Utils
的用法示例。
在下文中一共展示了Utils.reap方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _cleanup
# 需要导入模块: from Mailman import Utils [as 别名]
# 或者: from Mailman.Utils import reap [as 别名]
def _cleanup(self):
"""Clean up upon exit from the main processing loop.
Called when the Runner's main loop is stopped, this should perform
any necessary resource deallocation. Its return value is irrelevant.
"""
Utils.reap(self._kids)
示例2: len
# 需要导入模块: from Mailman import Utils [as 别名]
# 或者: from Mailman.Utils import reap [as 别名]
# It is possible that shunting can throw an exception, e.g. a
# permissions problem or a MemoryError due to a really large
# message. Try to be graceful.
try:
new_filebase = self._shunt.enqueue(msg, msgdata)
log.error("SHUNTING: %s", new_filebase)
self._switchboard.finish(filebase)
except Exception, e:
# The message wasn't successfully shunted. Log the
# exception and try to preserve the original queue entry
# for possible analysis.
self._log(e)
log.error("SHUNTING FAILED, preserving original entry: %s", filebase)
self._switchboard.finish(filebase, preserve=True)
# Other work we want to do each time through the loop
Utils.reap(self._kids, once=True)
self._doperiodic()
if self._shortcircuit():
break
return len(files)
def _onefile(self, msg, msgdata):
# Do some common sanity checking on the message metadata. It's got to
# be destined for a particular mailing list. This switchboard is used
# to shunt off badly formatted messages. We don't want to just trash
# them because they may be fixable with human intervention. Just get
# them out of our site though.
#
# Find out which mailing list this message is destined for.
listname = msgdata.get("listname")
mlist = config.db.list_manager.get(listname)