avahi.py 文件源码

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

项目:maas 作者: maas 项目源码 文件源码
def run(args, output=sys.stdout, stdin=sys.stdin):
    """Observe an Ethernet interface and print ARP bindings."""

    # First, become a progress group leader, so that signals can be directed
    # to this process and its children; see p.u.twisted.terminateProcess.
    os.setpgrp()

    if args.input_file is None:
        reader = _reader_from_avahi()
    elif args.input_file == "-":
        reader = _reader_from_stdin(stdin)
    else:
        reader = _reader_from_file(args.input_file)
    try:
        _observe_mdns(reader, output, args.verbose)
    except KeyboardInterrupt:
        # Suppress this exception and allow for a clean exit instead.
        # ActionScript would exit 1 if we allowed it to propagate, but
        # SIGINT/SIGTERM are how this script is meant to be terminated.
        pass
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号