User:QuasiBot/conjdata.py
Jump to navigation
Jump to search
# Conjdata module
from general import *
site = getSite(language, family)
config.put_throttle = 2
put_throttle.setDelay()
pagelist_1st_row1 = ['{0}as', '{0}at', '{0}amus', '{0}atis', '{0}ant']
pagelist_1st_row2 = ['{0}abo', '{0}abis', '{0}abit', '{0}abimus', '{0}abitis', '{0}abunt']
pagelist_1st_row3 = ['{0}abam', '{0}abas', '{0}abat', '{0}abamus', '{0}abatis', '{0}abant']
pagelist_1st_row4 = ['{1}i', '{1}isti', '{1}it', '{1}imus', '{1}istis', '{1}erunt']
pagelist_1st_row5 = ['{1}ero', '{1}eris', '{1}erit', '{1}erimus', '{1}eritis', '{1}erint']
pagelist_1st_row6 = ['{1}eram', '{1}eras', '{1}erat', '{1}eramus', '{1}eratis', '{1}erant']
pagelist_1st_row7 = ['{0}or', '{0}aris', '{0}atur', '{0}amur', '{0}amini', '{0}antur']
pagelist_1st_row8 = ['{0}abor', '{0}aberis', '{0}abitur', '{0}abimur', '{0}abimini', '{0}abuntur']
pagelist_1st_row9 = ['{0}abar', '{0}abaris', '{0}abatur', '{0}abamur', '{0}abamini', '{0}abantur']
pagelist_1st_row10 = ['{0}em', '{0}es', '{0}et', '{0}emus', '{0}etis', '{0}ent']
pagelist_1st_row11 = ['{0}arem', '{0}ares', '{0}aret', '{0}aremus', '{0}aretis', '{0}arent']
pagelist_1st_row12 = ['{1}erim']
pagelist_1st_row13 = ['{1}issem', '{1}isses', '{1}isset', '{1}issemus', '{1}issetis', '{1}issent']
pagelist_1st_row14 = ['{0}er', '{0}eris', '{0}etur', '{0}emur', '{0}emini', '{0}entur']
pagelist_1st_row15 = ['{0}arer', '{0}areris', '{0}aretur', '{0}aremur', '{0}aremini', '{0}arentur']
pagelist_1st_ind = pagelist_1st_row1 + pagelist_1st_row2 + pagelist_1st_row3 + pagelist_1st_row4 + pagelist_1st_row5 + pagelist_1st_row6 + pagelist_1st_row7 + pagelist_1st_row8 + pagelist_1st_row9
pagelist_1st_sub = pagelist_1st_row10 + pagelist_1st_row11 + pagelist_1st_row12 + pagelist_1st_row13 + pagelist_1st_row14 + pagelist_1st_row15
pagelist_1st_imp = ['{0}a', '{0}ato', '{0}ate', '{0}atote', '{0}anto', '{0}are', '{0}ator', '{0}antor']
pagelist_1st_inf = ['{1}isse', '{0}ari', '{2}um']
pagelist_1st_p0 = pagelist_1st_ind + pagelist_1st_sub + pagelist_1st_imp + pagelist_1st_inf
pagelist_1st_part = ['{0}ans', '{2}urus', '{2}us', '{0}andus']
pagelist_1st_p1 = pagelist_1st_part
pagelist_1st_part1 = ['{0}antis', '{0}anti', '{0}antem', '{0}ante', '{0}antes', '{0}antia', '{0}antium', '{0}antibus']
pagelist_1st_part2 = ['{2}ura', '{2}urum', '{2}uri', '{2}urae', '{2}uro', '{2}uram', '{2}ure', '{2}urorum', '{2}urarum', '{2}uris', '{2}uros', '{2}uras']
pagelist_1st_part3 = ['{2}a', '{2}um', '{2}i', '{2}ae', '{2}o', '{2}am', '{2}e', '{2}orum', '{2}arum', '{2}is', '{2}os', '{2}as']
pagelist_1st_part4 = ['{0}anda', '{0}andum', '{0}andi', '{0}andae', '{0}ando', '{0}andam', '{0}ande', '{0}andorum', '{0}andarum', '{0}andis', '{0}andos', '{0}andas']
pagelist_1st_p2 = pagelist_1st_part1 + pagelist_1st_part2 + pagelist_1st_part3 + pagelist_1st_part4
pagelist_2nd_row1 = ['{0}es', '{0}et', '{0}emus', '{0}etis', '{0}ent']
pagelist_2nd_row2 = ['{0}ebo', '{0}ebis', '{0}ebit', '{0}ebimus', '{0}ebitis', '{0}ebunt']
pagelist_2nd_row3 = ['{0}ebam', '{0}ebas', '{0}ebat', '{0}ebamus', '{0}ebatis', '{0}ebant']
pagelist_2nd_row4 = ['{1}i', '{1}isti', '{1}it', '{1}imus', '{1}istis', '{1}erunt']
pagelist_2nd_row5 = ['{1}ero', '{1}eris', '{1}erit', '{1}erimus', '{1}eritis', '{1}erint']
pagelist_2nd_row6 = ['{1}eram', '{1}eras', '{1}erat', '{1}eramus', '{1}eratis', '{1}erant']
pagelist_2nd_row7 = ['{0}eor', '{0}eris', '{0}etur', '{0}emur', '{0}emini', '{0}entur']
pagelist_2nd_row8 = ['{0}ebor', '{0}eberis', '{0}ebitur', '{0}ebimur', '{0}ebimini', '{0}ebuntur']
pagelist_2nd_row9 = ['{0}ebar', '{0}ebaris', '{0}ebatur', '{0}ebamur', '{0}ebamini', '{0}ebantur']
pagelist_2nd_ind = pagelist_2nd_row1 + pagelist_2nd_row2 + pagelist_2nd_row3 + pagelist_2nd_row4 + pagelist_2nd_row5 + pagelist_2nd_row6 + pagelist_2nd_row7 + pagelist_2nd_row8 + pagelist_2nd_row9
pagelist_2nd_row10 = ['{0}eam', '{0}eas', '{0}eat', '{0}eamus', '{0}eatis', '{0}eant']
pagelist_2nd_row11 = ['{0}erem', '{0}eres', '{0}eret', '{0}eremus', '{0}eretis', '{0}erent']
pagelist_2nd_row12 = ['{1}erim']
pagelist_2nd_row13 = ['{1}issem', '{1}isses', '{1}isset', '{1}issemus', '{1}issetis', '{1}issent']
pagelist_2nd_row14 = ['{0}ear', '{0}earis', '{0}eatur', '{0}eamur', '{0}eamini', '{0}eantur']
pagelist_2nd_row15 = ['{0}erer', '{0}ereris', '{0}eretur', '{0}eremur', '{0}eremini', '{0}erentur']
pagelist_2nd_sub = pagelist_2nd_row10 + pagelist_2nd_row11 + pagelist_2nd_row12 + pagelist_2nd_row13 + pagelist_2nd_row14 + pagelist_2nd_row15
pagelist_2nd_imp = ['{0}e', '{0}eto', '{0}ete', '{0}etote', '{0}ento', '{0}ere', '{0}etor', '{0}entor']
pagelist_2nd_inf = ['{1}isse', '{0}eri', '{2}um']
pagelist_2nd_p0 = pagelist_2nd_ind + pagelist_2nd_sub + pagelist_2nd_imp + pagelist_2nd_inf
pagelist_2nd_part = ['{0}ens', '{2}urus', '{2}us', '{0}endus']
pagelist_2nd_p1 = pagelist_2nd_part
pagelist_2nd_part1 = ['{0}entis', '{0}enti', '{0}entem', '{0}ente', '{0}entes', '{0}entia', '{0}entium', '{0}entibus']
pagelist_2nd_part2 = ['{2}ura', '{2}urum', '{2}uri', '{2}urae', '{2}uro', '{2}uram', '{2}ure', '{2}urorum', '{2}urarum', '{2}uris', '{2}uros', '{2}uras']
pagelist_2nd_part3 = ['{2}a', '{2}um', '{2}i', '{2}ae', '{2}o', '{2}am', '{2}e', '{2}orum', '{2}arum', '{2}is', '{2}os', '{2}as']
pagelist_2nd_part4 = ['{0}enda', '{0}endum', '{0}endi', '{0}endae', '{0}endo', '{0}endam', '{0}ende', '{0}endorum', '{0}endarum', '{0}endis', '{0}endos', '{0}endas']
pagelist_2nd_p2 = pagelist_2nd_part1 + pagelist_2nd_part2 + pagelist_2nd_part3 + pagelist_2nd_part4
pagelist_3rd_row1 = ['{0}is', '{0}it', '{0}imus', '{0}itis', '{0}unt']
pagelist_3rd_row2 = ['{0}am', '{0}es', '{0}et', '{0}emus', '{0}etis', '{0}ent']
pagelist_3rd_row3 = ['{0}ebam', '{0}ebas', '{0}ebat', '{0}ebamus', '{0}ebatis', '{0}ebant']
pagelist_3rd_row4 = ['{1}i', '{1}isti', '{1}it', '{1}imus', '{1}istis', '{1}erunt']
pagelist_3rd_row5 = ['{1}ero', '{1}eris', '{1}erit', '{1}erimus', '{1}eritis', '{1}erint']
pagelist_3rd_row6 = ['{1}eram', '{1}eras', '{1}erat', '{1}eramus', '{1}eratis', '{1}erant']
pagelist_3rd_row7 = ['{0}or', '{0}eris', '{0}itur', '{0}imur', '{0}imini', '{0}untur']
pagelist_3rd_row8 = ['{0}ar', '{0}etur', '{0}emur', '{0}emini', '{0}entur']
pagelist_3rd_row9 = ['{0}ebar', '{0}ebaris', '{0}ebatur', '{0}ebamur', '{0}ebamini', '{0}ebantur']
pagelist_3rd_nopass_ind = pagelist_3rd_row1 + pagelist_3rd_row2 + pagelist_3rd_row3 + pagelist_3rd_row4 + pagelist_3rd_row5 + pagelist_3rd_row6
pagelist_3rd_ind = pagelist_3rd_nopass_ind + pagelist_3rd_row7 + pagelist_3rd_row8 + pagelist_3rd_row9
pagelist_3rd_row10 = ['{0}as', '{0}at', '{0}amus', '{0}atis', '{0}ant']
pagelist_3rd_row11 = ['{0}erem', '{0}eres', '{0}eret', '{0}eremus', '{0}eretis', '{0}erent']
pagelist_3rd_row12 = ['{1}erim']
pagelist_3rd_row13 = ['{1}issem', '{1}isses', '{1}isset', '{1}issemus', '{1}issetis', '{1}issent']
pagelist_3rd_row14 = ['{0}aris', '{0}atur', '{0}amur', '{0}amini', '{0}antur']
pagelist_3rd_row15 = ['{0}erer', '{0}ereris', '{0}eretur', '{0}eremur', '{0}eremini', '{0}erentur']
pagelist_3rd_nopass_sub = pagelist_3rd_row10 + pagelist_3rd_row11 + pagelist_3rd_row12 + pagelist_3rd_row13
pagelist_3rd_sub = pagelist_3rd_nopass_sub + pagelist_3rd_row14 + pagelist_3rd_row15
pagelist_3rd_imp = ['{0}e', '{0}ito', '{0}ite', '{0}itote', '{0}unto', '{0}ere', '{0}itor', '{0}untor']
pagelist_3rd_nopass_imp = ['{0}e', '{0}ito', '{0}ite', '{0}itote', '{0}unto']
pagelist_3rd_inf = ['{1}isse', '{0}i', '{2}um']
pagelist_3rd_nopass_inf = ['{1}isse', '{2}um']
pagelist_3rd_p0 = pagelist_3rd_ind + pagelist_3rd_sub + pagelist_3rd_imp + pagelist_3rd_inf
pagelist_3rd_nopass_p0 = pagelist_3rd_nopass_ind + pagelist_3rd_nopass_sub + pagelist_3rd_nopass_imp + pagelist_3rd_nopass_inf
pagelist_3rd_part = ['{0}ens', '{2}urus', '{2}us', '{0}endus']
pagelist_3rd_nopass_part = ['{0}ens', '{2}urus']
pagelist_3rd_p1 = pagelist_3rd_part
pagelist_3rd_nopass_p1 = pagelist_3rd_nopass_part
pagelist_3rd_part1 = ['{0}entis', '{0}enti', '{0}entem', '{0}ente', '{0}entes', '{0}entia', '{0}entium', '{0}entibus']
pagelist_3rd_part2 = ['{2}ura', '{2}urum', '{2}uri', '{2}urae', '{2}uro', '{2}uram', '{2}ure', '{2}urorum', '{2}urarum', '{2}uris', '{2}uros', '{2}uras']
pagelist_3rd_part3 = ['{2}a', '{2}um', '{2}i', '{2}ae', '{2}o', '{2}am', '{2}e', '{2}orum', '{2}arum', '{2}is', '{2}os', '{2}as']
pagelist_3rd_part4 = ['{0}enda', '{0}endum', '{0}endi', '{0}endae', '{0}endo', '{0}endam', '{0}ende', '{0}endorum', '{0}endarum', '{0}endis', '{0}endos', '{0}endas']
pagelist_3rd_p2 = pagelist_3rd_part1 + pagelist_3rd_part2 + pagelist_3rd_part3 + pagelist_3rd_part4
pagelist_3rd_nopass_p2 = pagelist_3rd_part1 + pagelist_3rd_part2
pagelist_3rd_IO_row1 = ['{0}is', '{0}it', '{0}imus', '{0}itis', '{0}iunt']
pagelist_3rd_IO_row2 = ['{0}iam', '{0}ies', '{0}iet', '{0}iemus', '{0}ietis', '{0}ient']
pagelist_3rd_IO_row3 = ['{0}iebam', '{0}iebas', '{0}iebat', '{0}iebamus', '{0}iebatis', '{0}iebant']
pagelist_3rd_IO_row4 = ['{1}i', '{1}isti', '{1}it', '{1}imus', '{1}istis', '{1}erunt']
pagelist_3rd_IO_row5 = ['{1}ero', '{1}eris', '{1}erit', '{1}erimus', '{1}eritis', '{1}erint']
pagelist_3rd_IO_row6 = ['{1}eram', '{1}eras', '{1}erat', '{1}eramus', '{1}eratis', '{1}erant']
pagelist_3rd_IO_row7 = ['{0}ior', '{0}eris', '{0}itur', '{0}imur', '{0}imini', '{0}iuntur']
pagelist_3rd_IO_row8 = ['{0}iar', '{0}ieris', '{0}ietur', '{0}iemur', '{0}iemini', '{0}ientur']
pagelist_3rd_IO_row9 = ['{0}iebar', '{0}iebaris', '{0}iebatur', '{0}iebamur', '{0}iebamini', '{0}iebantur']
pagelist_3rd_IO_ind = pagelist_3rd_IO_row1 + pagelist_3rd_IO_row2 + pagelist_3rd_IO_row3 + pagelist_3rd_IO_row4 + pagelist_3rd_IO_row5 + pagelist_3rd_IO_row6 + pagelist_3rd_IO_row7 + pagelist_3rd_IO_row8 + pagelist_3rd_IO_row9
pagelist_3rd_IO_row10 = ['{0}ias', '{0}iat', '{0}iamus', '{0}iatis', '{0}iant']
pagelist_3rd_IO_row11 = ['{0}erem', '{0}eres', '{0}eret', '{0}eremus', '{0}eretis', '{0}erent']
pagelist_3rd_IO_row12 = ['{1}erim']
pagelist_3rd_IO_row13 = ['{1}issem', '{1}isses', '{1}isset', '{1}issemus', '{1}issetis', '{1}issent']
pagelist_3rd_IO_row14 = ['{0}iaris', '{0}iatur', '{0}iamur', '{0}iamini', '{0}iantur']
pagelist_3rd_IO_row15 = ['{0}erer', '{0}ereris', '{0}eretur', '{0}eremur', '{0}eremini', '{0}erentur']
pagelist_3rd_IO_sub = pagelist_3rd_IO_row10 + pagelist_3rd_IO_row11 + pagelist_3rd_IO_row12 + pagelist_3rd_IO_row13 + pagelist_3rd_IO_row14 + pagelist_3rd_IO_row15
pagelist_3rd_IO_imp = ['{0}e', '{0}ito', '{0}ite', '{0}itote', '{0}iunto', '{0}ere', '{0}itor', '{0}iuntor']
pagelist_3rd_IO_inf = ['{1}isse', '{0}i', '{2}um']
pagelist_3rd_IO_p0 = pagelist_3rd_IO_ind + pagelist_3rd_IO_sub + pagelist_3rd_IO_imp + pagelist_3rd_IO_inf
pagelist_3rd_IO_part = ['{0}iens', '{2}urus', '{2}us', '{0}iendus']
pagelist_3rd_IO_p1 = pagelist_3rd_IO_part
pagelist_3rd_IO_part1 = ['{0}ientis', '{0}ienti', '{0}ientem', '{0}iente', '{0}ientes', '{0}ientia', '{0}ientium', '{0}ientibus']
pagelist_3rd_IO_part2 = ['{2}ura', '{2}urum', '{2}uri', '{2}urae', '{2}uro', '{2}uram', '{2}ure', '{2}urorum', '{2}urarum', '{2}uris', '{2}uros', '{2}uras']
pagelist_3rd_IO_part3 = ['{2}a', '{2}um', '{2}i', '{2}ae', '{2}o', '{2}am', '{2}e', '{2}orum', '{2}arum', '{2}is', '{2}os', '{2}as']
pagelist_3rd_IO_part4 = ['{0}ienda', '{0}iendum', '{0}iendi', '{0}iendae', '{0}iendo', '{0}iendam', '{0}iende', '{0}iendorum', '{0}iendarum', '{0}iendis', '{0}iendos', '{0}iendas']
pagelist_3rd_IO_p2 = pagelist_3rd_IO_part1 + pagelist_3rd_IO_part2 + pagelist_3rd_IO_part3 + pagelist_3rd_IO_part4
pagelist_4th_row1 = ['{0}io', '{0}is', '{0}it', '{0}imus', '{0}itis', '{0}iunt']
pagelist_4th_row2 = ['{0}iam', '{0}ies', '{0}iet', '{0}iemus', '{0}ietis', '{0}ient']
pagelist_4th_row3 = ['{0}iebam', '{0}iebas', '{0}iebat', '{0}iebamus', '{0}iebatis', '{0}iebant']
pagelist_4th_row4 = ['{1}i', '{1}isti', '{1}it', '{1}imus', '{1}istis', '{1}erunt']
pagelist_4th_row5 = ['{1}ero', '{1}eris', '{1}erit', '{1}erimus', '{1}eritis', '{1}erint']
pagelist_4th_row6 = ['{1}eram', '{1}eras', '{1}erat', '{1}eramus', '{1}eratis', '{1}erant']
pagelist_4th_row7 = ['{0}ior', '{0}iris', '{0}itur', '{0}imur', '{0}imini', '{0}iuntur']
pagelist_4th_row8 = ['{0}iar', '{0}ieris', '{0}ietur', '{0}iemur', '{0}iemini', '{0}ientur']
pagelist_4th_row9 = ['{0}iebar', '{0}iebaris', '{0}iebatur', '{0}iebamur', '{0}iebamini', '{0}iebantur']
pagelist_4th_row10 = ['{0}iam', '{0}ias', '{0}iat', '{0}iamus', '{0}iatis', '{0}iant']
pagelist_4th_row11 = ['{0}irem', '{0}ires', '{0}iret', '{0}iremus', '{0}iretis', '{0}irent']
pagelist_4th_row12 = ['{1}erim', '{1}eris', '{1}erit', '{1}erimus', '{1}eritis', '{1}erint']
pagelist_4th_row13 = ['{1}issem', '{1}isses', '{1}isset', '{1}issemus', '{1}issetis', '{1}issent']
pagelist_4th_row14 = ['{0}iar', '{0}iaris', '{0}iatur', '{0}iamur', '{0}iamini', '{0}iantur']
pagelist_4th_row15 = ['{0}irer', '{0}ireris', '{0}iretur', '{0}iremur', '{0}iremini', '{0}irentur']
pagelist_4th_nopass_ind = pagelist_4th_row1 + pagelist_4th_row2 + pagelist_4th_row3 + pagelist_4th_row4 + pagelist_4th_row5 + pagelist_4th_row6
pagelist_4th_ind = pagelist_4th_nopass_ind + pagelist_4th_row7 + pagelist_4th_row8 + pagelist_4th_row9
pagelist_4th_nopass_sub = pagelist_4th_row10 + pagelist_4th_row11 + pagelist_4th_row12 + pagelist_4th_row13
pagelist_4th_sub = pagelist_4th_nopass_sub + pagelist_4th_row14 + pagelist_4th_row15
pagelist_4th_nopass_imp = ['{0}i', '{0}ito', '{0}ite', '{0}itote', '{0}iunto']
pagelist_4th_imp = pagelist_4th_nopass_imp + ['{0}ire', '{0}itor', '{0}imini', '{0}iuntor']
pagelist_4th_nopass_inf = ['{0}ire', '{1}isse']
pagelist_4th_inf = ['{0}ire', '{1}isse', '{0}iri', '{2}um']
pagelist_4th_nopass_part = ['{0}iens', '{2}urus']
pagelist_4th_part = ['{0}iens', '{2}urus', '{2}us', '{0}iendus']
pagelist_4th_part1 = ['{0}ientis', '{0}ienti', '{0}ientem', '{0}iente', '{0}ientes', '{0}ientia', '{0}ientium', '{0}ientibus']
pagelist_4th_part2 = ['{2}ura', '{2}urum', '{2}uri', '{2}urae', '{2}uro', '{2}uram', '{2}ure', '{2}urorum', '{2}urarum', '{2}uris', '{2}uros', '{2}uras']
pagelist_4th_part3 = ['{2}a', '{2}um', '{2}i', '{2}ae', '{2}o', '{2}am', '{2}e', '{2}orum', '{2}arum', '{2}is', '{2}os', '{2}as']
pagelist_4th_part4 = ['{0}ienda', '{0}iendum', '{0}iendi', '{0}iendae', '{0}iendo', '{0}iendam', '{0}iende', '{0}iendorum', '{0}iendarum', '{0}iendis', '{0}iendos', '{0}iendas']
pagelist_4th_nopass_p0 = pagelist_4th_nopass_ind + pagelist_4th_nopass_sub + pagelist_4th_nopass_imp + pagelist_4th_nopass_inf
pagelist_4th_nopass_p1 = pagelist_4th_nopass_part
pagelist_4th_nopass_p2 = pagelist_4th_part1 + pagelist_4th_part2
pagelist_4th_p0 = pagelist_4th_ind + pagelist_4th_sub + pagelist_4th_imp + pagelist_4th_inf
pagelist_4th_p1 = pagelist_4th_part
pagelist_4th_p2 = pagelist_4th_nopass_p2 + pagelist_4th_part3 + pagelist_4th_part4
def upload(pagelist, lemmaX, stem11, stem22, stem33, p=100):
if p==0:
preload = '{{subst:User:QuasiBot|' + lemmaX + '}}'
autominor = True
elif p==1:
preload = '{{subst:User:QuasiBot|' + lemmaX + '|p=1}}'
autominor = False
elif p==2:
preload = '{{subst:User:QuasiBot/part|' + lemmaX + '}}'
autominor = True
else:
print "ERROR: Wrong p parameter."
pagelist = []
autosummary = 'preloading ' + preload + ' with Python & pywikibot'
pageexists = []
for mypage in pagelist:
mypage2 = mypage.format(stem11, stem22, stem33)
page = Page(site, mypage2)
try:
pagetext = page.get()
pageexists.append(mypage2)
print "Page", mypage2, "already exists."
except NoPage:
page.put(preload, comment=autosummary, minorEdit=autominor)
return pageexists
def uploadAll(pagelist0, pagelist1, pagelist2, lemmaX, stem11, stem22, stem33):
pageexists_all=[]
pageexists_all = pageexists_all + upload(pagelist0, lemmaX, stem11, stem22, stem33, p=0)
pageexists_all = pageexists_all + upload(pagelist1, lemmaX, stem11, stem22, stem33, p=1)
pageexists_all = pageexists_all + upload(pagelist2, lemmaX, stem11, stem22, stem33, p=2)
return pageexists_all
def uploadDouble(pagelist_A, lemmaXa, stem11a, stem22a, stem33a, pagelist_B, lemmaXb, stem11b, stem22b, stem33b, p=100):
if p==0:
preload_A = '{{subst:User:QuasiBot|' + lemmaXa + '}}'
preload_B = '{{subst:User:QuasiBot|' + lemmaXb + '}}'
preload_AB = '{{subst:User:QuasiBot/double|' + lemmaXa + '|' + lemmaXb + '}}'
autominor = True
elif p==1:
preload_A = '{{subst:User:QuasiBot|' + lemmaXa + '|p=1}}'
preload_B = '{{subst:User:QuasiBot|' + lemmaXb + '|p=1}}'
preload_AB = '{{subst:User:QuasiBot/double|' + lemmaXa + '|' + lemmaXb + '|p=1}}'
autominor = False
elif p==2:
preload_A = '{{subst:User:QuasiBot/part|' + lemmaXa + '}}'
preload_B = '{{subst:User:QuasiBot/part|' + lemmaXb + '}}'
preload_AB = '{{subst:User:QuasiBot/double/part|' + lemmaXa + '|' + lemmaXb + '}}'
autominor = True
else:
print "ERROR: Wrong p parameter."
pagelist = []
autosummary_A = 'preloading ' + preload_A + ' with Python & pywikibot'
autosummary_B = 'preloading ' + preload_B + ' with Python & pywikibot'
autosummary_AB = 'preloading ' + preload_AB + ' with Python & pywikibot'
pageexists = []
pagelist_A_set = set(pagelist_A)
pagelist_B_set = set(pagelist_B)
pagelist_A_set_fmt = set([x.format(stem11a, stem22a, stem33a) for x in pagelist_A_set])
pagelist_B_set_fmt = set([x.format(stem11b, stem22b, stem33b) for x in pagelist_B_set])
pagelist_AB_set_fmt = pagelist_A_set_fmt & pagelist_B_set_fmt
pagelist_A_only_set_fmt = pagelist_A_set_fmt - pagelist_B_set_fmt
pagelist_B_only_set_fmt = pagelist_B_set_fmt - pagelist_A_set_fmt
for mypage in pagelist_A_only_set_fmt:
page = Page(site, mypage)
try:
pagetext = page.get()
pageexists.append(mypage)
print "Page", mypage, "already exists."
except NoPage:
page.put(preload_A, comment=autosummary_A, minorEdit=autominor)
for mypage in pagelist_AB_set_fmt:
page = Page(site, mypage)
try:
pagetext = page.get()
pageexists.append(mypage)
print "Page", mypage, "already exists."
except NoPage:
page.put(preload_AB, comment=autosummary_AB, minorEdit=autominor)
for mypage in pagelist_B_only_set_fmt:
page = Page(site, mypage)
try:
pagetext = page.get()
pageexists.append(mypage)
print "Page", mypage, "already exists."
except NoPage:
page.put(preload_B, comment=autosummary_B, minorEdit=autominor)
return pageexists
def uploadAllDouble(pagelist1a , pagelist2a , pagelist3a, lemmaXa, stem11a, stem22a, stem33a, pagelist1b, pagelist2b, pagelist3b, lemmaXb, stem11b, stem22b, stem33b):
pageexists_all_double=[]
pageexists_all_double = pageexists_all_double + uploadDouble(pagelist1a, lemmaXa, stem11a, stem22a, stem33a, pagelist1b, lemmaXb, stem11b, stem22b, stem33b, p=0)
pageexists_all_double = pageexists_all_double + uploadDouble(pagelist2a, lemmaXa, stem11a, stem22a, stem33a, pagelist2b, lemmaXb, stem11b, stem22b, stem33b, p=1)
pageexists_all_double = pageexists_all_double + uploadDouble(pagelist3a, lemmaXa, stem11a, stem22a, stem33a, pagelist3b, lemmaXb, stem11b, stem22b, stem33b, p=2)
return pageexists_all_double
def uploadTriple(pagelist_A, lemmaXa, stem11a, stem22a, stem33a, pagelist_B, lemmaXb, stem11b, stem22b, stem33b, pagelist_C, lemmaXc, stem11c, stem22c, stem33c, p=100):
if p==0:
preload_A = '{{subst:User:QuasiBot|' + lemmaXa + '}}'
preload_B = '{{subst:User:QuasiBot|' + lemmaXb + '}}'
preload_C = '{{subst:User:QuasiBot|' + lemmaXc + '}}'
preload_AB = '{{subst:User:QuasiBot/double|' + lemmaXa + '|' + lemmaXb + '}}'
preload_AC = '{{subst:User:QuasiBot/double|' + lemmaXa + '|' + lemmaXc + '}}'
preload_BC = '{{subst:User:QuasiBot/double|' + lemmaXb + '|' + lemmaXc + '}}'
preload_ABC = '{{subst:User:QuasiBot/triple|' + lemmaXa + '|' + lemmaXb + '|' + lemmaXc + '}}'
autominor = True
elif p==1:
preload_A = '{{subst:User:QuasiBot|' + lemmaXa + '|p=1}}'
preload_B = '{{subst:User:QuasiBot|' + lemmaXb + '|p=1}}'
preload_C = '{{subst:User:QuasiBot|' + lemmaXc + '|p=1}}'
preload_AB = '{{subst:User:QuasiBot/double|' + lemmaXa + '|' + lemmaXb + '|p=1}}'
preload_AC = '{{subst:User:QuasiBot/double|' + lemmaXa + '|' + lemmaXc + '|p=1}}'
preload_BC = '{{subst:User:QuasiBot/double|' + lemmaXb + '|' + lemmaXc + '|p=1}}'
preload_ABC = '{{subst:User:QuasiBot/triple|' + lemmaXa + '|' + lemmaXb + '|' + lemmaXc + '|p=1}}'
autominor = False
elif p==2:
preload_A = '{{subst:User:QuasiBot/part|' + lemmaXa + '}}'
preload_B = '{{subst:User:QuasiBot/part|' + lemmaXb + '}}'
preload_C = '{{subst:User:QuasiBot/part|' + lemmaXc + '}}'
preload_AB = '{{subst:User:QuasiBot/double/part|' + lemmaXa + '|' + lemmaXb + '}}'
preload_AC = '{{subst:User:QuasiBot/double/part|' + lemmaXa + '|' + lemmaXc + '}}'
preload_BC = '{{subst:User:QuasiBot/double/part|' + lemmaXb + '|' + lemmaXc + '}}'
preload_ABC = '{{subst:User:QuasiBot/triple/part|' + lemmaXa + '|' + lemmaXb + '|' + lemmaXc + '}}'
autominor = True
else:
print "ERROR: Wrong p parameter."
pagelist = []
autosummary_A = 'preloading ' + preload_A + ' with Python & pywikibot'
autosummary_B = 'preloading ' + preload_B + ' with Python & pywikibot'
autosummary_C = 'preloading ' + preload_C + ' with Python & pywikibot'
autosummary_AB = 'preloading ' + preload_AB + ' with Python & pywikibot'
autosummary_AC = 'preloading ' + preload_AC + ' with Python & pywikibot'
autosummary_BC = 'preloading ' + preload_BC + ' with Python & pywikibot'
autosummary_ABC = 'preloading ' + preload_ABC + ' with Python & pywikibot'
pageexists = []
pagelist_A_set = set(pagelist_A)
pagelist_B_set = set(pagelist_B)
pagelist_C_set = set(pagelist_C)
pagelist_A_set_fmt = set([x.format(stem11a, stem22a, stem33a) for x in pagelist_A_set])
pagelist_B_set_fmt = set([x.format(stem11b, stem22b, stem33b) for x in pagelist_B_set])
pagelist_C_set_fmt = set([x.format(stem11c, stem22c, stem33c) for x in pagelist_C_set])
pagelist_AB_set_fmt = pagelist_A_set_fmt & pagelist_B_set_fmt
pagelist_AC_set_fmt = pagelist_A_set_fmt & pagelist_C_set_fmt
pagelist_BC_set_fmt = pagelist_B_set_fmt & pagelist_C_set_fmt
pagelist_ABC_set_fmt = pagelist_AB_set_fmt & pagelist_C_set_fmt
pagelist_A_only_set_fmt = pagelist_A_set_fmt - pagelist_B_set_fmt - pagelist_C_set_fmt
pagelist_B_only_set_fmt = pagelist_B_set_fmt - pagelist_A_set_fmt - pagelist_C_set_fmt
pagelist_C_only_set_fmt = pagelist_C_set_fmt - pagelist_A_set_fmt - pagelist_B_set_fmt
pagelist_AB_only_set_fmt = pagelist_AB_set_fmt - pagelist_C_set_fmt
pagelist_AC_only_set_fmt = pagelist_AC_set_fmt - pagelist_B_set_fmt
pagelist_BC_only_set_fmt = pagelist_BC_set_fmt - pagelist_A_set_fmt
for mypage in pagelist_A_only_set_fmt:
page = Page(site, mypage)
try:
pagetext = page.get()
pageexists.append(mypage)
print "Page", mypage, "already exists."
except NoPage:
page.put(preload_A, comment=autosummary_A, minorEdit=autominor)
for mypage in pagelist_B_only_set_fmt:
page = Page(site, mypage)
try:
pagetext = page.get()
pageexists.append(mypage)
print "Page", mypage, "already exists."
except NoPage:
page.put(preload_B, comment=autosummary_B, minorEdit=autominor)
for mypage in pagelist_C_only_set_fmt:
page = Page(site, mypage)
try:
pagetext = page.get()
pageexists.append(mypage)
print "Page", mypage, "already exists."
except NoPage:
page.put(preload_C, comment=autosummary_C, minorEdit=autominor)
for mypage in pagelist_AB_only_set_fmt:
page = Page(site, mypage)
try:
pagetext = page.get()
pageexists.append(mypage)
print "Page", mypage, "already exists."
except NoPage:
page.put(preload_AB, comment=autosummary_AB, minorEdit=autominor)
for mypage in pagelist_AC_only_set_fmt:
page = Page(site, mypage)
try:
pagetext = page.get()
pageexists.append(mypage)
print "Page", mypage, "already exists."
except NoPage:
page.put(preload_AC, comment=autosummary_AC, minorEdit=autominor)
for mypage in pagelist_BC_only_set_fmt:
page = Page(site, mypage)
try:
pagetext = page.get()
pageexists.append(mypage)
print "Page", mypage, "already exists."
except NoPage:
page.put(preload_BC, comment=autosummary_BC, minorEdit=autominor)
for mypage in pagelist_ABC_set_fmt:
page = Page(site, mypage)
try:
pagetext = page.get()
pageexists.append(mypage)
print "Page", mypage, "already exists."
except NoPage:
page.put(preload_ABC, comment=autosummary_ABC, minorEdit=autominor)
return pageexists
def uploadAllTriple(pagelist1a , pagelist2a , pagelist3a, lemmaXa, stem11a, stem22a, stem33a, pagelist1b, pagelist2b, pagelist3b, lemmaXb, stem11b, stem22b, stem33b, pagelist1c, pagelist2c, pagelist3c, lemmaXc, stem11c, stem22c, stem33c):
pageexists_all_triple=[]
pageexists_all_triple = pageexists_all_triple + uploadTriple(pagelist1a, lemmaXa, stem11a, stem22a, stem33a, pagelist1b, lemmaXb, stem11b, stem22b, stem33b, pagelist1c, lemmaXc, stem11c, stem22c, stem33c, p=0)
pageexists_all_triple = pageexists_all_triple + uploadTriple(pagelist2a, lemmaXa, stem11a, stem22a, stem33a, pagelist2b, lemmaXb, stem11b, stem22b, stem33b, pagelist2c, lemmaXc, stem11c, stem22c, stem33c, p=1)
pageexists_all_triple = pageexists_all_triple + uploadTriple(pagelist3a, lemmaXa, stem11a, stem22a, stem33a, pagelist3b, lemmaXb, stem11b, stem22b, stem33b, pagelist3c, lemmaXc, stem11c, stem22c, stem33c, p=2)
return pageexists_all_triple