from log_into_wiki import *
import re

site = login('me','zelda') # Set wiki
summary = 'Rename Modules' # Set summary

limit = 10
#startat_page = 'asdf'
lmt = 0
for p in site.allpages(namespace=828):
	if limit == lmt:
		break
	lmt += 1
	print(p.name)
	text = p.text()
	text_table = text.split('\n')
	newlines = []
	for line in text_table:
		newlines.append(re.sub(r"require\( *[\'\"]Module:Utils(.+?)['\"] *\)", r"require('Module:\1Util')",line))
	newtext = '\n'.join(newlines)
	if text != newtext:
		p.save(newtext)
05cb7fe13b409069a436f7a2813227083d93f611
<mask token>

<mask token>
for p in site.allpages(namespace=828):
    if limit == lmt:
        break
    lmt += 1
    print(p.name)
    text = p.text()
    text_table = text.split('\n')
    newlines = []
    for line in text_table:
        newlines.append(re.sub(
            'require\\( *[\\\'\\"]Module:Utils(.+?)[\'\\"] *\\)',
            "require('Module:\\1Util')", line))
    newtext = '\n'.join(newlines)
    if text != newtext:
        p.save(newtext)

<mask token>
site = login('me', 'zelda')
summary = 'Rename Modules'
limit = 10
lmt = 0
for p in site.allpages(namespace=828):
    if limit == lmt:
        break
    lmt += 1
    print(p.name)
    text = p.text()
    text_table = text.split('\n')
    newlines = []
    for line in text_table:
        newlines.append(re.sub(
            'require\\( *[\\\'\\"]Module:Utils(.+?)[\'\\"] *\\)',
            "require('Module:\\1Util')", line))
    newtext = '\n'.join(newlines)
    if text != newtext:
        p.save(newtext)

from log_into_wiki import *
import re
site = login('me', 'zelda')
summary = 'Rename Modules'
limit = 10
lmt = 0
for p in site.allpages(namespace=828):
    if limit == lmt:
        break
    lmt += 1
    print(p.name)
    text = p.text()
    text_table = text.split('\n')
    newlines = []
    for line in text_table:
        newlines.append(re.sub(
            'require\\( *[\\\'\\"]Module:Utils(.+?)[\'\\"] *\\)',
            "require('Module:\\1Util')", line))
    newtext = '\n'.join(newlines)
    if text != newtext:
        p.save(newtext)

from log_into_wiki import *
import re

site = login('me','zelda') # Set wiki
summary = 'Rename Modules' # Set summary

limit = 10
#startat_page = 'asdf'
lmt = 0
for p in site.allpages(namespace=828):
	if limit == lmt:
		break
	lmt += 1
	print(p.name)
	text = p.text()
	text_table = text.split('\n')
	newlines = []
	for line in text_table:
		newlines.append(re.sub(r"require\( *[\'\"]Module:Utils(.+?)['\"] *\)", r"require('Module:\1Util')",line))
	newtext = '\n'.join(newlines)
	if text != newtext:
		p.save(newtext)