main.py 文件源码

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

项目:os-shell 作者: bdastur 项目源码 文件源码
def run():
    validate_osenvironment()
    print_banner()

    cli_buffer = OSBuffer()
    ltobj = OSLayout(multiwindow=False)

    application = Application(
        style=PygmentsStyle(OSStyle),
        layout=ltobj.layout,
        buffers=cli_buffer.buffers,
        on_exit=AbortAction.RAISE_EXCEPTION,
        key_bindings_registry=OSKeyBinder.registry)


    cli = CommandLineInterface(application=application,
                               eventloop=create_eventloop())

    while True:
        try:
            document = cli.run(reset_current_buffer=True)
            process_document(document)
        except KeyboardInterrupt:
            # A keyboardInterrupt generated possibly due to Ctrl-C
            print "Keyboard Interrupt Generated"
            continue
        except EOFError:
            print "cntl-D"
            sys.exit()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号