Bináris, A nice function for this does not currently exist for Page class. See https://phabricator.wikimedia.org/T325420.
I am working on this one so it is in progress. Hopefully this weekend I will finish the initial version of the changes and start the review process. There are several workarounds, one of which is adding to end of text, which you mentioned already. One other workaround is to use textlib.replaceCategoryLinks(). See https://doc.wikimedia.org/pywikibot/master/api_ref/textlib.html#textlib.replaceCategoryLinks . Thanks, Ethan On Tue, Jan 2, 2024 at 11:45 PM Bináris <wikipo...@gmail.com> wrote: > At https://doc.wikimedia.org/pywikibot/master/api_ref/pywikibot.page.html > I only find change_category which requires the old cat to be removed > present. > But how do I just add a new one w/o changing? > > OK, I can add it to the end of text, but that is not nice. > > -- > Bináris > _______________________________________________ > pywikibot mailing list -- pywikibot@lists.wikimedia.org > Public archives at > https://lists.wikimedia.org/hyperkitty/list/pywikibot@lists.wikimedia.org/message/YONEOOAH3N2SCACV2Q7QMQGOS3CNBFJA/ > To unsubscribe send an email to pywikibot-le...@lists.wikimedia.org >
_______________________________________________ pywikibot mailing list -- pywikibot@lists.wikimedia.org Public archives at https://lists.wikimedia.org/hyperkitty/list/pywikibot@lists.wikimedia.org/message/OQZ64BNMCU6W5NC2LMXTC74ZAFNS5YLB/ To unsubscribe send an email to pywikibot-le...@lists.wikimedia.org