Pywikibot has a class ProofreadPage which allows modification of level via
simple attributes and methods.
https://github.com/wikimedia/pywikibot-core/blob/master/pywikibot/proofreadpage.py#L67
If you dont want to use Pywikibot, its code can be helpful and it can be
copied using very unrestrictive
2016-04-27 19:30 GMT+01:00 John Mark Vandenberg :
> Pywikibot has a class ProofreadPage which allows modification of level via
> simple attributes and methods.
>
> https://github.com/wikimedia/pywikibot-core/blob/master/pywikibot/proofreadpage.py#L67
>
> If you dont want to use Pywikibot, its code
import pywikibot
from pywikibot import proofreadpage
site = pywikibot.Site('ta','wikisource')
page = pywikibot.Page(site, u"Page:")
text = page.text
pa = proofreadpage.ProofreadPage(page)
pa.text = pa.text.replace('level="1"','level="3"')
pa.save(summary="demo")
===
When I ran the a