PyPush_daemon.py 文件源码

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

项目:PyPush 作者: VRGhost 项目源码 文件源码
def run_daemon(args):
    ctx = daemon.DaemonContext(
        working_directory=args.working_directory,
        pidfile=lockfile.LockFile(args.pidfile),
        stdout=open_io_redirect_file(args.stdout),
        stderr=open_io_redirect_file(args.stderr),
    )
    if args.command == "status":
        sys,exit(1 if ctx.is_open else 0) 
    elif args.command == "stop":
        ctx.close()
    elif args.command == "start":
        with ctx:
            PyPush.web.main.main(
                False, # I hereby force debug-less mode on the daemon.
                args.host, args.port,
                args.db_uri,
                args.ble_driver, args.ble_device
            )
    else:
        raise Exception("Unexpected daemon command {!r}".format(args.command))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号