Ejemplo n.º 1
0
def launch(args=None, block_input_hook=0):
    '''
    Run PyMOL with args

    Only returns if we are running pretend GLUT.
    '''
    if args is None:
        args = sys.argv
    invocation.parse_args(args)

    if invocation.options.gui == 'pmg_qt':
        if invocation.options.no_gui:
            return _launch_no_gui()
        elif invocation.options.testing:
            return pymol._cmd.test2()

        try:
            from pmg_qt import pymol_qt_gui
            return pymol_qt_gui.execapp()
        except ImportError as ex:
            print(f'Qt not available ({ex}), using GLUT/Tk interface')
            invocation.options.gui = 'pmg_tk'

    prime_pymol()
    _cmd.runpymol(None, block_input_hook)
Ejemplo n.º 2
0
def launch(args=None, block_input_hook=0):
    '''
    Run PyMOL with args

    Only returns if we are running pretend GLUT.
    '''
    if args is None:
        args = sys.argv
    invocation.parse_args(args)

    if invocation.options.gui == 'pmg_qt':
        if invocation.options.no_gui:
            return _launch_no_gui()
        elif invocation.options.testing:
            return pymol._cmd.test2()

        try:
            from pmg_qt import pymol_qt_gui
            sys.exit(pymol_qt_gui.execapp())
        except ImportError:
            print('Qt not available, using GLUT/Tk interface')
            invocation.options.gui = 'pmg_tk'

    prime_pymol()
    _cmd.runpymol(_cmd._get_global_C_object(), block_input_hook)
Ejemplo n.º 3
0
def launch(args=None, block_input_hook=0):
    '''
    Run PyMOL with args

    Only returns if we are running pretend GLUT.
    '''
    if args is None:
        if IS_WINDOWS and IS_PY2:
            try:
                from win_unicode_console import unicode_argv
                unicode_argv.enable()
            except Exception as e:
                print(e)
        args = sys.argv
    invocation.parse_args(args)

    if invocation.options.gui == 'pmg_qt':
        if invocation.options.no_gui:
            return _launch_no_gui()
        elif invocation.options.testing:
            return pymol._cmd.test2()

        from pmg_qt import pymol_qt_gui
        sys.exit(pymol_qt_gui.execapp())

    prime_pymol()
    _cmd.runpymol(_cmd._get_global_C_object(), block_input_hook)
Ejemplo n.º 4
0
def launch(args=None, block_input_hook=0):
    '''
    Run PyMOL with args

    Only returns if we are running pretend GLUT.
    '''
    if args is None:
        args = sys.argv
    invocation.parse_args(args)

    if invocation.options.gui == 'pmg_qt':
        if invocation.options.no_gui:
            return _launch_no_gui()

        try:
            from pmg_qt import pymol_qt_gui
            sys.exit(pymol_qt_gui.execapp())
        except ImportError:
            print('Qt not available, using GLUT/Tk interface')
            invocation.options.gui = 'pmg_tk'

    prime_pymol()
    _cmd.runpymol(_cmd._get_global_C_object(), block_input_hook)