వాడుకరి:Vyzbot/Villagepages.py: కూర్పుల మధ్య తేడాలు

దిద్దుబాటు సారాంశం లేదు
దిద్దుబాటు సారాంశం లేదు
 
పంక్తి 4:
"""this is Vyzbot.
"""
import wikipedia, pagegenerators, catlib, templatecount
import sys, replace, string, category, login, os, re
import config, codecs
 
#login
Line 43 ⟶ 42:
mandalcounter=1
for page in gen:
if (mandalcounter > completed_mandals):
mandalname = page.title()
text = []
Line 49 ⟶ 48:
print text
findpage(text)
mandalcounter=mandalcounter+=1
 
 
Line 61 ⟶ 60:
while lines and not lines[0]: del lines[0] #removing empty lines on top
while lines and not lines[-1]: del lines[-1] #removing empty lines at the bottom
lines = [(line.split('[[')[-1].split(']]')[0]) for line in lines] #extracting villagename from sq.brackets
#not creating village page for mandalname and removing (mandal) from names
for counter=0,line in enumerate(lines):
for line in lines:
if "(" in line: lines[counter] = lines[counter].split('(')[0]
if line == mandalname : del lines[counter]
counter=counter+1
 
lines = [(u"begin '''"+line+u"''', [["+district_name+u"]] జిల్లా, [["+mandalname+u"]] మండలానికి చెందిన గ్రామము.\n[[వర్గం:"+district_name+u" జిల్లా గ్రామాలు]]\n{{end}} ") for line in lines]
villages = ''.join([line for line in lines])
 
return villages
Line 99 ⟶ 96:
if append == "Top":
old_text = page.get(get_redirect=True)
contents = contents += old_text
commenttext_top = commenttext + " - " + msg_top
wikipedia.output(u"Page %s already exists, appending on top!"%title)
Line 121 ⟶ 118:
 
def main():
global mandalname
getmandals()
 
"https://te.wikipedia.org/wiki/వాడుకరి:Vyzbot/Villagepages.py" నుండి వెలికితీశారు