[rfc] developer documentation on user interaction

John Arbash Meinel john at arbash-meinel.com
Sun Sep 27 20:18:43 BST 2009


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Martin Pool wrote:
> 2009/9/25 Vincent Ladeuil <v.ladeuil+lp at free.fr>:
>>    martin> It's not very consistently used and that to me
>>    martin> indicates it's probably not the right interface.
>>
>> Hmm, to be honest, I think it's caused by the feature not being
>> implemented properly.
>>
>> I seem to recall that you could very easily end up with command
>> objects where outf is not set for example.
> 
> I haven't seen that particular thing, but I can believe it.  I have
> seen things where it's not present in the place you want to use it.


It only happens when 3rd party plugins directly run commands.

Specifically, _setup_outf() is set by run_argv() because in *bzr* that
always runs before run().

So when a plugin runs, people want to do:

cmd = cmd_merge()
cmd.run(location=X, ...)

what they end up needing to do is:

cmd = cmd_merge()
cmd._setup_outf()
cmd.run(location=X, ...)



> 
> Some British politician -- I can't remember who, and it's irrelevant
> --  promised to be "tough on crime, and tough on the causes of crime"
> and I think one ought to look similarly at APIs that seem to be
> inconsistently used or inconsistently implemented.
> 
> To me, the function of "I need to talk to the user" or "I need to
> produce bulk redirectable output" is only weakly related to being
> invoked through the commandline interface, so it doesn't really belong
> there.
> 

John
=:->

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkq/upIACgkQJdeBCYSNAAMppwCcDcZsGdF2jpL50ivQd4A0rvzs
dzMAoMjd0KtmqIi3hQa4RfKY5FiBSSSg
=f1Kx
-----END PGP SIGNATURE-----



More information about the bazaar mailing list