Dvorapa added a comment.

I suggest to improve both pagefromfile.py and add_text.py/basic.py:

  • pagefromfile.py to make the batch uploading as easy as possible. It should be able to read from the stream, from one file or multiple files.
  • add_text.py/basic.py to make the single page change as easy as possible. It should be able to edit redirects, replace the whole page, create missing page and read from piped input.
  • (probably rename those two scripts to something like single.py and multiple.py or something similar)

$ echo "{{-start-}}" > Test.wiki
$ echo "‘‘‘Test‘‘‘" >> Test.wiki
$ echo "Hello world" >> Test.wiki
$ echo "{{-stop-}}" >> Test.wiki
pwb.py pagefromfile -file:Test.wiki -notitle

This should work too if page does not exist:

$ echo "Hello world" > Test.wiki
$ python pwb.py add_text -text:"$(cat Test.wiki)" -page:"Test"

TASK DETAIL
https://phabricator.wikimedia.org/T198817

EMAIL PREFERENCES
https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: Dvorapa
Cc: zhuyifei1999, saper, Zoranzoki21, Xqt, Dvorapa, pywikibot-bugs-list, Framawiki, Aklapper, David_Hedlund, Magul, Tbscho, MayS, Mdupont, JJMC89, Avicennasis, mys_721tx, jayvdb, Dalba, Masti, Alchimista, Rxy
_______________________________________________
pywikibot-bugs mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/pywikibot-bugs

Reply via email to