plugins.py 文件源码

python
阅读 42 收藏 0 点赞 0 评论 0

项目:watcher 作者: nosmokingbandit 项目源码 文件源码
def _is_daemonized(self):
        """Return boolean indicating if the current process is
        running as a daemon.

        The criteria to determine the `daemon` condition is to verify
        if the current pid is not the same as the one that got used on
        the initial construction of the plugin *and* the stdin is not
        connected to a terminal.

        The sole validation of the tty is not enough when the plugin
        is executing inside other process like in a CI tool
        (Buildbot, Jenkins).
        """
        if (self._original_pid != os.getpid() and
            not os.isatty(sys.stdin.fileno())):
            return True
        else:
            return False
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号