import pywikibot
import re
from pywikibot import pagegenerators
site = pywikibot.Site('en', 'wikipedia')
errorpage = pywikibot.Page(site, u"User:PearBOT/Infobox request problems")
checkpage = pywikibot.Page(site, u"User:PearBOT/Infobox request checkpage")
for item in pywikibot.data.api.ListGenerator('categorymembers', cmtitle=oldCat.title(),cmprop='title|sortkey', cmnamespace='10',cmlimit='max'):
checkpagetemplates=pywikibot.textlib.extract_templates_and_params(checkpage.text,remove_disabled_parts="yes",strip = "yes")
for project in checkpagetemplates
    if project[0] 
pages=getCategory(category, arg='[deprecated name of category]')
for
for page in pages:
    article=page
    talkpage
    print(x[0])
    if x[0] == "Aircraft specifications" or x[0] =="Aircraft specification" or x[0] == "Airtemp-test" or x[0] == "Airtemp-test" or x[0] == "aircraft specifications" or x[0] =="aircraft specification" or x[0] == "airtemp-test" or x[0] == "airtemp-test":
        parameters=x[1]
        print(x[1])
        if re.search(" (m|meter|metre|centimeter|centimeter|cm)",parameters.get("length main")):
            metric=true
            print("true")
        elif re.search(" (in|ft|inches|feet|foot|inch)",parameters.get("length main")):
            metric=false
            print("false")
        else:
            errorpage.text += "*Unknown prime unit at " 
            errorpage.text += page.full_url()
            errorpage.save("Added primeunit problem")
            print("else")
            break
        print(page.full_url())
        print(metric)
#print(templates[2].get("plane or copter?"))
#page.text = text
#page.save(u"Bot test")