当前位置: 首页>>代码示例>>Python>>正文


Python Utils.reap方法代码示例

本文整理汇总了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)
开发者ID:kaushikmit,项目名称:mailman,代码行数:9,代码来源:Runner.py

示例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)
开发者ID:kaushikmit,项目名称:mailman,代码行数:33,代码来源:Runner.py


注:本文中的Mailman.Utils.reap方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。