Thank you Thomas

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


2011/7/14 Thomas Holder <>
nice :)

The toggle() function can be much simplified:

def toggle(setting):
   setting_value = cmd.get(setting)
   if cmd.toggle_dict.get(setting_value, 0):

And you can add auto-completion for the setting name:

   'set_toggle'         : cmd.auto_arg[0]['set'],


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.

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.


Joseph ANDRE

Thomas Holder
MPI for Developmental Biology

Joseph ANDRE
11 Rue de Valence
75005 Paris - FRANCE

33(0)6 75 04 64 00