Esempio n. 1
0
def main(**kwargs):
    app = QtApplication()
    qt5reactor.install()
    view = ViewerWindow(filename=kwargs.get('file', '-'),
                        frameless=kwargs.get('frameless', False))
    view.protocol = ViewerProtocol(view)
    view.show()
    app.deferred_call(lambda: StandardIO(view.protocol))
    app.start()
Esempio n. 2
0
def main(**kwargs):
    app = QtApplication()
    qreactor.install()

    filename = kwargs.get('file', '-')
    frameless = kwargs.get('frameless', False)
    watch = kwargs.get('watch', False)

    if not frameless and not os.path.exists(filename):
        raise ValueError("File %s does not exist!" % filename)

    view = ViewerWindow(filename='-', frameless=frameless)
    view.protocol = ViewerProtocol(view, watch)
    view.show()
    app.deferred_call(lambda: StandardIO(view.protocol))
    app.deferred_call(view.protocol.handle_filename, filename)
    app.start()