[weboob] [patch] pipe support for webcontentedit

Laurent Bachelier laurent at bachelier.name
Sun Mar 10 15:30:33 CET 2013


On 2013-03-09 15:09, Goffi wrote:
> - not a big deal but "id" is used as a variable name, as it is a
> reserved word is should be renamed
We usually rename them to _id. However we never call id() so it's not a
big deal; some code analyzers complain though.

> - is there a way to give arguments to a command ? Currently I have to
> use default values for message (commit message) and minor (say if it's a
> major change or not), i.e. empty string and False, but I'd like to be
> able to give them when in push my text, something like:
> webcontentedit my_page --message "bla bla" --minor <
> my_new_page_content.txt

This is more or less possible.
We do not support arguments for a command yet. It's planned to have
something better (using shlex+argparse), but for now, you can add
application-level options, but it isn't ideal (requires restarting the
application if you use REPL and is not very user friendly as you don't
know which options are specific to a command).
Or you could do your own parsing in the command, which is going to be
annoying fast.

See for example add_application_options() in pastoob: the options are
only used for the "post" command, but they are global.


> - I also think there should be a "get" command, webcontentedit could
> also be used to just get some information (e.g.: wikipedia article, or
> wiktionary definition).
There is definitively room for improvement, I think your proposal of
having push/get in addition of edit could be nice.


More information about the weboob mailing list