Thank you Thomas

I've updated the scripts following your recommendation.
I wasn't aware of the auto-completion methods. It's great.

Cheers

2011/7/14 Thomas Holder <spel...@users.sourceforge.net>

> nice :)
>
> The toggle() function can be much simplified:
>
> def toggle(setting):
>    setting_value = cmd.get(setting)
>    if cmd.toggle_dict.get(setting_**value, 0):
>        cmd.unset(setting)
>    else:
>        cmd.set(setting)
>
> And you can add auto-completion for the setting name:
>
> cmd.auto_arg[1].update({
>    'set_toggle'         : cmd.auto_arg[0]['set'],
> })
>
> Cheers,
>  Thomas
>
>
> On 07/14/2011 02:10 PM, Joseph André wrote:
>
>> Hi PyMOLers,
>>
>> I was tired of always typing the same commands to change *grid_mode* or
>> *seq_view*... I know it is possible to use set_key to define action but
>> I want a key to enable/disable some settings. I wrote a small script
>> that binds a key to a setting accepting 0/1 or on/off value.
>>
>> http://pymolwiki.org/index.**php/Set_toggle<http://pymolwiki.org/index.php/Set_toggle>
>>
>> It works as is but I'll add other features such as help, check that key
>> is not already bound, check whether setting is known.
>>
>> Comments and suggestions are welcome.
>>
>> Thanks
>>
>> --
>> Joseph ANDRE
>>
>
> --
> Thomas Holder
> MPI for Developmental Biology
>



-- 
Joseph ANDRE
------------------------------------
11 Rue de Valence
75005 Paris - FRANCE

33(0)6 75 04 64 00
------------------------------------------------------------------------------
AppSumo Presents a FREE Video for the SourceForge Community by Eric 
Ries, the creator of the Lean Startup Methodology on "Lean Startup 
Secrets Revealed." This video shows you how to validate your ideas, 
optimize your ideas and identify your business strategy.
http://p.sf.net/sfu/appsumosfdev2dev
_______________________________________________
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