bugged stringlengths 4 228k | fixed stringlengths 0 96.3M | __index_level_0__ int64 0 481k |
|---|---|---|
def treesearch(code,name): arr={(code,name):None} # First make one step based on the language itself try: n=treestep(arr,code,name,abort_on_redirect=1) except wikipedia.IsRedirectPage: print "Is redirect page" return if n==0 and not arr[code,name]: print "Mother doesn't exist" return # Then add translations if we survi... | def treesearch(code,name): arr={(code,name):None} # First make one step based on the language itself try: n=treestep(arr,code,name,abort_on_redirect=1) except wikipedia.IsRedirectPage: print "Is redirect page" return if n==0 and not arr[code,name]: print "Mother doesn't exist" return # Then add translations if we survi... | 36,100 |
def treesearch(code,name): arr={(code,name):None} # First make one step based on the language itself try: n=treestep(arr,code,name,abort_on_redirect=1) except wikipedia.IsRedirectPage: print "Is redirect page" return if n==0 and not arr[code,name]: print "Mother doesn't exist" return # Then add translations if we survi... | def treesearch(code,name): arr={(code,name):None} # First make one step based on the language itself try: n=treestep(arr,code,name,abort_on_redirect=1) except wikipedia.IsRedirectPage: print "Is redirect page" return if n==0 and not arr[code,name]: print "Mother doesn't exist" return # Then add translations if we survi... | 36,101 |
def treesearch(code,name): arr={(code,name):None} # First make one step based on the language itself try: n=treestep(arr,code,name,abort_on_redirect=1) except wikipedia.IsRedirectPage: print "Is redirect page" return if n==0 and not arr[code,name]: print "Mother doesn't exist" return # Then add translations if we survi... | def treesearch(code,name): arr={(code,name):None} # First make one step based on the language itself try: n=treestep(arr,code,name,abort_on_redirect=1) except wikipedia.IsRedirectPage: print "Is redirect page" return if n==0 and not arr[code,name]: print "Mother doesn't exist" return # Then add translations if we survi... | 36,102 |
def treesearch(code,name): arr={(code,name):None} # First make one step based on the language itself try: n=treestep(arr,code,name,abort_on_redirect=1) except wikipedia.IsRedirectPage: print "Is redirect page" return if n==0 and not arr[code,name]: print "Mother doesn't exist" return # Then add translations if we survi... | def treesearch(code,name): arr={(code,name):None} # First make one step based on the language itself try: n=treestep(arr,code,name,abort_on_redirect=1) except wikipedia.IsRedirectPage: print "Is redirect page" return if n==0 and not arr[code,name]: print "Mother doesn't exist" return # Then add translations if we survi... | 36,103 |
def getall(code, pages): #print "DBG> getall", code, pages print "Getting %d pages from %s:"%(len(pages),code) return GetAll(code, pages).run() | def getall(code, pages): #print "DBG> getall", code, pages print "Getting %d pages from %s:"%(len(pages),code) return GetAll(code, pages).run() | 36,104 |
def showImageList(self, imagelist): for i in range(len(imagelist)): image = imagelist[i] print "-"*60 wikipedia.output(u"%s. Found image: %s"% (i, image.aslink())) try: # Show the image description page's contents wikipedia.output(image.get(throttle=False)) except wikipedia.NoPage: try: # Maybe the image is on the targ... | def showImageList(self, imagelist): for i in range(len(imagelist)): image = imagelist[i] print "-"*60 wikipedia.output(u"%s. Found image: %s"% (i, image.aslink())) try: # Show the image description page's contents wikipedia.output(image.get(throttle=False)) try: # Maybe the image is on the target site already targetTit... | 36,105 |
def showImageList(self, imagelist): for i in range(len(imagelist)): image = imagelist[i] print "-"*60 wikipedia.output(u"%s. Found image: %s"% (i, image.aslink())) try: # Show the image description page's contents wikipedia.output(image.get(throttle=False)) except wikipedia.NoPage: try: # Maybe the image is on the targ... | def showImageList(self, imagelist): for i in range(len(imagelist)): image = imagelist[i] print "-"*60 wikipedia.output(u"%s. Found image: %s"% (i, image.aslink())) try: # Show the image description page's contents wikipedia.output(image.get(throttle=False)) except wikipedia.NoPage: try: # Maybe the image is on the targ... | 36,106 |
def move_to_category(self, article, original_cat, current_cat): ''' Given an article which is in category original_cat, ask the user if it should be moved to one of original_cat's subcategories. Recursively run through subcategories' subcategories. NOTE: current_cat is only used for internal recursion. You should alway... | def move_to_category(self, article, original_cat, current_cat): ''' Given an article which is in category original_cat, ask the user if it should be moved to one of original_cat's subcategories. Recursively run through subcategories' subcategories. NOTE: current_cat is only used for internal recursion. You should alway... | 36,107 |
def treat(refpl): try: reftxt=refpl.get() except wikipedia.IsRedirectPage: pass else: # Check if boilerplate is really used in this article if not boilerplateR.search(reftxt): print "Not found in %s"%refpl return # Replace all occurences of the boilerplate in this article if resolve: reftxt = re.sub(boilerplateR, '{{s... | def treat(refpl): try: reftxt=refpl.get() except wikipedia.IsRedirectPage: pass else: # Check if boilerplate is really used in this article if not boilerplateR.search(reftxt): print "Not found in %s"%refpl return # Replace all occurences of the boilerplate in this article if resolve: reftxt = re.sub(boilerplateR, '{{s... | 36,108 |
def treat(refpl): try: reftxt=refpl.get() except wikipedia.IsRedirectPage: pass else: # Check if boilerplate is really used in this article if not boilerplateR.search(reftxt): print "Not found in %s"%refpl return # Replace all occurences of the boilerplate in this article if resolve: reftxt = re.sub(boilerplateR, '{{s... | def treat(refpl): try: reftxt=refpl.get() except wikipedia.IsRedirectPage: pass else: # Check if boilerplate is really used in this article if not boilerplateR.search(reftxt): print "Not found in %s"%refpl return # Replace all occurences of the boilerplate in this article if resolve: reftxt = re.sub(boilerplateR, '{{s... | 36,109 |
def treat(refpl): try: reftxt=refpl.get() except wikipedia.IsRedirectPage: pass else: # Check if boilerplate is really used in this article if not boilerplateR.search(reftxt): print "Not found in %s"%refpl return # Replace all occurences of the boilerplate in this article if resolve: reftxt = re.sub(boilerplateR, '{{s... | def treat(refpl): try: reftxt=refpl.get() except wikipedia.IsRedirectPage: pass else: # Check if boilerplate is really used in this article if not boilerplateR.search(reftxt): print "Not found in %s"%refpl return # Replace all occurences of the boilerplate in this article if resolve: reftxt = re.sub(boilerplateR, '{{s... | 36,110 |
def treat(refpl): try: reftxt=refpl.get() except wikipedia.IsRedirectPage: pass else: # Check if boilerplate is really used in this article if not boilerplateR.search(reftxt): print "Not found in %s"%refpl return # Replace all occurences of the boilerplate in this article if resolve: reftxt = re.sub(boilerplateR, '{{s... | def treat(refpl): try: reftxt=refpl.get() except wikipedia.IsRedirectPage: pass else: # Check if boilerplate is really used in this article if not boilerplateR.search(reftxt): print "Not found in %s"%refpl return # Replace all occurences of the boilerplate in this article if resolve: reftxt = re.sub(boilerplateR, '{{s... | 36,111 |
def makeMonthNamedList( lang, pattern, makeUpperCase = None ): """Creates a list of 12 elements based on the name of the month. The language-dependent month name is used as a formating argument to the pattern. The pattern must be have one %s that will be replaced by the localized month name. Use %%d for any other param... | def makeMonthNamedList( lang, pattern, makeUpperCase = None ): """Creates a list of 12 elements based on the name of the month. The language-dependent month name is used as a formating argument to the pattern. The pattern must be have one %s that will be replaced by the localized month name. Use %%d for any other param... | 36,112 |
def makeMonthNamedList( lang, pattern, makeUpperCase = None ): """Creates a list of 12 elements based on the name of the month. The language-dependent month name is used as a formating argument to the pattern. The pattern must be have one %s that will be replaced by the localized month name. Use %%d for any other param... | def makeMonthNamedList( lang, pattern, makeUpperCase = None ): """Creates a list of 12 elements based on the name of the month. The language-dependent month name is used as a formating argument to the pattern. The pattern must be have one %s that will be replaced by the localized month name. Use %%d for any other param... | 36,113 |
def assemblesecondrun(self, previous, askall): new = previous askit = askall for pl in self.done.keys(): code = pl.code() if code == wikipedia.mylang and pl.exists() and not pl.isRedirectPage() and not pl.isEmpty(): pass elif pl.exists() and not pl.isRedirectPage(): if new.has_key(code): pass elif code in ('zh-tw','zh-... | def assemblesecondrun(self, previous, askall=False): new = previous askit = askall for pl in self.done.keys(): code = pl.code() if code == wikipedia.mylang and pl.exists() and not pl.isRedirectPage() and not pl.isEmpty(): pass elif pl.exists() and not pl.isRedirectPage(): if new.has_key(code): pass elif code in ('zh-tw... | 36,114 |
def get_results(query, numresults = 10): url = list() if search_in_google: import google google.LICENSE_KEY = config.google_key print " google query..." search_request_retry = 6 while search_request_retry: | def get_results(query, numresults = 10): url = list() if search_in_google: import google google.LICENSE_KEY = config.google_key print " google query..." search_request_retry = 6 while search_request_retry: | 36,115 |
def get_results(query, numresults = 10): url = list() if search_in_google: import google google.LICENSE_KEY = config.google_key print " google query..." search_request_retry = 6 while search_request_retry: | def get_results(query, numresults = 10): url = list() if search_in_google: import google google.LICENSE_KEY = config.google_key print " google query..." search_request_retry = 6 while search_request_retry: | 36,116 |
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,117 |
def Movepages(page, deletedPages): pagetitle = page.title() wikipedia.output(u'\n>>>> %s <<<<' % pagetitle) ask = wikipedia.input('What do you do: (c)hange page name, (n)ext page or (q)uit?') if ask in ['c', 'C']: pagemove = wikipedia.input(u'New page name:') titleroot = wikipedia.Page(wikipedia.getSite(), pagetitle) m... | def Movepages(page, deletedPages): pagetitle = page.title() wikipedia.output(u'\n>>>> %s <<<<' % pagetitle) ask = wikipedia.input('What do you do: (c)hange page name (a)ppend to page name, (n)ext page or (q)uit?') if ask in ['c', 'C']: pagemove = wikipedia.input(u'New page name:') titleroot = wikipedia.Page(wikipedia.g... | 36,118 |
def change_category(article, oldCat, newCatTitle): """ 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 category... | def change_category(article, oldCat, newCatTitle, 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... | 36,119 |
def change_category(article, oldCat, newCatTitle): """ 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 category... | def change_category(article, oldCat, newCatTitle): """ 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 category... | 36,120 |
def change_category(article, oldCat, newCatTitle): """ 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 category... | def change_category(article, oldCat, newCatTitle): """ 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 category... | 36,121 |
def change_category(article, oldCat, newCatTitle): """ 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 category... | def change_category(article, oldCat, newCatTitle): """ 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 category... | 36,122 |
def get_imagelinks(url): # Given a URL, get all images linked to by the page at that URL. # First, we get the location for relative links from the URL. relativepath = url.split("/") if len(relativepath) == 1: relativepath=relativepath[0] else: relativepath=relativepath[:len(relativepath)-1] relativepath="/".join(relati... | def get_imagelinks(url): # Given a URL, get all images linked to by the page at that URL. # First, we get the location for relative links from the URL. relativepath = url.split("/") if len(relativepath) == 1: relativepath=relativepath[0] else: relativepath=relativepath[:len(relativepath)-1] relativepath="/".join(relati... | 36,123 |
def main(give_url,image_url): url = give_url fileformats = ('jpg', 'jpeg', 'png', 'gif', 'svg', 'ogg') basicdesc = [] mysite = wikipedia.getSite() if not mysite.loggedin(): print "You must be logged in to upload images" import sys sys.exit(1) if url == '': if image_url: url = wikipedia.input(u"What URL range should I... | def main(give_url,image_url): url = give_url basicdesc = [] mysite = wikipedia.getSite() if not mysite.loggedin(): print "You must be logged in to upload images" import sys sys.exit(1) if url == '': if image_url: url = wikipedia.input(u"What URL range should I check (use $ for the part that is changeable)") else: url... | 36,124 |
def main(give_url,image_url): url = give_url fileformats = ('jpg', 'jpeg', 'png', 'gif', 'svg', 'ogg') basicdesc = [] mysite = wikipedia.getSite() if not mysite.loggedin(): print "You must be logged in to upload images" import sys sys.exit(1) if url == '': if image_url: url = wikipedia.input(u"What URL range should I... | def main(give_url,image_url): url = give_url fileformats = ('jpg', 'jpeg', 'png', 'gif', 'svg', 'ogg') basicdesc = [] if not mysite.loggedin(): print "You must be logged in to upload images" import sys sys.exit(1) if url == '': if image_url: url = wikipedia.input(u"What URL range should I check (use $ for the part th... | 36,125 |
def main(give_url,image_url): url = give_url fileformats = ('jpg', 'jpeg', 'png', 'gif', 'svg', 'ogg') basicdesc = [] mysite = wikipedia.getSite() if not mysite.loggedin(): print "You must be logged in to upload images" import sys sys.exit(1) if url == '': if image_url: url = wikipedia.input(u"What URL range should I... | def main(give_url,image_url): url = give_url fileformats = ('jpg', 'jpeg', 'png', 'gif', 'svg', 'ogg') basicdesc = [] mysite = wikipedia.getSite() if not mysite.loggedin(): print "You must be logged in to upload images" import sys sys.exit(1) if url == '': if image_url: url = wikipedia.input(u"What URL range should I... | 36,126 |
def main(give_url,image_url): url = give_url fileformats = ('jpg', 'jpeg', 'png', 'gif', 'svg', 'ogg') basicdesc = [] mysite = wikipedia.getSite() if not mysite.loggedin(): print "You must be logged in to upload images" import sys sys.exit(1) if url == '': if image_url: url = wikipedia.input(u"What URL range should I... | def main(give_url,image_url): url = give_url fileformats = ('jpg', 'jpeg', 'png', 'gif', 'svg', 'ogg') basicdesc = [] mysite = wikipedia.getSite() if not mysite.loggedin(): print "You must be logged in to upload images" import sys sys.exit(1) if url == '': if image_url: url = wikipedia.input(u"What URL range should I... | 36,127 |
def link2url(name, code, incode = None): """Convert an interwiki link name of a page to the proper name to be used in a URL for that page. code should specify the language for the link""" if code == 'eo': name = name.replace('cx','ĉ') name = name.replace('Cx','Ĉ') name = name.replace('CX','Ĉ') name = nam... | def link2url(name, code, incode = None): """Convert an interwiki link name of a page to the proper name to be used in a URL for that page. code should specify the language for the link""" if code == 'eo': name = name.replace('cx','ĉ') name = name.replace('Cx','Ĉ') name = name.replace('CX','Ĉ') name = nam... | 36,128 |
def get_image(fn, target, description, debug=False): uploadaddr='/wiki/%s:Upload'%wikipedia.special[wikipedia.mylang] # Get file contents uo = wikipedia.MyURLopener() file = uo.open(fn) contents = file.read() file.close() # Isolate the pure name if '/' in fn: fn = fn.split('/')[-1] if '\\' in fn: fn = fn.split('\\')[-1... | def get_image(fn, target, description, debug=False): uploadaddr='/wiki/%s:Upload'%wikipedia.special[wikipedia.mylang] # Get file contents uo = wikipedia.MyURLopener() file = uo.open(fn) contents = file.read() file.close() # Isolate the pure name if '/' in fn: fn = fn.split('/')[-1] if '\\' in fn: fn = fn.split('\\')[-1... | 36,129 |
def main(): # How we want to retrieve information on which pages need to be changed. # Can either be 'sqldump', 'textfile' or 'userinput'. source = None # Array which will collect commandline parameters. # First element is original text, second element is replacement text. commandline_replacements = [] # A dictionary w... | def main(): # How we want to retrieve information on which pages need to be changed. # Can either be 'sqldump', 'textfile' or 'userinput'. source = None # Array which will collect commandline parameters. # First element is original text, second element is replacement text. commandline_replacements = [] # A dictionary w... | 36,130 |
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,131 |
def reportBacklinks(self, new): """Report missing back links. This will be called from finish() if needed.""" try: for site, page in new.iteritems(): if not page.section(): shouldlink = new.values() + [self.inpl] linked = page.interwiki() for xpage in shouldlink: if xpage != page and not xpage in linked: for l in linke... | def reportBacklinks(self, new, updatedSites): """ Report missing back links. This will be called from finish() if needed. updatedSites is a list that contains all sites we changed, to avoid reporting of missing backlinks for pages we already fixed """ try: for site, page in new.iteritems(): if not page.section(): sho... | 36,132 |
def reportBacklinks(self, new): """Report missing back links. This will be called from finish() if needed.""" try: for site, page in new.iteritems(): if not page.section(): shouldlink = new.values() + [self.inpl] linked = page.interwiki() for xpage in shouldlink: if xpage != page and not xpage in linked: for l in linke... | def reportBacklinks(self, new): """Report missing back links. This will be called from finish() if needed.""" try: for site, page in new.iteritems(): if site not in updatedSites and not page.section(): shouldlink = new.values() + [self.inpl] linked = page.interwiki() for xpage in shouldlink: if xpage != page and not xp... | 36,133 |
def main(): gen = None # How we want to retrieve information on which pages need to be changed. # Can either be 'xmldump', 'textfile' or 'userinput'. source = None # Array which will collect commandline parameters. # First element is original text, second element is replacement text. commandline_replacements = [] # A l... | def main(): gen = None # How we want to retrieve information on which pages need to be changed. # Can either be 'xmldump', 'textfile' or 'userinput'. source = None # Array which will collect commandline parameters. # First element is original text, second element is replacement text. commandline_replacements = [] # A l... | 36,134 |
def categories(self): """A list of categories that the article is in. This will retrieve the page text to do its work, so it can raise the same exceptions that are raised by the get() method. | def categories(self): """A list of categories that the article is in. This will retrieve the page text to do its work, so it can raise the same exceptions that are raised by the get() method. | 36,135 |
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 objects. """ if site is None: site = getSite() if site == Site('de', 'wikipedia'): raise Error('The PyWikipediaBot is no longer al... | 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 objects. """ if site is None: site = getSite() if site == Site('de', 'wikipedia'): raise Error('The PyWikipediaBot is no longer al... | 36,136 |
def disambcategory(self): try: return Page(self,self.namespace(14)+':'+self.family.disambcatname[self.lang]) except KeyError: raise NoPage | def disambcategory(self): try: return catlib.Category(self,self.namespace(14)+':'+self.family.disambcatname[self.lang]) except KeyError: raise NoPage | 36,137 |
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. """ | 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. """ | 36,138 |
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,139 |
def _make_catlist(self, recurse = False): """Make a list of all articles and categories that are in this category. If recurse is set to True, articles and categories of any subcategories are also retrieved. | def _make_catlist(self, recurse = False): """Make a list of all articles and categories that are in this category. If recurse is set to True, articles and categories of any subcategories are also retrieved. | 36,140 |
def _make_catlist(self, recurse = False): """Make a list of all articles and categories that are in this category. If recurse is set to True, articles and categories of any subcategories are also retrieved. | def _make_catlist(self, recurse = False): """Make a list of all articles and categories that are in this category. If recurse is set to True, articles and categories of any subcategories are also retrieved. | 36,141 |
def supercategories(self, recurse = False): """Create a list of all subcategories of the current category. | def supercategories(self, recurse = False): """Create a list of all subcategories of the current category. | 36,142 |
def showDiff(oldtext, newtext): """ Prints a string showing the differences between oldtext and newtext. The differences are highlighted (only on Unix systems) to show which changes were made. """ # For information on difflib, see http://pydoc.org/2.3/difflib.html color = { '+': 10, # green '-': 12 # red } diff = '' c... | def showDiff(oldtext, newtext): """ Prints a string showing the differences between oldtext and newtext. The differences are highlighted (only on Unix systems) to show which changes were made. """ # For information on difflib, see http://pydoc.org/2.3/difflib.html color = { '+': 10, # green '-': 12 # red } diff = '' c... | 36,143 |
def getEditPage(self, get_redirect=False, throttle = True, sysop = False): """ Get the contents of the Page via the edit page. Do not use this directly, use get() instead. Arguments: get_redirect - Get the contents, even if it is a redirect page This routine returns a unicode string containing the wiki text. """ isW... | def getEditPage(self, get_redirect=False, throttle = True, sysop = False): """ Get the contents of the Page via the edit page. Do not use this directly, use get() instead. Arguments: get_redirect - Get the contents, even if it is a redirect page This routine returns a unicode string containing the wiki text. """ isW... | 36,144 |
def cleanUpLinks(self, text): trailR = re.compile(self.site.linktrail()) # The regular expression which finds links. Results consist of four groups: # group title is the target page title, that is, everything before | or ]. # group section is the page section. It'll include the # to make life easier for us. # group lab... | def cleanUpLinks(self, text): trailR = re.compile(self.site.linktrail()) # The regular expression which finds links. Results consist of four groups: # group title is the target page title, that is, everything before | or ]. # group section is the page section. It'll include the # to make life easier for us. # group lab... | 36,145 |
def removeUselessSpaces(self, text): result = [] multipleSpacesR = re.compile(' +') spaceAtLineEndR = re.compile(' $') preR = re.compile('<pre', re.IGNORECASE) lines = text.split('\n') for line in lines: if len(line) > 0 and line[0] != ' ' and not preR.search(line): line = wikipedia.replaceExceptMathNowikiAndComments(... | def removeUselessSpaces(self, text): result = [] multipleSpacesR = re.compile(' +') spaceAtLineEndR = re.compile(' $') preR = re.compile('<pre', re.IGNORECASE) lines = text.split('\r\n') for line in lines: if len(line) > 0 and line[0] != ' ' and not preR.search(line): line = wikipedia.replaceExceptMathNowikiAndComment... | 36,146 |
def removeUselessSpaces(self, text): result = [] multipleSpacesR = re.compile(' +') spaceAtLineEndR = re.compile(' $') preR = re.compile('<pre', re.IGNORECASE) lines = text.split('\n') for line in lines: if len(line) > 0 and line[0] != ' ' and not preR.search(line): line = wikipedia.replaceExceptMathNowikiAndComments(... | def removeUselessSpaces(self, text): result = [] multipleSpacesR = re.compile(' +') spaceAtLineEndR = re.compile(' $') preR = re.compile('<pre', re.IGNORECASE) lines = text.split('\n') for line in lines: if len(line) > 0 and line[0] != ' ' and not preR.search(line): line = wikipedia.replaceExceptMathNowikiAndComments(... | 36,147 |
def entries(self): ''' Generator which reads one line at a time from the SQL dump file, and parses it to create SQLentry objects. Stops when the end of file is reached. ''' # This regular expression will match one SQL database entry (i.e. a # page), and each group represents an attribute of that entry. # NOTE: We don't... | def entries(self): ''' Generator which reads one line at a time from the SQL dump file, and parses it to create SQLentry objects. Stops when the end of file is reached. ''' # This regular expression will match one SQL database entry (i.e. a # page), and each group represents an attribute of that entry. # NOTE: We don't... | 36,148 |
def header(year): s=[] cent=(int(year)-1)/100+1 s.append('<!-- robot -->') s.append('<table align=center><tr><td align=center>') s.append("[[Eeuwen]]: [[%de eeuw]] -- '''[[%de eeuw]]''' -- [[%de eeuw]]"%tuple(range(cent-1,cent+2))) s.append('</td></tr><tr><td align=center>') s.append(('Jaren: '+'[[%d]] -- '*5+"'''%d'''... | def header(year): s=[] cent=(int(year)-1)/100+1 s.append('<!-- robot -->') s.append('<table align=center><tr><td align=center>') s.append("[[Eeuwen]]: [[%de eeuw]] -- '''[[%de eeuw]]''' -- [[%de eeuw]]"%tuple(range(cent-1,cent+2))) s.append('</td></tr><tr><td align=center>') s.append(('Jaren: '+'[[%s]] -- '*5+"'''%s'''... | 36,149 |
def header(year): s=[] cent=(int(year)-1)/100+1 s.append('<!-- robot -->') s.append('<table align=center><tr><td align=center>') s.append("[[Eeuwen]]: [[%de eeuw]] -- '''[[%de eeuw]]''' -- [[%de eeuw]]"%tuple(range(cent-1,cent+2))) s.append('</td></tr><tr><td align=center>') s.append(('Jaren: '+'[[%d]] -- '*5+"'''%d'''... | def header(year): s=[] cent=(int(year)-1)/100+1 s.append('<!-- robot -->') s.append('<table align=center><tr><td align=center>') s.append("[[Eeuwen]]: [[%de eeuw]] -- '''[[%de eeuw]]''' -- [[%de eeuw]]"%tuple(range(cent-1,cent+2))) s.append('</td></tr><tr><td align=center>') s.append(('Jaren: '+'[[%d]] -- '*5+"'''%d'''... | 36,150 |
def do(year): page=str(year) if debug: page='Robottest' text=wikipedia.getPage(mylang,page) # Replace all of these by the standardized formulae text=R4.sub("\r\n",text) text=R5.sub("\r\n\r\n",text) text=R10.sub("\r\n",text) text=R10.sub("\r\n",text) text=R10.sub("\r\n",text) text=R11.sub("\r\n",text) if R6.search(te... | deforgtext=text do(year):orgtext=text page=str(year)orgtext=text iforgtext=text debug:orgtext=text page='Robottest'orgtext=text orgtext=text text=wikipedia.getPage(mylang,page)orgtext=text orgtext=text #orgtext=text Replaceorgtext=text allorgtext=text oforgtext=text theseorgtext=text byorgtext=text theor... | 36,151 |
def do(year): page=str(year) if debug: page='Robottest' text=wikipedia.getPage(mylang,page) # Replace all of these by the standardized formulae text=R4.sub("\r\n",text) text=R5.sub("\r\n\r\n",text) text=R10.sub("\r\n",text) text=R10.sub("\r\n",text) text=R10.sub("\r\n",text) text=R11.sub("\r\n",text) if R6.search(te... | def do(year): page=str(year) if debug: page='Robottest' text=wikipedia.getPage(mylang,page) # Replace all of these by the standardized formulae text=R4.sub("\r\n",text) text=R5.sub("\r\n\r\n",text) text=R10.sub("\r\n",text) text=R10.sub("\r\n",text) text=R10.sub("\r\n",text) text=R11.sub("\r\n",text) text=R6.sub(... | 36,152 |
def do(year): page=str(year) if debug: page='Robottest' text=wikipedia.getPage(mylang,page) # Replace all of these by the standardized formulae text=R4.sub("\r\n",text) text=R5.sub("\r\n\r\n",text) text=R10.sub("\r\n",text) text=R10.sub("\r\n",text) text=R10.sub("\r\n",text) text=R11.sub("\r\n",text) if R6.search(te... | def do(year): page=str(year) if debug: page='Robottest' text=wikipedia.getPage(mylang,page) # Replace all of these by the standardized formulae text=R4.sub("\r\n",text) text=R5.sub("\r\n\r\n",text) text=R10.sub("\r\n",text) text=R10.sub("\r\n",text) text=R10.sub("\r\n",text) text=R11.sub("\r\n",text) if R6.search(te... | 36,153 |
def do(year): page=str(year) if debug: page='Robottest' text=wikipedia.getPage(mylang,page) # Replace all of these by the standardized formulae text=R4.sub("\r\n",text) text=R5.sub("\r\n\r\n",text) text=R10.sub("\r\n",text) text=R10.sub("\r\n",text) text=R10.sub("\r\n",text) text=R11.sub("\r\n",text) if R6.search(te... | def do(year): page=str(year) if debug: page='Robottest' text=wikipedia.getPage(mylang,page) # Replace all of these by the standardized formulae text=R4.sub("\r\n",text) text=R5.sub("\r\n\r\n",text) text=R10.sub("\r\n",text) text=R10.sub("\r\n",text) text=R10.sub("\r\n",text) text=R11.sub("\r\n",text) if R6.search(te... | 36,154 |
def main(): # the option that's always selected when the bot wonders what to do with # a link. If it's None, the user is prompted (default behaviour). always = None alternatives = [] getAlternatives = True solve_redirect = False # if the -file argument is used, page titles are dumped in this array. # otherwise it will ... | def main(): # the option that's always selected when the bot wonders what to do with # a link. If it's None, the user is prompted (default behaviour). always = None alternatives = [] getAlternatives = True solve_redirect = False # if the -file argument is used, page titles are dumped in this array. # otherwise it will ... | 36,155 |
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,156 |
def getFileVersionHistoryTable(self): lines = [] for (datetime, username, resolution, size, comment) in self.getFileVersionHistory(): lines.append('%s || %s || %s || %s || <nowiki>%s</nowiki>' % (datetime, username, resolution, size, comment)) return u'{| border="1"\n' + u'\n|----\n'.join(lines) + '\n|}' | def getFileVersionHistoryTable(self): lines = [] for (datetime, username, resolution, size, comment) in self.getFileVersionHistory(): lines.append('%s || %s || %s || %s || <nowiki>%s</nowiki>' % (datetime, username, resolution, size, comment)) return u'{| border="1"\n' + u'\n|----\n'.join(lines) + '\n|}' | 36,157 |
def isInterwikiLink(s, site = None): """ Try to check whether s is in the form "foo:bar" where foo is a known language code or family. In such a case we are dealing with an interwiki link. """ if not ':' in s: return False site = site or getSite() first, rest = s.split(':',1) # interwiki codes are case-insensitive firs... | def isInterwikiLink(s, site = None): """ Try to check whether s is in the form "foo:bar" where foo is a known language code or family. In such a case we are dealing with an interwiki link. """ if not ':' in s: return False site = site or getSite() first, rest = s.split(':',1) # interwiki codes are case-insensitive firs... | 36,158 |
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) #Page(... | 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, get_redirect = True, ... | 36,159 |
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,160 |
def getReferences(self, follow_redirects=True, offset=0): """ Return a list of pages that link to the page. If follow_redirects is True, also returns pages that link to a redirect pointing to the page. If offset is non-zero, skips that many references before loading. """ site = self.site() path = site.references_addres... | def getReferences(self, follow_redirects=True, offset=0): """ Return a list of pages that link to the page. If follow_redirects is True, also returns pages that link to a redirect pointing to the page. If offset is non-zero, skips that many references before loading. """ site = self.site() path = site.references_addres... | 36,161 |
def interwiki(self): """A list of interwiki links in the page. This will retrieve the page text to do its work, so it can raise the same exceptions that are raised by the get() method. | def interwiki(self): """A list of interwiki links in the page. This will retrieve the page text to do its work, so it can raise the same exceptions that are raised by the get() method. | 36,162 |
def interwiki(self): """A list of interwiki links in the page. This will retrieve the page text to do its work, so it can raise the same exceptions that are raised by the get() method. | def interwiki(self): """A list of interwiki links in the page. This will retrieve the page text to do its work, so it can raise the same exceptions that are raised by the get() method. | 36,163 |
def interwiki(self): """A list of interwiki links in the page. This will retrieve the page text to do its work, so it can raise the same exceptions that are raised by the get() method. | def interwiki(self): """A list of interwiki links in the page. This will retrieve the page text to do its work, so it can raise the same exceptions that are raised by the get() method. | 36,164 |
def interwiki(self): """A list of interwiki links in the page. This will retrieve the page text to do its work, so it can raise the same exceptions that are raised by the get() method. | def interwiki(self): """A list of interwiki links in the page. This will retrieve the page text to do its work, so it can raise the same exceptions that are raised by the get() method. | 36,165 |
def interwiki(self): """A list of interwiki links in the page. This will retrieve the page text to do its work, so it can raise the same exceptions that are raised by the get() method. | def interwiki(self): """A list of interwiki links in the page. This will retrieve the page text to do its work, so it can raise the same exceptions that are raised by the get() method. | 36,166 |
def getData(self): if self.pages == []: return address = self.site.export_address() # In the next line, we assume that what we got for eo: is NOT in x-convention # but SHOULD be. This is worst-case; to avoid not getting what we need, if we # find nothing, we will retry the normal way with an unadapted form. pagenames =... | def getData(self): if self.pages == []: return address = self.site.export_address() # In the next line, we assume that what we got for eo: is NOT in x-convention # but SHOULD be. This is worst-case; to avoid not getting what we need, if we # find nothing, we will retry the normal way with an unadapted form. pagenames =... | 36,167 |
def url2unicode(percentname, site): # Does the input string contain non-ascii characters? In that case, # it is not really an url, and we do not have to unquote it.... for c in percentname: if ord(c)>128: x=percentname break else: # Before removing the % encoding, make sure it is an ASCII string. # unquote doesn't work... | def url2unicode(percentname, site): # Does the input string contain non-ascii characters? In that case, # it is not really an url, and we do not have to unquote it.... for c in percentname: if ord(c)>128: x=percentname break else: # Before removing the % encoding, make sure it is an ASCII string. # unquote doesn't work... | 36,168 |
def url2unicode(percentname, site): # Does the input string contain non-ascii characters? In that case, # it is not really an url, and we do not have to unquote it.... for c in percentname: if ord(c)>128: x=percentname break else: # Before removing the % encoding, make sure it is an ASCII string. # unquote doesn't work... | def url2unicode(percentname, site): # Does the input string contain non-ascii characters? In that case, # it is not really an url, and we do not have to unquote it.... for c in percentname: if ord(c)>128: x=percentname break else: # Before removing the % encoding, make sure it is an ASCII string. # unquote doesn't work... | 36,169 |
def url2unicode(percentname, site): # Does the input string contain non-ascii characters? In that case, # it is not really an url, and we do not have to unquote it.... for c in percentname: if ord(c)>128: x=percentname break else: # Before removing the % encoding, make sure it is an ASCII string. # unquote doesn't work... | def url2unicode(percentname, site): # Does the input string contain non-ascii characters? In that case, # it is not really an url, and we do not have to unquote it.... for c in percentname: if ord(c)>128: x=percentname break else: # Before removing the % encoding, make sure it is an ASCII string. # unquote doesn't work... | 36,170 |
def __init__(self): family.Family.__init__(self) self.name = 'wikibooks' # Known wikibooks languages, given as a dictionary mapping the language code # to the hostname of the site hosting that wiktibooks. For human consumption, # the full name of the language is given behind each line as a comment self.langs = { 'minna... | def __init__(self): family.Family.__init__(self) self.name = 'wikibooks' # Known wikibooks languages, given as a dictionary mapping the language code # to the hostname of the site hosting that wiktibooks. For human consumption, # the full name of the language is given behind each line as a comment self.langs = { 'minna... | 36,171 |
def __init__(self): family.Family.__init__(self) self.name = 'wikibooks' # Known wikibooks languages, given as a dictionary mapping the language code # to the hostname of the site hosting that wiktibooks. For human consumption, # the full name of the language is given behind each line as a comment self.langs = { 'minna... | def __init__(self): family.Family.__init__(self) self.name = 'wikibooks' # Known wikibooks languages, given as a dictionary mapping the language code # to the hostname of the site hosting that wiktibooks. For human consumption, # the full name of the language is given behind each line as a comment self.langs = { 'minna... | 36,172 |
def __init__(self): family.Family.__init__(self) self.name = 'wikibooks' # Known wikibooks languages, given as a dictionary mapping the language code # to the hostname of the site hosting that wiktibooks. For human consumption, # the full name of the language is given behind each line as a comment self.langs = { 'minna... | def __init__(self): family.Family.__init__(self) self.name = 'wikibooks' # Known wikibooks languages, given as a dictionary mapping the language code # to the hostname of the site hosting that wiktibooks. For human consumption, # the full name of the language is given behind each line as a comment self.langs = { 'minna... | 36,173 |
def run(self): if self.main_only: if not ignore_title.has_key(self.mysite.family.name): ignore_title[self.mysite.family.name] = {} if not ignore_title[self.mysite.family.name].has_key(self.mylang): ignore_title[self.mysite.family.name][self.mylang] = [] ignore_title[self.mysite.family.name][self.mylang] += [ u'%s:' % n... | def run(self): if self.main_only: if not ignore_title.has_key(self.mysite.family.name): ignore_title[self.mysite.family.name] = {} if not ignore_title[self.mysite.family.name].has_key(self.mylang): ignore_title[self.mysite.family.name][self.mylang] = [] ignore_title[self.mysite.family.name][self.mylang] += [ u'%s:' % n... | 36,174 |
def __init__(self,wikilang,term): # wikilang here refers to the language of the Wiktionary self.wikilang=wikilang self.term=term self.subentries = {} # subentries is a dictionary of subentry objects indexed by wikilang self.sortedsubentries = [] | def __init__(self,wikilang,term): # wikilang here refers to the language of the Wiktionary self.wikilang=wikilang self.term=term self.subentries = {} # subentries is a dictionary of subentry objects indexed by wikilang self.sortedsubentries = [] | 36,175 |
def addSubEntry(self,subentry): | def addSubEntry(self,subentry): | 36,176 |
def sortSubentries(self): print self.subentries if not self.subentries == {}: self.sortedsubentries = self.subentries.keys() self.sortedsubentries.sort(sortonname(langnames[self.wikilang])) print "should now be sorted: %s"%self.sortedsubentries i = 0 while 1: x = self.sortedsubentries[i] if x == self.wikilang: # sear... | def sortSubentries(self): print self.subentries if not self.subentries == {}: self.sortedsubentries = self.subentries.keys() self.sortedsubentries.sort(sortonname(langnames[self.wikilang])) print "should now be sorted: %s"%self.sortedsubentries i = 0 while i< len(self.sortedsubentries): x = self.sortedsubentries[i] i... | 36,177 |
def wikiwrap(self): entry = '' self.sortSubentries() print "sorted: %s",self.sortedsubentries for subentry in self.sortedsubentries: entry= entry + self.subentries[subentry].wikiwrap(self.wikilang) + '\n' | def wikiwrap(self): entry = '' self.sortSubentries() print "sorted: %s",self.sortedsubentries for subentry in self.sortedsubentries: entry= entry + self.subentries[subentry].wikiwrap(self.wikilang) + '\n' | 36,178 |
def showcontents(self): indentation = 0 print ' ' * indentation + 'wikilang = %s'% self.wikilang | def showcontents(self): indentation = 0 print ' ' * indentation + 'wikilang = %s'% self.wikilang | 36,179 |
def showcontents(self): indentation = 0 print ' ' * indentation + 'wikilang = %s'% self.wikilang | defsubentry.showcontents(indentation+2) showcontents(self):subentry.showcontents(indentation+2) indentationsubentry.showcontents(indentation+2) =subentry.showcontents(indentation+2) 0subentry.showcontents(indentation+2) printsubentry.showcontents(indentation+2) 'subentry.showcontents(indentation+2) 'subentry.showconten... | 36,180 |
def __cmp__(self, other): """Pseudo method to be able to use equality and inequality tests on PageLink objects""" #print "__cmp__", self, other if not hasattr(other, 'code'): return -1 if not self.code() == other.code(): return cmp(self.code(), other.code()) u1=html2unicode(self.linkname(), language = self.code()) u2=h... | def__cmp__(self,other):"""PseudomethodtobeabletouseequalityandinequalitytestsonPageLinkobjects"""#print"__cmp__",self,otherifnothasattr(other,'code'):return-1ifnotself.code()==other.code():returncmp(self.code(),other.code())u1=html2unicode(self.linkname(),language=self.code())u2=html2unicode(other.linkname(),language=o... | 36,181 |
def removeEntity(name): import re, htmlentitydefs Rentity = re.compile(r'&([A-Za-z]+);') result = '' i = 0 while i < len(name): m = Rentity.match(name[i:]) if m: if htmlentitydefs.entitydefs.has_key(m.group(1)): result = result + htmlentitydefs.entitydefs[m.group(1)] i += m.end() else: result += name[i] i += 1 else: re... | def removeEntity(name): import re, htmlentitydefs Rentity = re.compile(r'&([A-Za-z]+);') result = u'' i = 0 while i < len(name): m = Rentity.match(name[i:]) if m: if htmlentitydefs.entitydefs.has_key(m.group(1)): result = result + htmlentitydefs.entitydefs[m.group(1)] i += m.end() else: result += name[i] i += 1 else: r... | 36,182 |
def removeEntity(name): import re, htmlentitydefs Rentity = re.compile(r'&([A-Za-z]+);') result = '' i = 0 while i < len(name): m = Rentity.match(name[i:]) if m: if htmlentitydefs.entitydefs.has_key(m.group(1)): result = result + htmlentitydefs.entitydefs[m.group(1)] i += m.end() else: result += name[i] i += 1 else: re... | def removeEntity(name): import re, htmlentitydefs Rentity = re.compile(r'&([A-Za-z]+);') result = '' i = 0 while i < len(name): m = Rentity.match(name[i:]) if m: if htmlentitydefs.name2codepoint.has_key(m.group(1)): x = htmlentitydefs.name2codepoint[m.group(1)] result = result + unichr(x) i += m.end() else: result += n... | 36,183 |
def html2unicode(name, language, altlanguage=None): name = removeEntity(name) name = unicodeName(name, language, altlanguage) import re Runi = re.compile('&#(\d+);') result = u'' i=0 while i < len(name): m = Runi.match(name[i:]) if m: result += unichr(int(m.group(1))) i += m.end() else: try: result += name[i] i += 1 e... | def html2unicode(name, language, altlanguage=None): name = removeEntity(name) import re Runi = re.compile('&#(\d+);') result = u'' i=0 while i < len(name): m = Runi.match(name[i:]) if m: result += unichr(int(m.group(1))) i += m.end() else: try: result += name[i] i += 1 except UnicodeDecodeError: print repr(name) raise... | 36,184 |
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. """ | 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. """ | 36,185 |
def __call__(self, m, d): import wikipedia return wikipedia.html2unicode((date_format[m][self.site.lang]) % d, site = self.site) | def __call__(self, m, d): import wikipedia return wikipedia.html2unicode((date_format[m][self.site.lang]) % d, site = self.site) | 36,186 |
def __call__(self, m, d): import wikipedia return wikipedia.html2unicode((date_format[m][self.site.lang]) % d, site = self.site) | def __call__(self, m, d): import wikipedia return wikipedia.html2unicode((date_format[m][self.site.lang]) % d, site = self.site) | 36,187 |
def __call__(self, m, d): import wikipedia return wikipedia.html2unicode((date_format[m][self.site.lang]) % d, site = self.site) | def __call__(self, m, d): import wikipedia return wikipedia.html2unicode((date_format[m][self.site.lang]) % d, site = self.site) | 36,188 |
def __call__(self, m, d): import wikipedia return wikipedia.html2unicode((date_format[m][self.site.lang]) % d, site = self.site) | def __call__(self, m, d): import wikipedia return wikipedia.html2unicode((date_format[m][self.site.lang]) % d, site = self.site) | 36,189 |
def __call__(self, m, d): import wikipedia return wikipedia.html2unicode((date_format[m][self.site.lang]) % d, site = self.site) | def __call__(self, m, d): import wikipedia return wikipedia.html2unicode((date_format[m][self.site.lang]) % d, site = self.site) | 36,190 |
def __call__(self, m, d): import wikipedia return wikipedia.html2unicode((date_format[m][self.site.lang]) % d, site = self.site) | def __call__(self, m, d): import wikipedia return wikipedia.html2unicode((date_format[m][self.site.lang]) % d, site = self.site) | 36,191 |
def __call__(self, m, d): import wikipedia return wikipedia.html2unicode((date_format[m][self.site.lang]) % d, site = self.site) | def __call__(self, m, d): import wikipedia return wikipedia.html2unicode((date_format[m][self.site.lang]) % d, site = self.site) | 36,192 |
def header(year): s=[] cent=(int(year)-1)/100+1 s.append('<!-- robot -->') s.append('<table align=center><tr><td align=center>') s.append("[[Eeuwen]]: [[%s]] -- '''[[%s]]''' -- [[%s]]"%cmap(beforeandafter(cent))) s.append('</td></tr><tr><td align=center>') s.append(('Jaren: '+'[[%s]] -- '*5+"'''%s'''"+' -- [[%s]]'*5)%y... | def header(year): s=[] cent=(int(year)-1)/100+1 s.append('<!-- robot -->') s.append('<table align=center><tr><td align=center>') s.append("[[Eeuwen]]: [[%s]] -- '''[[%s]]''' -- [[%s]]"%cmap(beforeandafter(cent))) s.append('</td></tr><tr><td align=center>') s.append(('Jaren: '+'[[%s]] -- '*5+"'''%s'''"+' -- [[%s]]'*5)%y... | 36,193 |
def header(year): s=[] cent=(int(year)-1)/100+1 s.append('<!-- robot -->') s.append('<table align=center><tr><td align=center>') s.append("[[Eeuwen]]: [[%s]] -- '''[[%s]]''' -- [[%s]]"%cmap(beforeandafter(cent))) s.append('</td></tr><tr><td align=center>') s.append(('Jaren: '+'[[%s]] -- '*5+"'''%s'''"+' -- [[%s]]'*5)%y... | def header(year): s=[] cent=(int(year)-1)/100+1 s.append('<!-- robot -->') s.append('<table align=center><tr><td align=center>') s.append("[[Eeuwen]]: [[%s]] -- '''[[%s]]''' -- [[%s]]"%cmap(beforeandafter(cent))) s.append('</td></tr><tr><td align=center>') s.append(('Jaren: '+'[[%s]] -- '*5+"'''%s'''"+' -- [[%s]]'*5)%y... | 36,194 |
def header(year): s=[] cent=(int(year)-1)/100+1 s.append('<!-- robot -->') s.append('<table align=center><tr><td align=center>') s.append("[[Eeuwen]]: [[%s]] -- '''[[%s]]''' -- [[%s]]"%cmap(beforeandafter(cent))) s.append('</td></tr><tr><td align=center>') s.append(('Jaren: '+'[[%s]] -- '*5+"'''%s'''"+' -- [[%s]]'*5)%y... | def header(year): s=[] cent=(int(year)-1)/100+1 s.append('<!-- robot -->') s.append('<table align=center><tr><td align=center>') s.append("[[Eeuwen]]: [[%s]] -- '''[[%s]]''' -- [[%s]]"%cmap(beforeandafter(cent))) s.append('</td></tr><tr><td align=center>') s.append(('Jaren: '+'[[%s]] -- '*5+"'''%s'''"+' -- [[%s]]'*5)%y... | 36,195 |
def header(year): s=[] cent=(int(year)-1)/100+1 s.append('<!-- robot -->') s.append('<table align=center><tr><td align=center>') s.append("[[Eeuwen]]: [[%s]] -- '''[[%s]]''' -- [[%s]]"%cmap(beforeandafter(cent))) s.append('</td></tr><tr><td align=center>') s.append(('Jaren: '+'[[%s]] -- '*5+"'''%s'''"+' -- [[%s]]'*5)%y... | def header(year): s=[] cent=(int(year)-1)/100+1 s.append('<!-- robot -->') s.append('<table align=center><tr><td align=center>') s.append("[[Eeuwen]]: [[%s]] -- '''[[%s]]''' -- [[%s]]"%cmap(beforeandafter(cent))) s.append('</td></tr><tr><td align=center>') s.append(('Jaren: '+'[[%s]] -- '*5+"'''%s'''"+' -- [[%s]]'*5)%y... | 36,196 |
def do(year): page=str(year) if debug: page='Robottest' text=wikipedia.getPage(mylang,page) orgtext=text # Replace all of these by the standardized formulae text=R4.sub("\r\n",text) text=R5.sub("\r\n\r\n",text) text=R10.sub("\r\n",text) text=R10.sub("\r\n",text) text=R10.sub("\r\n",text) text=R11.sub("\r\n",text) te... | def do(year): page=str(year) if debug: page='Robottest' try: text=wikipedia.getPage(mylang,page) except wikipedia.NoPage: return orgtext=text # Replace all of these by the standardized formulae text=R4.sub("\r\n",text) text=R5.sub("\r\n\r\n",text) text=R10.sub("\r\n",text) text=R10.sub("\r\n",text) text=R10.sub("\r... | 36,197 |
def do(year): page=str(year) if debug: page='Robottest' text=wikipedia.getPage(mylang,page) orgtext=text # Replace all of these by the standardized formulae text=R4.sub("\r\n",text) text=R5.sub("\r\n\r\n",text) text=R10.sub("\r\n",text) text=R10.sub("\r\n",text) text=R10.sub("\r\n",text) text=R11.sub("\r\n",text) te... | def do(year): page=str(year) if debug: page='Robottest' text=wikipedia.getPage(mylang,page) orgtext=text # Replace all of these by the standardized formulae text=R4.sub("\r\n",text) text=R5.sub("\r\n\r\n",text) text=R10.sub("\r\n",text) text=R10.sub("\r\n",text) text=R10.sub("\r\n",text) text=R11.sub("\r\n",text) te... | 36,198 |
def do(year): page=str(year) if debug: page='Robottest' text=wikipedia.getPage(mylang,page) orgtext=text # Replace all of these by the standardized formulae text=R4.sub("\r\n",text) text=R5.sub("\r\n\r\n",text) text=R10.sub("\r\n",text) text=R10.sub("\r\n",text) text=R10.sub("\r\n",text) text=R11.sub("\r\n",text) te... | def do(year): page=str(year) if debug: page='Robottest' text=wikipedia.getPage(mylang,page) orgtext=text # Replace all of these by the standardized formulae text=R4.sub("\r\n",text) text=R5.sub("\r\n\r\n",text) text=R10.sub("\r\n",text) text=R10.sub("\r\n",text) text=R10.sub("\r\n",text) text=R11.sub("\r\n",text) te... | 36,199 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.