bugged
stringlengths
4
228k
fixed
stringlengths
0
96.3M
__index_level_0__
int64
0
481k
def initialise_data(self): """Login, set editor, page and pagelink attributes""" self.login()#anonymous=self.options.anonymous) self.editor = self.options.editor or wikipedia.input(u"Editor to use:") self.setpage()
def initialise_data(self): """Login, set editor, page and pagelink attributes""" self.login()#anonymous=self.options.anonymous) self.editor = self.options.editor or wikipedia.input(u"Editor to use:") self.setpage()
36,200
def login(self):#, anonymous): """Initialises site and username data"""#, or anonymous""" if False:#anonymous: self.site = wikipedia.getSite(user=None) else: self.username = self.options.username or wikipedia.input(u"Username:") self.site = wikipedia.getSite(user=self.username) self.site._fill() # load cookies if not s...
def login(self):#, anonymous): """Initialises site and username data"""#, or anonymous""" if False:#anonymous: self.site = wikipedia.getSite(user=None) else: self.username = self.options.username or wikipedia.input(u"Username:") self.site = wikipedia.getSite(user=self.username) self.site._loadCookies() # load cookies i...
36,201
def login(self):#, anonymous): """Initialises site and username data"""#, or anonymous""" if False:#anonymous: self.site = wikipedia.getSite(user=None) else: self.username = self.options.username or wikipedia.input(u"Username:") self.site = wikipedia.getSite(user=self.username) self.site._fill() # load cookies if not s...
def login(self):#, anonymous): """Initialises site and username data"""#, or anonymous""" if False:#anonymous: self.site = wikipedia.getSite(user=None) else: self.username = self.options.username or wikipedia.input(u"Username:") self.site = wikipedia.getSite(user=self.username) self.site._fill() # load cookies if not s...
36,202
def login(self):#, anonymous): """Initialises site and username data"""#, or anonymous""" if False:#anonymous: self.site = wikipedia.getSite(user=None) else: self.username = self.options.username or wikipedia.input(u"Username:") self.site = wikipedia.getSite(user=self.username) self.site._fill() # load cookies if not s...
def login(self):#, anonymous): """Initialises site and username data"""#, or anonymous""" if False:#anonymous: self.site = wikipedia.getSite(user=None) else: self.username = self.options.username or wikipedia.input(u"Username:") self.site = wikipedia.getSite(user=self.username) self.site._fill() # load cookies if not s...
36,203
def getData(self): import httplib try: addr = self.addr%special[self.code] except KeyError: print "BUG: Can not find name of Special in %s:" % self.code raise pagenames = u'\r\n'.join([x.hashfreeLinkname() for x in self.pages]) data = urlencode(( ('action', 'submit'), ('pages', pagenames), ('curonly', 'True'), )) heade...
def getData(self): import httplib try: addr = self.addr%special[self.code] except KeyError: print "BUG: Can not find name of Special in %s:" % self.code raise pagenames = u'\r\n'.join([x.hashfreeLinkname() for x in self.pages]) data = urlencode(( ('action', 'submit'), ('pages', UnicodeToAsciiHtml(pagenames)), ('curonly...
36,204
def run(self): for page in self.generator: ccToolkit = CosmeticChangesToolkit(page.site(), debug = True) changedText = ccToolkit.change(page.get()) if changedText != page.get(): if not self.acceptall: choice = wikipedia.inputChoice(u'Do you want to accept these changes?', ['Yes', 'No', 'All'], ['y', 'N', 'a'], 'N') if...
def run(self): for page in self.generator: ccToolkit = CosmeticChangesToolkit(page.site(), debug = True) changedText = ccToolkit.change(page.get()) if changedText != page.get(): if not self.acceptall: choice = wikipedia.inputChoice(u'Do you want to accept these changes?', ['Yes', 'No', 'All'], ['y', 'N', 'a'], 'N') if...
36,205
def main(): #page generator gen = None pageTitle = [] for arg in sys.argv[1:]: arg = wikipedia.argHandler(arg, 'cosmetic_changes') if arg: if arg.startswith('-start:'): gen = pagegenerators.AllpagesPageGenerator(arg[7:]) elif arg.startswith('-ref:'): referredPage = wikipedia.Page(wikipedia.getSite(), arg[5:]) gen = pag...
def main(): #page generator gen = None pageTitle = [] for arg in wikipedia.handleArgs(): if arg.startswith('-start:'): gen = pagegenerators.AllpagesPageGenerator(arg[7:]) elif arg.startswith('-ref:'): referredPage = wikipedia.Page(wikipedia.getSite(), arg[5:]) gen = pagegenerators.ReferringPageGenerator(referredPage) e...
36,206
def main(): #page generator gen = None pageTitle = [] for arg in sys.argv[1:]: arg = wikipedia.argHandler(arg, 'cosmetic_changes') if arg: if arg.startswith('-start:'): gen = pagegenerators.AllpagesPageGenerator(arg[7:]) elif arg.startswith('-ref:'): referredPage = wikipedia.Page(wikipedia.getSite(), arg[5:]) gen = pag...
def main(): #page generator gen = None pageTitle = [] for arg in sys.argv[1:]: arg = wikipedia.argHandler(arg, 'cosmetic_changes') if arg: if arg.startswith('-start:'): gen = pagegenerators.AllpagesPageGenerator(arg[7:]) elif arg.startswith('-ref:'): referredPage = wikipedia.Page(wikipedia.getSite(), arg[5:]) gen = pag...
36,207
def __init__(self, username = None, password = None, site = None): self.site = site or wikipedia.getSite() try: self.username = username or config.usernames[self.site.family.name][self.site.lang] except: wikipedia.output(u'ERROR: Username for %s:%s is undefined.\nIf you have an account for that site, please add such a ...
def __init__(self, username = None, password = None, site = None): self.site = site or wikipedia.getSite() try: self.username = username or config.usernames[self.site.family.name][self.site.lang] except: wikipedia.output(u'ERROR: Username for %s:%s is undefined.\nIf you have an account for that site, please add such a ...
36,208
def wikiwrap(self): print 'testing' for subentry in self.subentries: print 'testing' entry='test'
def wikiwrap(self): for subentry in self.subentries: entry='test'
36,209
def wikiwrap(self): print 'testing' for subentry in self.subentries: print 'testing' entry='test'
def wikiwrap(self): print 'testing' for subentry in self.subentries: print 'testing' entry='test'
36,210
def wikiwrap(self,wikilang): for meaning in self.meanings: subentry=langheader(wikilang) + '\n' # langheader is a dictionary that has the proper way to create a header indicating the language of a subentry for this Wiktionary term=meaning.term subentry+=posheader(wikilang,term.pos) # posheader is a dictionary that has ...
def wikiwrap(self,wikilang): for meaning in self.meanings: subentry=langheader(wikilang) + '\n' # langheader is a dictionary that has the proper way to create a header indicating the language of a subentry for this Wiktionary term=meaning.term subentry+=posheader(wikilang,term.pos) # posheader is a dictionary that has ...
36,211
def wikiwrap(self,wikilang): for meaning in self.meanings: subentry=langheader(wikilang) + '\n' # langheader is a dictionary that has the proper way to create a header indicating the language of a subentry for this Wiktionary term=meaning.term subentry+=posheader(wikilang,term.pos) # posheader is a dictionary that has ...
def wikiwrap(self,wikilang): for meaning in self.meanings: subentry=langheader(wikilang) + '\n' # langheader is a dictionary that has the proper way to create a header indicating the language of a subentry for this Wiktionary term=meaning.term subentry+=posheader(wikilang,term.pos) # posheader is a dictionary that has ...
36,212
def wikiwrap(self,wikilang): for meaning in self.meanings: subentry=langheader(wikilang) + '\n' # langheader is a dictionary that has the proper way to create a header indicating the language of a subentry for this Wiktionary term=meaning.term subentry+=posheader(wikilang,term.pos) # posheader is a dictionary that has ...
def wikiwrap(self,wikilang): for meaning in self.meanings: subentry=langheader(wikilang) + '\n' # langheader is a dictionary that has the proper way to create a header indicating the language of a subentry for this Wiktionary term=meaning.term subentry+=posheader(wikilang,term.pos) # posheader is a dictionary that has ...
36,213
def getGender(self): return(gender)
def getGender(self): return(gender)
36,214
def wikiwrap(self,wikilang): return()
def wikiwrap(self,wikilang): return()
36,215
def wikiwrap(self,wikilang): return()
def wikiwrap(self,wikilang): return()
36,216
def wikiwrap(self,wikilang): return()
def wikiwrap(self,wikilang): return()
36,217
def wikiwrap(self,wikilang): return()
def wikiwrap(self,wikilang): return()
36,218
def wikiwrap(self,wikilang): return()
def wikiwrap(self,wikilang): return()
36,219
def treat(self, refpl, disambPl): """ Parameters: disambPl - The disambiguation page or redirect we don't want anything to link on refpl - A page linking to disambPl Returns False if the user pressed q to completely quit the program. Otherwise, returns True. """ if self.mylang in link_trail: linktrail=link_trail[self.m...
def treat(self, refpl, disambPl): """ Parameters: disambPl - The disambiguation page or redirect we don't want anything to link on refpl - A page linking to disambPl Returns False if the user pressed q to completely quit the program. Otherwise, returns True. """ if self.mylang in link_trail: linktrail=link_trail[self.m...
36,220
def code2encoding(code): if code in ['meta','bs','ru','eo','ja','zh','hi','he','hu','pl','ko','cs','el','sl','ro']: return 'utf-8' return 'iso-8859-1'
def code2encoding(code): if code in ['meta','bs','ru','eo','ja','zh','hi','he','hu','pl','ko','cs','el','sl','ro','hr','tr']: return 'utf-8' return 'iso-8859-1'
36,221
def move(self, newtitle, reason = None, movetalkpage = True, sysop = False): if reason == None: reason = "Pagemove by bot" if self.namespace() // 2 == 1: movetalkpage = False host = self.site().hostname() address = self.site().move_address() self.site().forceLogin(sysop = sysop) token = self.site().getToken(self, sysop...
def move(self, newtitle, reason = None, movetalkpage = True, sysop = False): if reason == None: reason = "Pagemove by bot" if self.namespace() // 2 == 1: movetalkpage = False host = self.site().hostname() address = self.site().move_address() self.site().forceLogin(sysop = sysop) token = self.site().getToken(self, sysop...
36,222
def urlencode(query): """This can encode a query so that it can be sent as a query using a http POST request""" l=[] for k, v in query: k = urllib.quote(k) v = urllib.quote(v.encode('utf8')) l.append(k + '=' + v) return '&'.join(l)
def urlencode(query): """This can encode a query so that it can be sent as a query using a http POST request""" l=[] for k, v in query: k = urllib.quote(k) v = urllib.quote(v) l.append(k + '=' + v) return '&'.join(l)
36,223
def getCookie(self, remember=True): """Login to wikipedia. remember Remember login (default: True) Returns cookie data if succesful, False otherwise.""" data = {"wpName": self.username, "wpPassword": self.password, "wpLoginattempt": "Aanmelden & Inschrijven", # dutch button label seems to work for all wikis "wpRe...
def getCookie(self, remember=True): """Login to wikipedia. remember Remember login (default: True) Returns cookie data if succesful, None otherwise.""" data = {"wpName": self.username, "wpPassword": self.password, "wpLoginattempt": "Aanmelden & Inschrijven", # dutch button label seems to work for all wikis "wpRem...
36,224
def getCookie(self, remember=True): """Login to wikipedia. remember Remember login (default: True) Returns cookie data if succesful, False otherwise.""" data = {"wpName": self.username, "wpPassword": self.password, "wpLoginattempt": "Aanmelden & Inschrijven", # dutch button label seems to work for all wikis "wpRe...
def getCookie(self, remember=True): """Login to wikipedia. remember Remember login (default: True) Returns cookie data if succesful, False otherwise.""" data = {"wpName": self.username, "wpPassword": self.password, "wpLoginattempt": "Aanmelden & Inschrijven", # dutch button label seems to work for all wikis "wpRe...
36,225
def storecookiedata(self, data): """ Stores cookie data.
def storecookiedata(self, data): """ Stores cookie data.
36,226
def finish(self, sa = None): """Round up the subject, making any necessary changes. This method should be called exactly once after the todo list has gone empty.
def finish(self, sa = None): """Round up the subject, making any necessary changes. This method should be called exactly once after the todo list has gone empty.
36,227
def spellcheck(page): text = page if correct_html_codes: text = removeHTML(text) loc = 0 while True: wordsearch = re.compile(r'([\s\=\<\>\_]*)([^\s\=\<\>\_]+)') match = wordsearch.search(text,loc) if not match: # No more words on this page break loc += len(match.group(1)) bigword = Word(match.group(2)) smallword = bigw...
def spellcheck(page): text = page if correct_html_codes: text = removeHTML(text) loc = 0 while True: wordsearch = re.compile(r'([\s\=\<\>\_]*)([^\s\=\<\>\_]+)') match = wordsearch.search(text,loc) if not match: # No more words on this page break loc += len(match.group(1)) bigword = Word(match.group(2)) smallword = bigw...
36,228
def allpages(start = '%21%200'): """Iterate over all Wikipedia pages in the home language, starting at the given page.""" start = link2url(start, code = mylang) m=0 while 1: text = getPage(mylang, family.allpagesname(mylang, start), do_quote=0, do_edit=0) #print text if family.version(mylang)=="1.2": R = re.compile('/w...
def allpages(start = '%21%200'): """Iterate over all Wikipedia pages in the home language, starting at the given page.""" start = link2url(start, code = mylang) m=0 while 1: text = getPage(mylang, family.allpagesname(mylang, start), do_quote=0, do_edit=0) #print text if family.version(mylang)=="1.2": R = re.compile('/w...
36,229
def autonomous_problem(pl): if autonomous: f=open('autonomous_problem.dat','a') f.write("%s\n"%pl) f.close() sys.exit(1)
def autonomous_problem(pl,reason=''): if autonomous: f=open('autonomous_problem.dat','a') f.write("%s\n"%pl) f.close() sys.exit(1)
36,230
def autonomous_problem(pl): if autonomous: f=open('autonomous_problem.dat','a') f.write("%s\n"%pl) f.close() sys.exit(1)
def autonomous_problem(pl): if autonomous: f=open('autonomous_problem.dat','a') f.write("%s {%s}\n"%(pl,reason)) f.close() sys.exit(1)
36,231
def autotranslate(pl,arr,same=0): if same: return sametranslate(pl,arr) if hints: for h in hints: newcode,newname=h.split(':') x=wikipedia.PageLink(newcode,newname) if x not in arr: arr[x]=None # Autotranslate dates into some other languages, the rest will come from # existing interwiki links. Rdate=re.compile('(\d+)_(...
def autotranslate(pl,arr,same=0): if same: return sametranslate(pl,arr) if hints: for h in hints: codes,newname=h.split(':') if codes=='all': codes=wikipedia.biglangs else: codes=codes.split(',') for newcode in codes: x=wikipedia.PageLink(newcode,newname) if x not in arr: arr[x]=None # Autotranslate dates into some oth...
36,232
def autotranslate(pl,arr,same=0): if same: return sametranslate(pl,arr) if hints: for h in hints: newcode,newname=h.split(':') x=wikipedia.PageLink(newcode,newname) if x not in arr: arr[x]=None # Autotranslate dates into some other languages, the rest will come from # existing interwiki links. Rdate=re.compile('(\d+)_(...
def autotranslate(pl,arr,same=0): if same: return sametranslate(pl,arr) if hints: for h in hints: newcode,newname=h.split(':') x=wikipedia.PageLink(newcode,newname) if x not in arr: arr[x]=None # Autotranslate dates into some other languages, the rest will come from # existing interwiki links. if mylang==datetablelang:...
36,233
def autotranslate(pl,arr,same=0): if same: return sametranslate(pl,arr) if hints: for h in hints: newcode,newname=h.split(':') x=wikipedia.PageLink(newcode,newname) if x not in arr: arr[x]=None # Autotranslate dates into some other languages, the rest will come from # existing interwiki links. Rdate=re.compile('(\d+)_(...
def autotranslate(pl,arr,same=0): if same: return sametranslate(pl,arr) if hints: for h in hints: newcode,newname=h.split(':') x=wikipedia.PageLink(newcode,newname) if x not in arr: arr[x]=None # Autotranslate dates into some other languages, the rest will come from # existing interwiki links. Rdate=re.compile('(\d+)_(...
36,234
def treestep(arr,pl,abort_on_redirect=0): assert arr[pl] is None print "Getting %s"%pl n=0 try: text=pl.get() except wikipedia.NoPage: print "---> Does not actually exist" arr[pl]='' return 0 except wikipedia.LockedPage: print "---> Locked" arr[pl]=1 return 0 except wikipedia.IsRedirectPage,arg: if abort_on_redirect an...
def treestep(arr,pl,abort_on_redirect=0): assert arr[pl] is None print "Getting %s"%pl n=0 try: text=pl.get() except wikipedia.NoPage: print "---> Does not actually exist" arr[pl]='' return 0 except wikipedia.LockedPage: print "---> Locked" arr[pl]=1 return 0 except wikipedia.IsRedirectPage,arg: if abort_on_redirect an...
36,235
def treesearch(pl): arr={pl:None} # First make one step based on the language itself try: n=treestep(arr,pl,abort_on_redirect=1) except wikipedia.IsRedirectPage: print "Is redirect page" return if n==0 and not arr[pl]: print "Mother doesn't exist" return if untranslated: if len(arr)>1: print "Already has translations" ...
def treesearch(pl): arr={pl:None} # First make one step based on the language itself try: n=treestep(arr,pl,abort_on_redirect=1) except wikipedia.IsRedirectPage: print "Is redirect page" return if n==0 and not arr[pl]: print "Mother doesn't exist" return if untranslated: if len(arr)>1: print "Already has translations" ...
36,236
def treesearch(pl): arr={pl:None} # First make one step based on the language itself try: n=treestep(arr,pl,abort_on_redirect=1) except wikipedia.IsRedirectPage: print "Is redirect page" return if n==0 and not arr[pl]: print "Mother doesn't exist" return if untranslated: if len(arr)>1: print "Already has translations" ...
def treesearch(pl): arr={pl:None} # First make one step based on the language itself try: n=treestep(arr,pl,abort_on_redirect=1) except wikipedia.IsRedirectPage: print "Is redirect page" return if n==0 and not arr[pl]: print "Mother doesn't exist" return if untranslated: if len(arr)>1: print "Already has translations" ...
36,237
def treesearch(pl): arr={pl:None} # First make one step based on the language itself try: n=treestep(arr,pl,abort_on_redirect=1) except wikipedia.IsRedirectPage: print "Is redirect page" return if n==0 and not arr[pl]: print "Mother doesn't exist" return if untranslated: if len(arr)>1: print "Already has translations" ...
def treesearch(pl): arr={pl:None} # First make one step based on the language itself try: n=treestep(arr,pl,abort_on_redirect=1) except wikipedia.IsRedirectPage: print "Is redirect page" return if n==0 and not arr[pl]: print "Mother doesn't exist" return if untranslated: if len(arr)>1: print "Already has translations" ...
36,238
def treesearch(pl): arr={pl:None} # First make one step based on the language itself try: n=treestep(arr,pl,abort_on_redirect=1) except wikipedia.IsRedirectPage: print "Is redirect page" return if n==0 and not arr[pl]: print "Mother doesn't exist" return if untranslated: if len(arr)>1: print "Already has translations" ...
def treesearch(pl): arr={pl:None} # First make one step based on the language itself try: n=treestep(arr,pl,abort_on_redirect=1) except wikipedia.IsRedirectPage: print "Is redirect page" return if n==0 and not arr[pl]: print "Mother doesn't exist" return if untranslated: if len(arr)>1: print "Already has translations" ...
36,239
def treeview(cat, max_depth, current_depth = 0, supercat = None): ''' Returns a multi-line string which contains a tree view of all subcategories of cat, up to level max_depth. Parameters: * cat - a CatLink which will be the tree's root * current_depth - the current level in the tree (for recursion) * supercat - the C...
def treeview(cat, max_depth, current_depth = 0, supercat = None): ''' Returns a multi-line string which contains a tree view of all subcategories of cat, up to level max_depth. Parameters: * cat - a CatLink which will be the tree's root * current_depth - the current level in the tree (for recursion) * supercat - the C...
36,240
def treeview(cat, max_depth, current_depth = 0, supercat = None): ''' Returns a multi-line string which contains a tree view of all subcategories of cat, up to level max_depth. Parameters: * cat - a CatLink which will be the tree's root * current_depth - the current level in the tree (for recursion) * supercat - the C...
def treeview(cat, max_depth, current_depth = 0, supercat = None): ''' Returns a multi-line string which contains a tree view of all subcategories of cat, up to level max_depth. Parameters: * cat - a CatLink which will be the tree's root * current_depth - the current level in the tree (for recursion) * supercat - the C...
36,241
def __init__(self, parent = None): print 'bla2' if parent == None: # create a new window parent = Tk() self.myParent = parent
def __init__(self, parent = None): if parent == None: # create a new window parent = Tk() self.myParent = parent
36,242
def getVersionHistory(self, force = False): """ Loads the version history page and returns a list of tuples, where each tuple represents one edit and is built of edit date/time, user name, and edit summary. """ site = self.site() host = site.hostname() url = site.family.version_history_address(site, self.urlname())
def getVersionHistory(self, forceReload = False): """ Loads the version history page and returns a list of tuples, where each tuple represents one edit and is built of edit date/time, user name, and edit summary. """ site = self.site() host = site.hostname() url = site.family.version_history_address(site, self.urlname(...
36,243
def getVersionHistory(self, force = False): """ Loads the version history page and returns a list of tuples, where each tuple represents one edit and is built of edit date/time, user name, and edit summary. """ site = self.site() host = site.hostname() url = site.family.version_history_address(site, self.urlname())
def getVersionHistory(self, force = False): """ Loads the version history page and returns a list of tuples, where each tuple represents one edit and is built of edit date/time, user name, and edit summary. """ site = self.site() host = site.hostname() url = site.family.version_history_address(site, self.urlname())
36,244
def getToken(self, getalways = True, getagain = False, sysop = False): if getagain or (getalways and ((sysop and not self._sysoptoken) or (not sysop and not self._token))): output(u"Getting page to get a token.") try: Page(self, "Wikipedia:Sandbox").get(force = True, sysop = sysop) except UserBlocked: raise except Erro...
def getToken(self, getalways = True, getagain = False, sysop = False): if getagain or (getalways and ((sysop and not self._sysoptoken) or (not sysop and not self._token))): output(u"Getting page to get a token.") try: Page(self, "%s:Sandbox" % self.family.namespace(self.lang, 4)).get(force = True, sysop = sysop) except...
36,245
def autotranslate(pl, arr, same=0): if same: return sametranslate(pl, arr) if hints: for h in hints: codes, newname=h.split(':') if codes == 'all': codes = wikipedia.biglangs else: codes = codes.split(',') for newcode in codes: x = wikipedia.PageLink(newcode, newname) if x not in arr: arr[x] = None # Autotranslate date...
def autotranslate(pl, arr, same=0): if same: return sametranslate(pl, arr) if hints: for h in hints: codes, newname = h.split(':', 1) if codes == 'all': codes = wikipedia.biglangs else: codes = codes.split(',') for newcode in codes: x = wikipedia.PageLink(newcode, newname) if x not in arr: arr[x] = None # Autotranslate...
36,246
def putPage(code, name, text, comment = None, watchArticle = False, minorEdit = True, newPage = False): """Upload 'text' on page 'name' to the 'code' language wikipedia. Use of this routine can normally be avoided; use PageLink.put instead. """ import httplib put_throttle() host = family.hostname(code) address = family...
def putPage(code, name, text, comment = None, watchArticle = False, minorEdit = True, newPage = False): """Upload 'text' on page 'name' to the 'code' language wikipedia. Use of this routine can normally be avoided; use PageLink.put instead. """ import httplib put_throttle() host = family.hostname(code) address = family...
36,247
def change_category(article, oldCat, newCat, comment=None): """ Given an article which is in category oldCat, moves it to category called newCatTitle. Moves subcategories of oldCat as well. oldCat should be a Category object, newCatTitle should be the new name as a string, without namespace. If newCatTitle is None, the...
def change_category(article, oldCat, newCat, comment=None): """ Given an article which is in category oldCat, moves it to category newCat. Moves subcategories of oldCat as well. oldCat and newCat should be Category objects. If newCat is None, the category will be removed. """ cats = article.categories() site = article....
36,248
def change_category(article, oldCat, newCat, comment=None): """ Given an article which is in category oldCat, moves it to category called newCatTitle. Moves subcategories of oldCat as well. oldCat should be a Category object, newCatTitle should be the new name as a string, without namespace. If newCatTitle is None, the...
def change_category(article, oldCat, newCat, comment=None): """ Given an article which is in category oldCat, moves it to category called newCatTitle. Moves subcategories of oldCat as well. oldCat should be a Category object, newCatTitle should be the new name as a string, without namespace. If newCatTitle is None, the...
36,249
def change_category(article, oldCat, newCat, comment=None): """ Given an article which is in category oldCat, moves it to category called newCatTitle. Moves subcategories of oldCat as well. oldCat should be a Category object, newCatTitle should be the new name as a string, without namespace. If newCatTitle is None, the...
def change_category(article, oldCat, newCat, comment=None): """ Given an article which is in category oldCat, moves it to category called newCatTitle. Moves subcategories of oldCat as well. oldCat should be a Category object, newCatTitle should be the new name as a string, without namespace. If newCatTitle is None, the...
36,250
def resolveRedirect(self): ''' Requests the header from the server. If the page is an HTTP redirect, returns the redirect target URL as a string. Otherwise returns None. ''' conn = httplib.HTTPConnection(self.host) conn.request('HEAD', '%s%s' % (self.path, self.query), None, self.header) response = conn.getresponse() n...
def resolveRedirect(self): ''' Requests the header from the server. If the page is an HTTP redirect, returns the redirect target URL as a string. Otherwise returns None. ''' conn = httplib.HTTPConnection(self.host) conn.request('HEAD', '%s%s' % (self.path, self.query), None, self.header) response = conn.getresponse() n...
36,251
def _addlang(self, code, location, namespaces): """Add a new language to the langs and namespaces of the family. This is supposed to be called in the constructor of the family.""" self.langs[code] = location for num, val in namespaces.items(): print num,code self.namespaces[num][code]=val
def _addlang(self, code, location, namespaces): """Add a new language to the langs and namespaces of the family. This is supposed to be called in the constructor of the family.""" self.langs[code] = location for num, val in namespaces.items(): self.namespaces[num][code]=val
36,252
def replaceCategoryLinks(oldtext, new, code = None): """Replace the category links given in the wikitext given in oldtext by the new links given in new. 'new' should be a list of category pagelink objects. """ if code is None: code = mylang # first remove interwiki links and add them later, so that # interwiki tags ap...
def replaceCategoryLinks(oldtext, new, code = None): """Replace the category links given in the wikitext given in oldtext by the new links given in new. 'new' should be a list of category pagelink objects. """ if code is None: code = mylang # first remove interwiki links and add them later, so that # interwiki tags ap...
36,253
def add_category(): print "This bot has two modes: you can add a category link to all" print "pages mentioned in a List that is now in another wikipedia page" print "or you can add a category link to all pages that link to a" print "specific page. If you want the second, please give an empty" print "answer to the first...
def add_category(): print "This bot has two modes: you can add a category link to all" print "pages mentioned in a List that is now in another wikipedia page" print "or you can add a category link to all pages that link to a" print "specific page. If you want the second, please give an empty" print "answer to the first...
36,254
def resolveRedirect(self): ''' Requests the header from the server. If the page is an HTTP redirect, returns the redirect target URL as a string. Otherwise returns None. ''' conn = httplib.HTTPConnection(self.host) conn.request('HEAD', '%s%s' % (self.path, self.query), None, self.header) response = conn.getresponse() i...
def resolveRedirect(self): ''' Requests the header from the server. If the page is an HTTP redirect, returns the redirect target URL as a string. Otherwise returns None. ''' if self.scheme == 'http': conn = httplib.HTTPConnection(self.host) elif self.scheme == 'https': conn = httplib.HTTPSConnection(self.host) conn.req...
36,255
def check(self): """ Returns True and the server status message if the page is alive. Otherwise returns false """ try: wasRedirected = self.resolveRedirect() except httplib.error, arg: return False, u'HTTP Error: %s' % arg except socket.error, arg: return False, u'Socket Error: %s' % arg except UnicodeEncodeError, arg:...
def check(self): """ Returns True and the server status message if the page is alive. Otherwise returns false """ try: wasRedirected = self.resolveRedirect() except httplib.error, arg: return False, u'HTTP Error: %s' % arg except socket.error, arg: return False, u'Socket Error: %s' % arg except UnicodeEncodeError, arg:...
36,256
def getPage(code, name, do_edit = 1, do_quote = 1): """Get the contents of page 'name' from the 'code' language wikipedia Do not use this directly; use the PageLink object instead.""" output(url2unicode("Getting page %s:%s"%(code,name), language = code)) host = family.hostname(code) name = re.sub(' ', '_', name) if not...
def getPage(code, name, do_edit = 1, do_quote = 1): """Get the contents of page 'name' from the 'code' language wikipedia Do not use this directly; use the PageLink object instead.""" output(url2unicode("Getting page %s:%s"%(code,name), language = code)) host = family.hostname(code) name = re.sub(' ', '_', name) if not...
36,257
def getPage(code, name, do_edit = 1, do_quote = 1): """Get the contents of page 'name' from the 'code' language wikipedia Do not use this directly; use the PageLink object instead.""" output(url2unicode("Getting page %s:%s"%(code,name), language = code)) host = family.hostname(code) name = re.sub(' ', '_', name) if not...
def getPage(code, name, do_edit = 1, do_quote = 1): """Get the contents of page 'name' from the 'code' language wikipedia Do not use this directly; use the PageLink object instead.""" output(url2unicode("Getting page %s:%s"%(code,name), language = code)) host = family.hostname(code) name = re.sub(' ', '_', name) if not...
36,258
def getPage(code, name, do_edit = 1, do_quote = 1): """Get the contents of page 'name' from the 'code' language wikipedia Do not use this directly; use the PageLink object instead.""" output(url2unicode("Getting page %s:%s"%(code,name), language = code)) host = family.hostname(code) name = re.sub(' ', '_', name) if not...
def getPage(code, name, do_edit = 1, do_quote = 1): """Get the contents of page 'name' from the 'code' language wikipedia Do not use this directly; use the PageLink object instead.""" output(url2unicode("Getting page %s:%s"%(code,name), language = code)) host = family.hostname(code) name = re.sub(' ', '_', name) if not...
36,259
def __init__(self, site, title = None, insite = None, tosite = None): """ Constructor. Normally called with two arguments: Parameters: 1) The wikimedia site on which the page resides 2) The title of the page as a unicode string The argument insite can be specified to help decode the name; it is the wikimedia site wher...
def __init__(self, site, title = None, insite = None, tosite = None): """ Constructor. Normally called with two arguments: Parameters: 1) The wikimedia site on which the page resides 2) The title of the page as a unicode string The argument insite can be specified to help decode the name; it is the wikimedia site wher...
36,260
def getLanguageLinks(text, insite = None, pageLink = "[[]]"): """ Returns a dictionary with language codes as keys and Page objects as values for each interwiki link found in the text. Do not call this routine directly, use Page objects instead""" if insite == None: insite = getSite() result = {} # Ignore interwiki lin...
def getLanguageLinks(text, insite = None, pageLink = "[[]]"): """ Returns a dictionary with language codes as keys and Page objects as values for each interwiki link found in the text. Do not call this routine directly, use Page objects instead""" if insite == None: insite = getSite() result = {} # Ignore interwiki lin...
36,261
def generate(self): # this array will contain up to 20 pages and will be flushed # after these pages have been preloaded. somePages = [] i = 0 for pl in self.generator.generate(): i += 1 somePages.append(pl) # We don't want to load too many pages at once using XML export. # We only get 20 at a time. if i >= self.pageNu...
def generate(self): # this array will contain up to 20 pages and will be flushed # after these pages have been preloaded. somePages = [] i = 0 for pl in self.generator.generate(): i += 1 somePages.append(pl) # We don't want to load too many pages at once using XML export. # We only get 20 at a time. if i >= self.pageNu...
36,262
def run(self): linkChecker = LinkChecker(self.url) try: ok, message = linkChecker.check() except: wikipedia.output('Exception while processing URL %s in page %s' % (self.url, self.page.title())) raise if ok: if self.history.setLinkAlive(self.url): wikipedia.output('*Link to %s in [[%s]] is back alive.' % (self.url, sel...
def run(self): linkChecker = LinkChecker(self.url) try: ok, message = linkChecker.check() except: wikipedia.output('Exception while processing URL %s in page %s' % (self.url, self.page.title())) raise if ok: if self.history.setLinkAlive(self.url): wikipedia.output('*Link to %s in [[%s]] is back alive.' % (self.url, sel...
36,263
def save(self): """ Saves the .dat file to disk. """ datfile = open(self.datfilename, 'w') self.historyDict = pickle.dump(self.historyDict, datfile) datfile.close()
def save(self): """ Saves the .dat file to disk. """ datfile = open(self.datfilename, 'w') self.historyDict = pickle.dump(self.historyDict, datfile) datfile.close()
36,264
def __init__(self, generator, start ='!'): self.generator = generator self.start = start if config.report_dead_links_on_talk: reportThread = DeadLinkReportThread() # thread dies when program terminates # reportThread.setDaemon(True) reportThread.start() else: reportThread = None self.history = History(reportThread)
def __init__(self, generator, start ='!'): self.generator = generator self.start = start if globalvar.talk: reportThread = DeadLinkReportThread() # thread dies when program terminates # reportThread.setDaemon(True) reportThread.start() else: reportThread = None self.history = History(reportThread)
36,265
def main(): gen = None pageTitle = [] for arg in wikipedia.handleArgs(): if arg.startswith('-start:'): start = arg[7:] gen = pagegenerators.AllpagesPageGenerator(start) else: pageTitle.append(arg) if pageTitle: pageTitle = ' '.join(pageTitle) page = wikipedia.Page(wikipedia.getSite(), pageTitle) gen = iter([page]) if...
def main(): gen = None pageTitle = [] args = wikipedia.handleArgs() args = globalvar.handleArgs(args) for arg in args: if arg.startswith('-start:'): start = arg[7:] gen = pagegenerators.AllpagesPageGenerator(start) else: pageTitle.append(arg) if pageTitle: pageTitle = ' '.join(pageTitle) page = wikipedia.Page(wikiped...
36,266
def interwikiFormat(links, insite = None): """Create a suitable string encoding all interwiki links for a wikipedia page. 'links' should be a dictionary with the language names as keys, and either PageLink objects or the link-names of the pages as values. The string is formatted for inclusion in insite (defaulting to...
def interwikiFormat(links, insite = None): """Create a suitable string encoding all interwiki links for a wikipedia page. 'links' should be a dictionary with the language names as keys, and either PageLink objects or the link-names of the pages as values. The string is formatted for inclusion in insite (defaulting to...
36,267
def categoryFormat(links, insite = None): """Create a suitable string encoding all category links for a wikipedia page. 'links' should be a list of category pagelink objects. The string is formatted for inclusion in insite. """ if not links: return '' if insite is None: insite.getSite() s = [] for pl in links: s.appe...
def categoryFormat(links, insite = None): """Create a suitable string encoding all category links for a wikipedia page. 'links' should be a list of category pagelink objects. The string is formatted for inclusion in insite. """ if not links: return '' if insite is None: insite.getSite() s = [] for pl in links: s.appe...
36,268
def category_on_one_line(self): return self.lang in self.family.category_on_one_line
def category_on_one_line(self): return self.lang in self.family.category_on_one_line
36,269
def __init__(self): family.Family.__init__(self) self.name = 'wikipedia'
def __init__(self): family.Family.__init__(self) self.name = 'wikipedia'
36,270
def login(self, anonymous): """Initialises site and username data, or anonymous""" if anonymous: self.site = wikipedia.getSite(user=None) else: self.username = self.options.username or wikipedia.input(u"Username: ", encode=True) self.site = wikipedia.getSite(user=self.username) self.site._fill() # load cookies if not s...
def login(self, anonymous): """Initialises site and username data, or anonymous""" if anonymous: self.site = wikipedia.getSite(user=None) else: self.username = self.options.username or wikipedia.input(u"Username: ", encode=True) self.site = wikipedia.getSite(user=self.username) self.site._fill() # load cookies if not s...
36,271
def handle_edit_conflict(self): fn = os.path.join(tempfile.gettempdir(), self.page) fp = open(fn, 'w') fp.write(new) fp.close() wikipedia.output(u"An edit conflict has arisen. Your edit has been saved to %s. Please try again." % fn)
def handle_edit_conflict(self): fn = os.path.join(tempfile.gettempdir(), self.page) fp = open(fn, 'w') fp.write(new) fp.close() wikipedia.output(u"An edit conflict has arisen. Your edit has been saved to %s. Please try again." % fn)
36,272
def get(self): """The wiki-text of the page. This will retrieve the page if it has not been retrieved yet. This can raise the following exceptions that should be caught by the calling code:
def get(self): """The wiki-text of the page. This will retrieve the page if it has not been retrieved yet. This can raise the following exceptions that should be caught by the calling code:
36,273
def __init__(self):
def __init__(self):
36,274
def __init__(self):
def __init__(self):
36,275
def reportBacklinks(self, new): """Report missing back links. This will be called from finish() if needed.""" for code in new.keys(): pl = new[code] if not unequal.bigger(self.inpl, pl): shouldlink = new.values() + [self.inpl] linked = pl.interwiki() for xpl in shouldlink: if xpl != pl and not xpl in linked: for l in l...
def reportBacklinks(self, new): """Report missing back links. This will be called from finish() if needed.""" for code in new.keys(): pl = new[code] if not unequal.bigger(self.inpl, pl): shouldlink = new.values() + [self.inpl] linked = pl.interwiki() for xpl in shouldlink: if xpl != pl and not xpl in linked: for l in l...
36,276
def workDone(self, counter): """This is called by a worker to tell us that the promised work was completed as far as possible. The only argument is an instance of a counter class, that has methods minus() and plus() to keep counts of the total work todo.""" # Loop over all the pages that should have been taken care of ...
def workDone(self, counter): """This is called by a worker to tell us that the promised work was completed as far as possible. The only argument is an instance of a counter class, that has methods minus() and plus() to keep counts of the total work todo.""" # Loop over all the pages that should have been taken care of ...
36,277
def workDone(self, counter): """This is called by a worker to tell us that the promised work was completed as far as possible. The only argument is an instance of a counter class, that has methods minus() and plus() to keep counts of the total work todo.""" # Loop over all the pages that should have been taken care of ...
def workDone(self, counter): """This is called by a worker to tell us that the promised work was completed as far as possible. The only argument is an instance of a counter class, that has methods minus() and plus() to keep counts of the total work todo.""" # Loop over all the pages that should have been taken care of ...
36,278
def __init__(self):
def __init__(self):
36,279
def ReadWarnfile(filename, sa): import warnfile reader = warnfile.WarnfileReader(filename) # we won't use removeHints hints = reader.getHints()[0] for pagename in hints.iterkeys(): pl = wikipedia.Page(wikipedia.getSite(), pagename) # The WarnfileReader gives us a list of pagelinks, but titletranslate.py expects a list ...
def readWarnfile(filename, sa): import warnfile reader = warnfile.WarnfileReader(filename) # we won't use removeHints hints = reader.getHints()[0] for pagename in hints.iterkeys(): pl = wikipedia.Page(wikipedia.getSite(), pagename) # The WarnfileReader gives us a list of pagelinks, but titletranslate.py expects a list ...
36,280
def ReadWarnfile(filename, sa): import warnfile reader = warnfile.WarnfileReader(filename) # we won't use removeHints hints = reader.getHints()[0] for pagename in hints.iterkeys(): pl = wikipedia.Page(wikipedia.getSite(), pagename) # The WarnfileReader gives us a list of pagelinks, but titletranslate.py expects a list ...
def ReadWarnfile(filename, sa): import warnfile reader = warnfile.WarnfileReader(filename) # we won't use removeHints (hints, removeHints) = reader.getHints() for pagename in hints.iterkeys(): pl = wikipedia.Page(wikipedia.getSite(), pagename) # The WarnfileReader gives us a list of pagelinks, but titletranslate.py exp...
36,281
def ReadWarnfile(filename, sa): import warnfile reader = warnfile.WarnfileReader(filename) # we won't use removeHints hints = reader.getHints()[0] for pagename in hints.iterkeys(): pl = wikipedia.Page(wikipedia.getSite(), pagename) # The WarnfileReader gives us a list of pagelinks, but titletranslate.py expects a list ...
def ReadWarnfile(filename, sa): import warnfile reader = warnfile.WarnfileReader(filename) # we won't use removeHints hints = reader.getHints()[0] for pagename in hints.iterkeys(): pl = wikipedia.Page(wikipedia.getSite(), pagename) # The WarnfileReader gives us a list of pagelinks, but titletranslate.py expects a list ...
36,282
def choosecats(pagetext): chosen=[] flag=False length=1000 print ("Give the new categories, one per line.") print ("Empty line: if the first, don't change. Otherwise: Ready.") print ("-: I made a mistake, let me start over.") print ("?: Give (more of) the text of the page.") print ("xx: if the first, remove all categor...
def choosecats(pagetext): chosen=[] flag=False length=1000 print ("Give the new categories, one per line.") print ("Empty line: if the first, don't change. Otherwise: Ready.") print ("-: I made a mistake, let me start over.") print ("?: Give (more of) the text of the page.") print ("xx: if the first, remove all categor...
36,283
def getVersionHistory(self, forceReload = False): """ Loads the version history page and returns a list of tuples, where each tuple represents one edit and is built of edit date/time, user name, and edit summary. """ site = self.site() path = site.family.version_history_address(self.site().language(), self.urlname())
def getVersionHistory(self, forceReload = False): """ Loads the version history page and returns a list of tuples, where each tuple represents one edit and is built of edit date/time, user name, and edit summary. """ site = self.site() path = site.family.version_history_address(self.site().language(), self.urlname())
36,284
def replaceCategoryLinks(oldtext, new, site = None): """Replace the category links given in the wikitext given in oldtext by the new links given in new. 'new' should be a list of category pagelink objects. """ if site is None: site = getSite() # first remove interwiki links and add them later, so that # interwiki tags...
def replaceCategoryLinks(oldtext, new, site = None): """Replace the category links given in the wikitext given in oldtext by the new links given in new. 'new' should be a list of category pagelink objects. """ if site is None: site = getSite() # first remove interwiki links and add them later, so that # interwiki tags...
36,285
def __init__(self, site, title = None, insite = None, tosite = None): """ Constructor. Normally called with two arguments: Parameters: 1) The wikimedia site on which the page resides 2) The title of the page as a unicode string The argument insite can be specified to help decode the name; it is the wikimedia site wher...
def __init__(self, site, title = None, insite = None, tosite = None): """ Constructor. Normally called with two arguments: Parameters: 1) The wikimedia site on which the page resides 2) The title of the page as a unicode string The argument insite can be specified to help decode the name; it is the wikimedia site wher...
36,286
def checkMultiplicity(self): processes = {} my_pid = 1 count = 1 try: f = open('throttle.log','r') except IOError: if not self.pid: pass else: raise else: now = time.time() for line in f.readlines(): line = line.split(' ') pid = int(line[0]) ptime = int(line[1].split('.')[0]) if now - ptime <= self.releasepid: if now -...
def checkMultiplicity(self): processes = {} my_pid = 1 count = 1 try: f = open('throttle.log','r') except IOError: if not self.pid: pass else: raise else: now = time.time() for line in f.readlines(): try: line = line.split(' ') pid = int(line[0]) ptime = int(line[1].split('.')[0]) if now - ptime <= self.releasepid: if ...
36,287
def url2unicode(title, site): try: t = title.encode(site.encoding()) t = urllib.unquote(t) return unicode(t, site.encoding()) except UnicodeError: # try to handle all encodings (will probably retry utf-8) for enc in site.encodings(): try: t = title.encode(enc) t = urllib.unquote(t) return unicode(t, enc) except Unicode...
def url2unicode(title, site): try: t = title.encode(site.encoding()) t = urllib.unquote(t) return unicode(t, site.encoding()) except UnicodeError: # try to handle all encodings (will probably retry utf-8) for enc in site.encodings(): try: t = title.encode(enc) t = urllib.unquote(t) return unicode(t, enc) except Unicode...
36,288
def workon(page): try: text = page.get() except wikipedia.isRedirectPage: return # Here go edit text in whatever way you want. If you find you do not # want to edit this page, just return if text != page.get(): page.put(text) # Adding a summary text would be good
def workon(page): try: text = page.get() except wikipedia.IsRedirectPage: return # Here go edit text in whatever way you want. If you find you do not # want to edit this page, just return if text != page.get(): page.put(text) # Adding a summary text would be good
36,289
def workon(page): try: text = page.get() except wikipedia.isRedirectPage: return # Here go edit text in whatever way you want. If you find you do not # want to edit this page, just return if text != page.get(): page.put(text) # Adding a summary text would be good
def workon(page): try: text = page.get() except wikipedia.isRedirectPage: return # Here go edit text in whatever way you want. If you find you do not # want to edit this page, just return if text != page.get(): page.put(text) # Adding a summary text would be good
36,290
def putPage(self, text, comment = None, watchArticle = False, minorEdit = True, newPage = False, token = None, gettoken = False, sysop = False): """ Upload 'text' as new contents for this Page by filling out the edit page. Don't use this directly, use put() instead. """ safetuple = () # safetuple keeps the old value, ...
def putPage(self, text, comment = None, watchArticle = False, minorEdit = True, newPage = False, token = None, gettoken = False, sysop = False): """ Upload 'text' as new contents for this Page by filling out the edit page. Don't use this directly, use put() instead. """ safetuple = () # safetuple keeps the old value, ...
36,291
def makepath(path): """ creates missing directories for the given path and returns a normalized absolute version of the path. - if the given path already exists in the filesystem the filesystem is not modified. - otherwise makepath creates directories along the given path using the dirname() of the path. You may appe...
def makepath(path): """ creates missing directories for the given path and returns a normalized absolute version of the path. - if the given path already exists in the filesystem the filesystem is not modified. - otherwise makepath creates directories along the given path using the dirname() of the path. You may appe...
36,292
def makepath(path): """ creates missing directories for the given path and returns a normalized absolute version of the path. - if the given path already exists in the filesystem the filesystem is not modified. - otherwise makepath creates directories along the given path using the dirname() of the path. You may appe...
def makepath(path): """ creates missing directories for the given path and returns a normalized absolute version of the path. - if the given path already exists in the filesystem the filesystem is not modified. - otherwise makepath creates directories along the given path using the dirname() of the path. You may appe...
36,293
def makepath(path): """ creates missing directories for the given path and returns a normalized absolute version of the path. - if the given path already exists in the filesystem the filesystem is not modified. - otherwise makepath creates directories along the given path using the dirname() of the path. You may appe...
def makepath(path): """ creates missing directories for the given path and returns a normalized absolute version of the path. - if the given path already exists in the filesystem the filesystem is not modified. - otherwise makepath creates directories along the given path using the dirname() of the path. You may appe...
36,294
def makepath(path): """ creates missing directories for the given path and returns a normalized absolute version of the path. - if the given path already exists in the filesystem the filesystem is not modified. - otherwise makepath creates directories along the given path using the dirname() of the path. You may appe...
def makepath(path): """ creates missing directories for the given path and returns a normalized absolute version of the path. - if the given path already exists in the filesystem the filesystem is not modified. - otherwise makepath creates directories along the given path using the dirname() of the path. You may appe...
36,295
def makepath(path): """ creates missing directories for the given path and returns a normalized absolute version of the path. - if the given path already exists in the filesystem the filesystem is not modified. - otherwise makepath creates directories along the given path using the dirname() of the path. You may appe...
def makepath(path): """ creates missing directories for the given path and returns a normalized absolute version of the path. - if the given path already exists in the filesystem the filesystem is not modified. - otherwise makepath creates directories along the given path using the dirname() of the path. You may appe...
36,296
def __iter__(self): import xmlreader mysite = wikipedia.getSite() dump = xmlreader.XmlDump(self.xmlfilename) # regular expression to find the original template. # {{msg:vfd}} does the same thing as {{msg:Vfd}}, so both will be found. # The new syntax, {{vfd}}, will also be found. templateName = self.template.title().sp...
def __iter__(self): import xmlreader mysite = wikipedia.getSite() dump = xmlreader.XmlDump(self.xmlfilename) # regular expression to find the original template. # {{msg:vfd}} does the same thing as {{msg:Vfd}}, so both will be found. # The new syntax, {{vfd}}, will also be found. templateName = self.template.title().sp...
36,297
def run(self): # regular expression to find the original template. # {{msg:vfd}} does the same thing as {{msg:Vfd}}, so both will be found. # The new syntax, {{vfd}}, will also be found. # The group 'parameters' will either match the parameters, or an # empty string if there are none. if not wikipedia.getSite().nocapit...
def run(self): # regular expression to find the original template. # {{msg:vfd}} does the same thing as {{msg:Vfd}}, so both will be found. # The new syntax, {{vfd}}, will also be found. # The group 'parameters' will either match the parameters, or an # empty string if there are none. if not wikipedia.getSite().nocapit...
36,298
def run(self): # regular expression to find the original template. # {{msg:vfd}} does the same thing as {{msg:Vfd}}, so both will be found. # The new syntax, {{vfd}}, will also be found. # The group 'parameters' will either match the parameters, or an # empty string if there are none. if not wikipedia.getSite().nocapit...
def run(self): # regular expression to find the original template. # {{msg:vfd}} does the same thing as {{msg:Vfd}}, so both will be found. # The new syntax, {{vfd}}, will also be found. # The group 'parameters' will either match the parameters, or an # empty string if there are none. if wikipedia.getSite().nocapitaliz...
36,299