Esempio n. 1
0
 def finish_launching(args=None):
     if args == None:
         args = pymol_argv+["-K"] # keep PyMOL thread alive
     else:
         args = list(args)
     if pymol_launch == 2: # spawn thread -- 'import pymol'
         global glutThreadObject
         cmd.reaper = threading.currentThread()
         glutThreadObject = threading.Thread(target=thread_launch,
           args=(args,)) 
         glutThreadObject.start()
     _COb = _cmd._get_global_C_object()
     e=threading.Event()
     import pymol # wait for import to complete
     while not _cmd.ready(_COb): # wait for the C library to initialize
         e.wait(0.01)
     while not hasattr(pymol,'xray'): # make sure symmetry module has time to start...
         e.wait(0.01)
Esempio n. 2
0
 def finish_launching(args=None):
     if args == None:
         args = pymol_argv + ["-K"]  # keep PyMOL thread alive
     else:
         args = list(args)
     if pymol_launch == 2:  # spawn thread -- 'import pymol'
         global glutThreadObject
         cmd.reaper = threading.currentThread()
         glutThreadObject = threading.Thread(target=thread_launch,
                                             args=(args, ))
         glutThreadObject.start()
     _COb = _cmd._get_global_C_object()
     e = threading.Event()
     import pymol  # wait for import to complete
     while not _cmd.ready(_COb):  # wait for the C library to initialize
         e.wait(0.01)
     while not hasattr(
             pymol,
             'xray'):  # make sure symmetry module has time to start...
         e.wait(0.01)
Esempio n. 3
0
        _cmd = __import__('_cmd', level=0)
    except ImportError:
        # import shared library
        from pymol import _cmd

    from pymol import cmd

    global _COb

    def thread_launch(pa):
        from pymol import invocation
        invocation.parse_args(pa)
        start_pymol(1)

    if pymol_launch == 1:  # standard launch (consume main thread)
        cmd._COb = _cmd._get_global_C_object()
        if __name__ == 'pymol':
            _COb = cmd._COb
        else:
            pymol._COb = cmd._COb
        from pymol import invocation
        invocation.parse_args(pymol_argv)
        start_pymol(0)

    elif pymol_launch == 2:  # threaded launch (create new thread)
        cmd._COb = _cmd._get_global_C_object()
        if __name__ == 'pymol':
            _COb = cmd._COb
        else:
            pymol._COb = cmd._COb
        # don't do anything else yet...wait for finish_launching() call
Esempio n. 4
0
        _cmd = __import__('_cmd', level=0)
    except ImportError:
        # import shared library
        from pymol import _cmd

    from pymol import cmd

    global _COb

    def thread_launch(pa):
        from pymol import invocation
        invocation.parse_args(pa)
        start_pymol(1)
    
    if pymol_launch == 1: # standard launch (consume main thread)
        cmd._COb = _cmd._get_global_C_object()
        if __name__=='pymol':
            _COb = cmd._COb
        else:
            pymol._COb = cmd._COb
        from pymol import invocation
        invocation.parse_args(pymol_argv)            
        start_pymol(0)

    elif pymol_launch == 2: # threaded launch (create new thread)
        cmd._COb = _cmd._get_global_C_object()
        if __name__=='pymol':
            _COb = cmd._COb
        else:
            pymol._COb = cmd._COb
        # don't do anything else yet...wait for finish_launching() call