command.py (pymol-v1.8.6.0.tar.bz2) | : | command.py (pymol-v2.1.0.tar.bz2) | ||
---|---|---|---|---|
skipping to change at line 15 | skipping to change at line 15 | |||
except ImportError: | except ImportError: | |||
from itertools import zip_longest as izip_longest | from itertools import zip_longest as izip_longest | |||
from pymol import cmd, stored, wizard | from pymol import cmd, stored, wizard | |||
class Command(wizard.Wizard): | class Command(wizard.Wizard): | |||
''' | ''' | |||
Generic wizard for any PyMOL command. | Generic wizard for any PyMOL command. | |||
''' | ''' | |||
async = 1 | async_ = 1 | |||
ignored_args = ('quiet',) | ignored_args = ('quiet',) | |||
def __init__(self, command, _self=cmd): | def __init__(self, command, _self=cmd): | |||
import inspect | import inspect | |||
self.input_arg = None | self.input_arg = None | |||
self.input_value = None | self.input_value = None | |||
self.input_numeric = False | self.input_numeric = False | |||
wizard.Wizard.__init__(self, _self) | wizard.Wizard.__init__(self, _self) | |||
skipping to change at line 77 | skipping to change at line 77 | |||
self.set_menu_values(arg, sc.keywords[:20]) | self.set_menu_values(arg, sc.keywords[:20]) | |||
except KeyError: | except KeyError: | |||
pass | pass | |||
return self.menu[arg] | return self.menu[arg] | |||
def set_current(self, k, v): | def set_current(self, k, v): | |||
self.current[k] = v | self.current[k] = v | |||
self.cmd.refresh_wizard() | self.cmd.refresh_wizard() | |||
def run(self): | def run(self): | |||
if self.async: | if self.async_: | |||
self.cmd.async(self.func, **self.current) | self.cmd.async_(self.func, **self.current) | |||
else: | else: | |||
self.func(**self.current) | self.func(**self.current) | |||
def cleanup(self): | def cleanup(self): | |||
delattr(stored, self.stored_name) | delattr(stored, self.stored_name) | |||
def get_panel(self): | def get_panel(self): | |||
if self.input_arg: | if self.input_arg: | |||
return [ | return [ | |||
[1, 'Input', ''], | [1, 'Input', ''], | |||
End of changes. 2 change blocks. | ||||
3 lines changed or deleted | 3 lines changed or added |