For some reason David, you have to pass the **kwargs keyword list too. I'm not 
sure why but this worked for me,

python
from pymol import cmd, stored, CmdException

class Helix():
    def __init__(self,selection):
        self.selection = selection

def my_module(*args,**kwargs):
    helices = [Helix(x) for x in args]
    for helix in helices:
        print helix.selection 
cmd.extend("my_module",my_module)
python end


On Oct 8, 2013, at 11:59 AM, David Johnson <da.johnso...@gmail.com> wrote:

> from pymol import cmd, stored, CmdException
> 
> class Helix(object):
>     def __init__(self):
>         self.selection = None
> 
> def my_module(*selections):
>     helices = [Helix() for x in selections]
>     for helix, sele in zip(helices, selections):
>         helix.selection = sele

------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60134071&iu=/4140/ostg.clktrk
_______________________________________________
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