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 <firstname.lastname@example.org>
The toggle() function can be much simplified:
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['set'],
On 07/14/2011 02:10 PM, Joseph André wrote:
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.
MPI for Developmental Biology
11 Rue de Valence
75005 Paris - FRANCE