Add new addtext command
Closes off #1 (closed).
I ended up trying to generalise it a little further from appendtext
to a addtext
command with different actions (like --append
and --prepend
). We might want to do things like nextto
or beforethis
etc).
One thing to note. I did notice there was a settext command already done but it had some one issue in it (I had to change requests.post(requesturl, params=data)
to requests.post(requesturl, data=data)
). I am not sure if it is useful to have two commands that change text but there were some other cool options in the settext
argument parser. Should settext
and addtext
be the same command in the end?
Here's how I tested this (using Docker to bring up a new testing etherpad-lite):
$ docker run --name etherpadtest -d -p 80:9001 etherpad/etherpad
$ docker exec -it etherpadtest cat /opt/etherpad/APIKEY.txt
$ virtualenv --python=python3 .venv && source .venv/bin/activate
$ pip install -e . # install locally the modified etherdump
$ etherdump init
$ # go and create a pad with padID barbar on localhost:80
$ etherdump addtext barbar "\n\n\n__NOPUBLISH__\n\n\n" --append
$ etherdump addtext barbar "\n\n\n__NOPUBLISH__\n\n\n" --prepend
$ etherdump addtext barbar "\n\n\n__NOPUBLISH__\n\n\n" --append --noduplicate
$ etherdump addtext barbar "error" # complain about the missing action
$ etherdump addtext barbar "error" --append --prepend # complain about two actions
Edited by decentral1se