[rfc] UIFactory.is_interactive()
Gordon Tyler
gordon at doxxx.net
Tue Nov 24 15:39:37 GMT 2009
Andrew Bennetts wrote:
>> This somewhat violates "don't look before you leap" but it's probably
>> worthwhile to avoid thinking about interactive stuff before you do it.
>
> Maybe a less LBYL solution would be:
>
> if not ui_factory.get_boolean("really delete everything?", default=True):
> return
> delete_everything()
>
> Although perhaps “default choice” is not precisely the same concept as “choice
> to take when non-interactive”, it's probably close enough.
If the parameter was made non-optional, then developers would be forced
to think about how to handle the non-interactive case, which I think
would be good for the overall behaviour of bzr in non-interactive
situations.
Ciao,
Gordon
More information about the bazaar
mailing list