def __call__(self, *args, **kwargs): if self.disabled: kwargs['disabled'] = 'disabled' return TextInput.__call__(self, *args, **kwargs)
def __init__(self, disabled, *args, **kwargs): self.disabled = disabled TextInput.__init__(self, *args, **kwargs)