Hi PyMOLers -

Maybe some more experienced users/developers can help me out here.  I'm trying 
to write some automated test scripts for the plugin I'm writing, but the test 
functions end up running before the plugin is loaded.  Is there a way to tell 
if a plugin has been loaded from within a .pml or .py script?  For example, if 
the plugin makes commands available via `cmd.extend('my_func', my_func)`, how 
can I run `cmd.myfunc()` from a script and not have it execute before the 
plugin finishes loading?

I've tried something like this:

```
import time
from pymol import cmd
loaded = 0
while not loaded:
    try:
        cmd.my_func()  # if it's loaded no exception will be raised
        loaded = 1
    except:
        time.sleep(0.5)
```

But this just hangs, as apparently `time.sleep()` halts the execution of all 
threads, so the plugin won't ever be loaded.

Thanks,
Jared

--
Jared Sampson
Columbia University

------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
_______________________________________________
PyMOL-users mailing list (PyMOL-users@lists.sourceforge.net)
Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net

Reply via email to