web.py 文件源码

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

项目:unsonic 作者: redshodan 项目源码 文件源码
def webServe():
    if "--reload" in sys.argv:
        reload = True
    else:
        reload = False

    wait = 3
    while True:
        try:
            sys.exit(load_entry_point('pyramid>=1.4.3', 'console_scripts',
                                      'pserve')())
            break
        except IndentationError as e:
            if reload:
                print("Failed to (re)start unsonic:", e)
                print("Restarting in %d seconds..." % wait)
            else:
                raise
        except SyntaxError as e:
            if reload:
                print("Failed to (re)start unsonic:", e)
                print("Restarting in %d seconds..." % wait)
            else:
                raise
        except ImportError as e:
            if reload:
                print("Failed to (re)start unsonic:", e)
                print("Restarting in %d seconds..." % wait)
            else:
                raise
        time.sleep(wait)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号