bugged stringlengths 4 228k | fixed stringlengths 0 96.3M | __index_level_0__ int64 0 481k |
|---|---|---|
def dh_knYearConverter( value ): if type(value) is int: # Encode an integer value into a textual form. return unicode(value).translate(_knDigitsToLocal) else: # First make sure there are no real digits in the string tmp = value.translate(_knDigitsToLocal) # Test if tmp == value: tmp = value.translate(_knLocalTo... | def dh_knYearConverter( value ): if type(value) is int: # Encode an integer value into a textual form. return unicode(value).translate(_knDigitsToLocal) else: # First make sure there are no real digits in the string tmp = value.translate(_knDigitsToLocal) # Test if tmp == value: tmp = value.translate(_knLocalTo... | 35,300 |
def dh_knYearConverter( value ): if type(value) is int: # Encode an integer value into a textual form. return unicode(value).translate(_knDigitsToLocal) else: # First make sure there are no real digits in the string tmp = value.translate(_knDigitsToLocal) # Test if tmp == value: tmp = value.translate(_knLocalTo... | def dh_knYearConverter( value ): if type(value) is int: # Encode an integer value into a textual form. return unicode(value).translate(_knDigitsToLocal) else: # First make sure there are no real digits in the string tmp = value.translate(_knDigitsToLocal) # Test if tmp == value: tmp = value.translate(_knLocalTo... | 35,301 |
def dh_knYearConverter( value ): if type(value) is int: # Encode an integer value into a textual form. return unicode(value).translate(_knDigitsToLocal) else: # First make sure there are no real digits in the string tmp = value.translate(_knDigitsToLocal) # Test if tmp == value: tmp = value.translate(_knLocalTo... | def dh_knYearConverter( value ): if type(value) is int: # Encode an integer value into a textual form. return unicode(value).translate(_knDigitsToLocal) else: # First make sure there are no real digits in the string tmp = value.translate(_knDigitsToLocal) # Test if tmp == value: tmp = value.translate(_knLocalTo... | 35,302 |
def dh_knYearConverter( value ): if type(value) is int: # Encode an integer value into a textual form. return unicode(value).translate(_knDigitsToLocal) else: # First make sure there are no real digits in the string tmp = value.translate(_knDigitsToLocal) # Test if tmp == value: tmp = value.translate(_knLocalTo... | def dh_knYearConverter( value ): if type(value) is int: # Encode an integer value into a textual form. return unicode(value).translate(_knDigitsToLocal) else: # First make sure there are no real digits in the string tmp = value.translate(_knDigitsToLocal) # Test if tmp == value: tmp = value.translate(_knLocalTo... | 35,303 |
def dh_knYearConverter( value ): if type(value) is int: # Encode an integer value into a textual form. return unicode(value).translate(_knDigitsToLocal) else: # First make sure there are no real digits in the string tmp = value.translate(_knDigitsToLocal) # Test if tmp == value: tmp = value.translate(_knLocalTo... | def dh_knYearConverter( value ): if type(value) is int: # Encode an integer value into a textual form. return unicode(value).translate(_knDigitsToLocal) else: # First make sure there are no real digits in the string tmp = value.translate(_knDigitsToLocal) # Test if tmp == value: tmp = value.translate(_knLocalTo... | 35,304 |
def oneDone(self, title, timestamp, text): #print "DBG>", repr(title), timestamp, len(text) pl = PageLink(self.code, title) for pl2 in self.pages: #print "DBG>", pl, pl2, pl2.hashfreeLinkname() if PageLink(self.code, pl2.hashfreeLinkname()) == pl: if not hasattr(pl2,'_contents') and not hasattr(pl2,'_getexception'): br... | def oneDone(self, title, timestamp, text): #print "DBG>", repr(title), timestamp, len(text) pl = PageLink(self.code, title) for pl2 in self.pages: #print "DBG>", pl, pl2, pl2.hashfreeLinkname() if PageLink(self.code, pl2.hashfreeLinkname()) == pl: if not hasattr(pl2,'_contents') and not hasattr(pl2,'_getexception'): br... | 35,305 |
def html2unicode(name, language, altlanguage=None): name = unicodeName(name, language, altlanguage) name = removeEntity(name) Runi = re.compile('&#(\d+);') Runi2 = re.compile('&#x([0-9a-f]+);') result = u'' i=0 while i < len(name): m = Runi.match(name[i:]) m2 = Runi2.match(name[i:]) if m: result += unichr(int(m.group(... | def html2unicode(name, language, altlanguage=None): name = unicodeName(name, language, altlanguage) name = removeEntity(name) Runi = re.compile('&#(\d+);') Runi2 = re.compile('&#x([0-9a-f]+);') result = u'' i=0 while i < len(name): m = Runi.match(name[i:]) m2 = Runi2.match(name[i:]) if m: result += unichr(int(m.group(... | 35,306 |
def run(self): dt=15 while 1: try: data = self.getData() except socket.error: # Print the traceback of the caught exception print ''.join(traceback.format_exception(*sys.exc_info())) output(u'DBG> got socket error in GetAll.run. Sleeping for %d seconds'%dt) time.sleep(dt) dt *= 2 else: break handler = WikimediaXmlHandl... | def run(self): dt=15 while True: try: data = self.getData() except socket.error: # Print the traceback of the caught exception print ''.join(traceback.format_exception(*sys.exc_info())) output(u'DBG> got socket error in GetAll.run. Sleeping for %d seconds'%dt) time.sleep(dt) dt *= 2 else: break handler = WikimediaXmlHa... | 35,307 |
def run(self): dt=15 while 1: try: data = self.getData() except socket.error: # Print the traceback of the caught exception print ''.join(traceback.format_exception(*sys.exc_info())) output(u'DBG> got socket error in GetAll.run. Sleeping for %d seconds'%dt) time.sleep(dt) dt *= 2 else: break handler = WikimediaXmlHandl... | def run(self): dt=15 while 1: try: data = self.getData() except socket.error: # Print the traceback of the caught exception print ''.join(traceback.format_exception(*sys.exc_info())) output(u'DBG> got socket error in GetAll.run. Sleeping for %d seconds'%dt) time.sleep(dt) if dt <= 60: dt += 15 elif dt < 360: dt += 60 e... | 35,308 |
def run(self): dt=15 while 1: try: data = self.getData() except socket.error: # Print the traceback of the caught exception print ''.join(traceback.format_exception(*sys.exc_info())) output(u'DBG> got socket error in GetAll.run. Sleeping for %d seconds'%dt) time.sleep(dt) dt *= 2 else: break handler = WikimediaXmlHandl... | def run(self): dt=15 while 1: try: data = self.getData() except socket.error: # Print the traceback of the caught exception print ''.join(traceback.format_exception(*sys.exc_info())) output(u'DBG> got socket error in GetAll.run. Sleeping for %d seconds'%dt) time.sleep(dt) dt *= 2 else: break handler = WikimediaXmlHandl... | 35,309 |
def run(self): dt=15 while 1: try: data = self.getData() except socket.error: # Print the traceback of the caught exception print ''.join(traceback.format_exception(*sys.exc_info())) output(u'DBG> got socket error in GetAll.run. Sleeping for %d seconds'%dt) time.sleep(dt) dt *= 2 else: break handler = WikimediaXmlHandl... | def run(self): dt=15 while 1: try: data = self.getData() except socket.error: # Print the traceback of the caught exception print ''.join(traceback.format_exception(*sys.exc_info())) output(u'DBG> got socket error in GetAll.run. Sleeping for %d seconds'%dt) time.sleep(dt) dt *= 2 else: break handler = WikimediaXmlHandl... | 35,310 |
def run(self): dt=15 while 1: try: data = self.getData() except socket.error: # Print the traceback of the caught exception print ''.join(traceback.format_exception(*sys.exc_info())) output(u'DBG> got socket error in GetAll.run. Sleeping for %d seconds'%dt) time.sleep(dt) dt *= 2 else: break handler = WikimediaXmlHandl... | def run(self): dt=15 while 1: try: data = self.getData() except socket.error: # Print the traceback of the caught exception print ''.join(traceback.format_exception(*sys.exc_info())) output(u'DBG> got socket error in GetAll.run. Sleeping for %d seconds'%dt) time.sleep(dt) dt *= 2 else: break handler = WikimediaXmlHandl... | 35,311 |
def run(self): dt=15 while 1: try: data = self.getData() except socket.error: # Print the traceback of the caught exception print ''.join(traceback.format_exception(*sys.exc_info())) output(u'DBG> got socket error in GetAll.run. Sleeping for %d seconds'%dt) time.sleep(dt) dt *= 2 else: break handler = WikimediaXmlHandl... | def run(self): dt=15 while 1: try: data = self.getData() except socket.error: # Print the traceback of the caught exception print ''.join(traceback.format_exception(*sys.exc_info())) output(u'DBG> got socket error in GetAll.run. Sleeping for %d seconds'%dt) time.sleep(dt) dt *= 2 else: break handler = WikimediaXmlHandl... | 35,312 |
def put(self, newtext, comment=None, watchArticle = False, minorEdit = True): """Replace the new page with the contents of the first argument. The second argument is a string that is to be used as the summary for the modification """ if self.exists(): newPage="0" else: newPage="1" if self.site().version() >= "1.4": if ... | def put(self, newtext, comment=None, watchArticle = False, minorEdit = True): """Replace the new page with the contents of the first argument. The second argument is a string that is to be used as the summary for the modification """ if self.exists(): newPage="0" else: newPage="1" if self.site().version() >= "1.4": if ... | 35,313 |
def getPage(site, name, get_edit_page = True, read_only = False, do_quote = True, get_redirect=False, throttle = True): """ Get the contents of page 'name' from the 'site' wiki Do not use this directly; for 99% of the possible ideas you can use the PageLink object instead. Arguments: site - the wiki site name... | def R = re.compile(r"\<input type='hidden' value=\"(.*?)\" name=\"wpEditToken\"") tokenloc = R.search(text) if tokenloc: site.puttoken(tokenloc.group(1)) elif not site.gettoken(): site.puttoken('') getPage(site, R = re.compile(r"\<input type='hidden' value=\"(.*?)\" name=\"wpEditToken\"") tokenloc = R.search(text) i... | 35,314 |
def getPage(site, name, get_edit_page = True, read_only = False, do_quote = True, get_redirect=False, throttle = True): """ Get the contents of page 'name' from the 'site' wiki Do not use this directly; for 99% of the possible ideas you can use the PageLink object instead. Arguments: site - the wiki site name... | def getPage(site, name, get_edit_page = True, read_only = False, do_quote = True, get_redirect=False, throttle = True): """ Get the contents of page 'name' from the 'site' wiki Do not use this directly; for 99% of the possible ideas you can use the PageLink object instead. Arguments: site - the wiki site name... | 35,315 |
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... | 35,316 |
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.""" host = langs[code] if code in oldsoftware: # Old algorithm name = re.sub('_', ' ', name) n = [] for x in name.split(): n.append(x[0].cap... | 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.""" host = langs[code] if code in oldsoftware: # Old algorithm name = re.sub('_', ' ', name) n = [] for x in name.split(): n.append(x[0].cap... | 35,317 |
def ReadWarnfile(fn, sa): import re R=re.compile(r'WARNING: ([^\[]*):\[\[([^\[]+)\]\]([^\[]+)\[\[([^\[]+):([^\[]+)\]\]') f=open(fn) hints={} for line in f.readlines(): m=R.search(line) if m: #print "DBG>",line if m.group(1)==wikipedia.mylang: #print m.group(1), m.group(2), m.group(3), m.group(4), m.group(5) if not hint... | def ReadWarnfile(fn, sa): import re R=re.compile(r'WARNING: ([^\[]*):\[\[([^\[]+)\]\]([^\[]+)\[\[([^\[]+):([^\[]+)\]\]') f=open(fn) hints={} for line in f.readlines(): m=R.search(line) if m: #print "DBG>",line if m.group(1)==wikipedia.mylang: #print m.group(1), m.group(2), m.group(3), m.group(4), m.group(5) if not hint... | 35,318 |
def __init__(self, url, redirectList = []): """ redirectList is a list of redirects which were resolved by resolveRedirect(). This is needed to detect redirect loops. """ self.url = url self.redirectList = redirectList # we ignore the fragment self.scheme, self.host, self.path, self.query, self.fragment = urlparse.urls... | def __init__(self, url, redirectChain = []): """ redirectChain is a list of redirects which were resolved by resolveRedirect(). This is needed to detect redirect loops. """ self.url = url self.redirectList = redirectList # we ignore the fragment self.scheme, self.host, self.path, self.query, self.fragment = urlparse.ur... | 35,319 |
def __init__(self, url, redirectList = []): """ redirectList is a list of redirects which were resolved by resolveRedirect(). This is needed to detect redirect loops. """ self.url = url self.redirectList = redirectList # we ignore the fragment self.scheme, self.host, self.path, self.query, self.fragment = urlparse.urls... | def __init__(self, url, redirectList = []): """ redirectList is a list of redirects which were resolved by resolveRedirect(). This is needed to detect redirect loops. """ self.url = url self.redirectChain = redirectChain + [self.url] # we ignore the fragment self.scheme, self.host, self.path, self.query, self.fragment ... | 35,320 |
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() | 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() | 35,321 |
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() | 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() | 35,322 |
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() | 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() | 35,323 |
def check(self): """ Returns True and the server status message if the page is alive. Otherwise returns false and an error message. """ try: url = 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 UnicodeEncod... | def check(self): """ Returns True and the server status message if the page is alive. Otherwise returns false """ try: url = 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: return Fa... | 35,324 |
def check(self): """ Returns True and the server status message if the page is alive. Otherwise returns false and an error message. """ try: url = 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 UnicodeEncod... | def check(self): """ Returns True and the server status message if the page is alive. Otherwise returns false and an error message. """ try: url = 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 UnicodeEncod... | 35,325 |
def check(self): """ Returns True and the server status message if the page is alive. Otherwise returns false and an error message. """ try: url = 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 UnicodeEncod... | def check(self): """ Returns True and the server status message if the page is alive. Otherwise returns false and an error message. """ try: url = 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 UnicodeEncod... | 35,326 |
def checkLinksIn(self, title, text): # RFC 2396 says that URLs may only contain certain characters. # For this regex we also accept non-allowed characters, so that the bot # will later show these links as broken ('Non-ASCII Characters in URL'). # Note: while allowing parenthesis inside URLs, MediaWiki will regard # rig... | def checkLinksIn(self, title, text): # RFC 2396 says that URLs may only contain certain characters. # For this regex we also accept non-allowed characters, so that the bot # will later show these links as broken ('Non-ASCII Characters in URL'). # Note: while allowing parenthesis inside URLs, MediaWiki will regard # rig... | 35,327 |
def main(): start = '!' source = None sqlfilename = None pageTitle = [] for arg in sys.argv[1:]: arg = wikipedia.argHandler(arg, logname = 'weblinkchecker.log') if arg: if arg.startswith('-sql'): if len(arg) == 4: sqlfilename = wikipedia.input(u'Please enter the SQL dump\'s filename: ') else: sqlfilename = arg[5:] sour... | def main(): start = '!' source = None sqlfilename = None pageTitle = [] for arg in sys.argv[1:]: arg = wikipedia.argHandler(arg, logname = 'weblinkchecker.log') if arg: if arg.startswith('-sql'): if len(arg) == 4: sqlfilename = wikipedia.input(u'Please enter the SQL dump\'s filename: ') else: sqlfilename = arg[5:] sour... | 35,328 |
def Movepages(page): 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 == 'c': pagemove = wikipedia.input(u'New page name:') titleroot = wikipedia.Page(wikipedia.getSite(), pagetitle) msg = wikipedia.transl... | 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 == 'c': pagemove = wikipedia.input(u'New page name:') titleroot = wikipedia.Page(wikipedia.getSite(), pagetitle) msg = wi... | 35,329 |
def Movepages(page): 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 == 'c': pagemove = wikipedia.input(u'New page name:') titleroot = wikipedia.Page(wikipedia.getSite(), pagetitle) msg = wikipedia.transl... | def Movepages(page): 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 == 'c': pagemove = wikipedia.input(u'New page name:') titleroot = wikipedia.Page(wikipedia.getSite(), pagetitle) msg = wikipedia.transl... | 35,330 |
def main(): categoryName = None singlePageTitle = [] referredPageTitle = None for arg in sys.argv[1:]: arg = wikipedia.argHandler(arg, 'movepages') if arg: if arg.startswith('-cat'): if len(arg) == 4: categoryName = wikipedia.input(u'Enter the category name:') else: categoryName = arg[5:] elif arg.startswith('-ref'): ... | def main(): categoryName = None singlePageTitle = [] referredPageTitle = None for arg in sys.argv[1:]: arg = wikipedia.argHandler(arg, 'movepages') if arg: if arg.startswith('-cat'): if len(arg) == 4: categoryName = wikipedia.input(u'Enter the category name:') else: categoryName = arg[5:] elif arg.startswith('-ref'): ... | 35,331 |
def main(): categoryName = None singlePageTitle = [] referredPageTitle = None for arg in sys.argv[1:]: arg = wikipedia.argHandler(arg, 'movepages') if arg: if arg.startswith('-cat'): if len(arg) == 4: categoryName = wikipedia.input(u'Enter the category name:') else: categoryName = arg[5:] elif arg.startswith('-ref'): ... | def main(): categoryName = None singlePageTitle = [] referredPageTitle = None for arg in sys.argv[1:]: arg = wikipedia.argHandler(arg, 'movepages') if arg: if arg.startswith('-cat'): if len(arg) == 4: categoryName = wikipedia.input(u'Enter the category name:') else: categoryName = arg[5:] elif arg.startswith('-ref'): ... | 35,332 |
def main(): categoryName = None singlePageTitle = [] referredPageTitle = None for arg in sys.argv[1:]: arg = wikipedia.argHandler(arg, 'movepages') if arg: if arg.startswith('-cat'): if len(arg) == 4: categoryName = wikipedia.input(u'Enter the category name:') else: categoryName = arg[5:] elif arg.startswith('-ref'): ... | def main(): categoryName = None singlePageTitle = [] referredPageTitle = None for arg in sys.argv[1:]: arg = wikipedia.argHandler(arg, 'movepages') if arg: if arg.startswith('-cat'): if len(arg) == 4: categoryName = wikipedia.input(u'Enter the category name:') else: categoryName = arg[5:] elif arg.startswith('-ref'): ... | 35,333 |
def add_category(sort_by_last_name = False): 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" p... | def add_category(sort_by_last_name = False): 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" p... | 35,334 |
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. | 35,335 |
def replaceLinks(self, pl, new, sa): """ Returns True if saving was successful. """ if pl.title() != pl.sectionFreeTitle(): # This is not a page, but a subpage. Do not edit it. wikipedia.output(u"Not editing %s: not doing interwiki on subpages" % pl.aslink(forceInterwiki = True)) return False wikipedia.output(u"Updatin... | defelse: raise LinkMustBeRemoved('Found incorrect link to %s in %s'% (",".join([x.lang for x in removing]), pl.aslink(forceInterwiki = True))) replaceLinks(self,else: raise LinkMustBeRemoved('Found incorrect link to %s in %s'% (",".join([x.lang for x in removing]), pl.aslink(forceInterwiki = True))) pl,else: raise Link... | 35,336 |
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 ... | 35,337 |
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 ... | 35,338 |
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 ... | 35,339 |
def maxOpenCode(self): """Return the code of the foreign language that has the most open queries plus the number. If there is nothing left, return None, 0. Only languages that are TODO for the first Subject are returned.""" max = 0 maxlang = None | def maxOpenCode(self): """Return the code of the foreign language that has the most open queries plus the number. If there is nothing left, return None, 0. Only languages that are TODO for the first Subject are returned.""" max = 0 maxlang = None | 35,340 |
def maxOpenCode(self): """Return the code of the foreign language that has the most open queries plus the number. If there is nothing left, return None, 0. Only languages that are TODO for the first Subject are returned.""" max = 0 maxlang = None | def maxOpenCode(self): """Return the code of the foreign language that has the most open queries plus the number. If there is nothing left, return None, 0. Only languages that are TODO for the first Subject are returned.""" max = 0 maxlang = None | 35,341 |
def selectQueryCode(self): """Select the language code the next query should go out for.""" # How many home-language queries we still have? mycount = self.counts.get(wikipedia.mylang,0) # Do we still have enough subjects to work on for which the # home language has been retrieved? This is rough, because # some subjects... | def selectQueryCode(self): """Select the language code the next query should go out for.""" # How many home-language queries we still have? mycount = self.counts.get(wikipedia.mylang,0) # Do we still have enough subjects to work on for which the # home language has been retrieved? This is rough, because # some subjects... | 35,342 |
def escapePattern2( pattern ): """Converts a string pattern into a regex expression and cache. Allows matching of any _digitDecoders inside the string. Returns a compiled regex object and a list of digit decoders""" if pattern not in _escPtrnCache2: newPattern = u'^' # begining of the string strPattern = u'' decoders ... | def escapePattern2( pattern ): """Converts a string pattern into a regex expression and cache. Allows matching of any _digitDecoders inside the string. Returns a compiled regex object and a list of digit decoders""" if pattern not in _escPtrnCache2: newPattern = u'^' # begining of the string strPattern = u'' decoders ... | 35,343 |
def dh( value, pattern, encf, decf, filter = None ): """This function helps in year parsing. Usually it will be used as a lambda call in a map: lambda v: dh( v, u'pattern string', encodingFunc, decodingFunc ) encodingFunc: Converts from an integer parameter to another integer or a tuple of integers. Depending on the p... | def dh( value, pattern, encf, decf, filter = None ): """This function helps in year parsing. Usually it will be used as a lambda call in a map: lambda v: dh( v, u'pattern string', encodingFunc, decodingFunc ) encodingFunc: Converts from an integer parameter to another integer or a tuple of integers. Depending on the p... | 35,344 |
def dh( value, pattern, encf, decf, filter = None ): """This function helps in year parsing. Usually it will be used as a lambda call in a map: lambda v: dh( v, u'pattern string', encodingFunc, decodingFunc ) encodingFunc: Converts from an integer parameter to another integer or a tuple of integers. Depending on the p... | def dh( value, pattern, encf, decf, filter = None ): """This function helps in year parsing. Usually it will be used as a lambda call in a map: lambda v: dh( v, u'pattern string', encodingFunc, decodingFunc ) encodingFunc: Converts from an integer parameter to another integer or a tuple of integers. Depending on the p... | 35,345 |
def dh( value, pattern, encf, decf, filter = None ): """This function helps in year parsing. Usually it will be used as a lambda call in a map: lambda v: dh( v, u'pattern string', encodingFunc, decodingFunc ) encodingFunc: Converts from an integer parameter to another integer or a tuple of integers. Depending on the p... | def dh( value, pattern, encf, decf, filter = None ): """This function helps in year parsing. Usually it will be used as a lambda call in a map: lambda v: dh( v, u'pattern string', encodingFunc, decodingFunc ) encodingFunc: Converts from an integer parameter to another integer or a tuple of integers. Depending on the p... | 35,346 |
def dh( value, pattern, encf, decf, filter = None ): """This function helps in year parsing. Usually it will be used as a lambda call in a map: lambda v: dh( v, u'pattern string', encodingFunc, decodingFunc ) encodingFunc: Converts from an integer parameter to another integer or a tuple of integers. Depending on the p... | def dh( value, pattern, encf, decf, filter = None ): """This function helps in year parsing. Usually it will be used as a lambda call in a map: lambda v: dh( v, u'pattern string', encodingFunc, decodingFunc ) encodingFunc: Converts from an integer parameter to another integer or a tuple of integers. Depending on the p... | 35,347 |
def treat(refpl, thispl): try: reftxt=refpl.get() except wikipedia.IsRedirectPage: pass else: n = 0 curpos = 0 while 1: m=linkR.search(reftxt, pos = curpos) if not m: if n == 0: print "Not found in %s"%refpl elif not debug: refpl.put(reftxt) return # Make sure that next time around we will not find this same hit. curpo... | def treat(refpl, thispl): try: reftxt=refpl.get() except wikipedia.IsRedirectPage: pass else: n = 0 curpos = 0 while 1: m=linkR.search(reftxt, pos = curpos) if not m: if n == 0: print "Not found in %s"%refpl elif not debug: refpl.put(reftxt) return True # Make sure that next time around we will not find this same hit. ... | 35,348 |
def generator(source, replacements, exceptions, regex, namespace, textfilename = None, sqlfilename = None, pagenames = None): ''' Generator which will yield PageLinks for pages that might contain text to replace. These pages might be retrieved from a local SQL dump file or a text file, or as a list of pages entered by ... | def generator(source, replacements, exceptions, regex, namespace, textfilename = None, sqlfilename = None, pagenames = None): ''' Generator which will yield PageLinks for pages that might contain text to replace. These pages might be retrieved from a local SQL dump file or a text file, or as a list of pages entered by ... | 35,349 |
def generator(source, replacements, exceptions, regex, namespace, textfilename = None, sqlfilename = None, pagenames = None): ''' Generator which will yield PageLinks for pages that might contain text to replace. These pages might be retrieved from a local SQL dump file or a text file, or as a list of pages entered by ... | def generator(source, replacements, exceptions, regex, namespace, textfilename = None, sqlfilename = None, pagenames = None): ''' Generator which will yield PageLinks for pages that might contain text to replace. These pages might be retrieved from a local SQL dump file or a text file, or as a list of pages entered by ... | 35,350 |
def generator(source, replacements, exceptions, regex, namespace, textfilename = None, sqlfilename = None, pagenames = None): ''' Generator which will yield PageLinks for pages that might contain text to replace. These pages might be retrieved from a local SQL dump file or a text file, or as a list of pages entered by ... | def generator(source, replacements, exceptions, regex, namespace, textfilename = None, sqlfilename = None, pagenames = None): ''' Generator which will yield PageLinks for pages that might contain text to replace. These pages might be retrieved from a local SQL dump file or a text file, or as a list of pages entered by ... | 35,351 |
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. | 35,352 |
def main(args): username = password = None for arg in args:#sys.argv[1:]: arg = wikipedia.argHandler(arg) if arg is None: continue if arg.startswith("-user:"): username = arg[6:] elif arg.startswith("-pass:"): # not recommended password = arg[6:] else: sys.exit("Unknown argument: %s" % arg) mysite = wikipedia.getSite... | def main(args): username = password = None for arg in args:#sys.argv[1:]: arg = wikipedia.argHandler(arg) if arg is None: continue if arg.startswith("-user:"): username = arg[6:] elif arg.startswith("-pass:"): # not recommended password = arg[6:] else: sys.exit("Unknown argument: %s" % arg) mysite = wikipedia.getSite... | 35,353 |
def catname(self): """The name of the page without the namespace part. Gives an error if the page is from the main namespace.""" title=self.linkname() parts=title.split(':') parts=parts[1:] if parts=[]: raise NoNamespace(self) return ':'.join(parts) | def catname(self): """The name of the page without the namespace part. Gives an error if the page is from the main namespace.""" title=self.linkname() parts=title.split(':') parts=parts[1:] if parts==[]: raise NoNamespace(self) return ':'.join(parts) | 35,354 |
def __init__(self): family.Family.__init__(self) self.name = 'wikisource' for lang in self.knownlanguages: self.langs[lang] = lang+'.wikisource.org' | def __init__(self): family.Family.__init__(self) self.name = 'wikisource' for lang in self.knownlanguages: self.langs[lang] = lang+'.wikisource.org' | 35,355 |
def __init__(self): family.Family.__init__(self) self.name = 'wikisource' for lang in self.knownlanguages: self.langs[lang] = lang+'.wikisource.org' | def __init__(self): family.Family.__init__(self) self.name = 'wikisource' for lang in self.knownlanguages: self.langs[lang] = lang+'.wikisource.org' | 35,356 |
def __init__(self): family.Family.__init__(self) self.name = 'wikisource' for lang in self.knownlanguages: self.langs[lang] = lang+'.wikisource.org' | def __init__(self): family.Family.__init__(self) self.name = 'wikisource' for lang in self.knownlanguages: self.langs[lang] = lang+'.wikisource.org' | 35,357 |
def __init__(self): family.Family.__init__(self) self.name = 'wikisource' for lang in self.knownlanguages: self.langs[lang] = lang+'.wikisource.org' | def __init__(self): family.Family.__init__(self) self.name = 'wikisource' for lang in self.knownlanguages: self.langs[lang] = lang+'.wikisource.org' | 35,358 |
def add_category(sort_by_last_name = False): ''' A robot to mass-add a category to a list of pages. ''' 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 "spe... | def add_category(sort_by_last_name = False): ''' A robot to mass-add a category to a list of pages. ''' 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 "spe... | 35,359 |
def add_category(sort_by_last_name = False): ''' A robot to mass-add a category to a list of pages. ''' 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 "spe... | def add_category(sort_by_last_name = False): ''' A robot to mass-add a category to a list of pages. ''' 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 "spe... | 35,360 |
def add_category(sort_by_last_name = False): ''' A robot to mass-add a category to a list of pages. ''' 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 "spe... | def add_category(sort_by_last_name = False): ''' A robot to mass-add a category to a list of pages. ''' 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 "spe... | 35,361 |
def add_category(sort_by_last_name = False): ''' A robot to mass-add a category to a list of pages. ''' 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 "spe... | def add_category(sort_by_last_name = False): ''' A robot to mass-add a category to a list of pages. ''' 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 "spe... | 35,362 |
def add_category(sort_by_last_name = False): ''' A robot to mass-add a category to a list of pages. ''' 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 "spe... | def add_category(sort_by_last_name = False): ''' A robot to mass-add a category to a list of pages. ''' 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 "spe... | 35,363 |
def add_category(sort_by_last_name = False): ''' A robot to mass-add a category to a list of pages. ''' 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 "spe... | def add_category(sort_by_last_name = False): ''' A robot to mass-add a category to a list of pages. ''' 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 "spe... | 35,364 |
def add_category(sort_by_last_name = False): ''' A robot to mass-add a category to a list of pages. ''' 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 "spe... | def add_category(sort_by_last_name = False): ''' A robot to mass-add a category to a list of pages. ''' 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 "spe... | 35,365 |
def add_category(sort_by_last_name = False): ''' A robot to mass-add a category to a list of pages. ''' 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 "spe... | def add_category(sort_by_last_name = False): ''' A robot to mass-add a category to a list of pages. ''' 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 "spe... | 35,366 |
def add_category(sort_by_last_name = False): ''' A robot to mass-add a category to a list of pages. ''' 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 "spe... | def add_category(sort_by_last_name = False): ''' A robot to mass-add a category to a list of pages. ''' 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 "spe... | 35,367 |
def add_category(sort_by_last_name = False): ''' A robot to mass-add a category to a list of pages. ''' 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 "spe... | def add_category(sort_by_last_name = False): ''' A robot to mass-add a category to a list of pages. ''' 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 "spe... | 35,368 |
def add_category(sort_by_last_name = False): ''' A robot to mass-add a category to a list of pages. ''' 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 "spe... | def add_category(sort_by_last_name = False): ''' A robot to mass-add a category to a list of pages. ''' 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 "spe... | 35,369 |
def add_category(sort_by_last_name = False): ''' A robot to mass-add a category to a list of pages. ''' 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 "spe... | def add_category(sort_by_last_name = False): ''' A robot to mass-add a category to a list of pages. ''' 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 "spe... | 35,370 |
def add_category(sort_by_last_name = False): ''' A robot to mass-add a category to a list of pages. ''' 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 "spe... | def add_category(sort_by_last_name = False): ''' A robot to mass-add a category to a list of pages. ''' 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 "spe... | 35,371 |
def add_category(sort_by_last_name = False): ''' A robot to mass-add a category to a list of pages. ''' 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 "spe... | def add_category(sort_by_last_name = False): ''' A robot to mass-add a category to a list of pages. ''' 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 "spe... | 35,372 |
def add_category(sort_by_last_name = False): ''' A robot to mass-add a category to a list of pages. ''' 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 "spe... | def add_category(sort_by_last_name = False): ''' A robot to mass-add a category to a list of pages. ''' 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 "spe... | 35,373 |
def add_category(sort_by_last_name = False): ''' A robot to mass-add a category to a list of pages. ''' 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 "spe... | def add_category(sort_by_last_name = False): ''' A robot to mass-add a category to a list of pages. ''' 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 "spe... | 35,374 |
def add_category(sort_by_last_name = False): ''' A robot to mass-add a category to a list of pages. ''' 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 "spe... | def add_category(sort_by_last_name = False): ''' A robot to mass-add a category to a list of pages. ''' 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 "spe... | 35,375 |
def getLanguageLinks(text, insite = None): """Returns a dictionary of other language links mentioned in the text in the form {code:pagename}. Do not call this routine directly, use Page objects instead""" if insite == None: insite = getSite() result = {} # This regular expression will find every link that is possibly a... | def getLanguageLinks(text, insite = None): """Returns a dictionary of other language links mentioned in the text in the form {code:pagename}. Do not call this routine directly, use Page objects instead""" if insite == None: insite = getSite() result = {} # This regular expression will find every link that is possibly a... | 35,376 |
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... | 35,377 |
def extractArticle(data): """ takes a string with the complete HTML-file and returns the article which is contained in <div id='article'> and the pagestats which contain information on last change """ s = StringIO.StringIO(data) rPagestats = re.compile('.*(\<span id\=\'pagestats\'\>.*\<\/span\>).*') rBody = re.compil... | def extractArticle(data): """ takes a string with the complete HTML-file and returns the article which is contained in <div id='article'> and the pagestats which contain information on last change """ s = StringIO.StringIO(data) rPagestats = re.compile('.*(\<span id\=\'pagestats\'\>.*\<\/span\>).*') rBody = re.compil... | 35,378 |
def transferImage(self, sourceImagePage, debug=False): """Gets a wikilink to an image, downloads it and its description, and uploads it to another wikipedia. Returns the filename which was used to upload the image This function is used by imagetransfer.py and by copy_table.py """ sourceSite = sourceImagePage.site() if ... | def transferImage(self, sourceImagePage, debug=False): """Gets a wikilink to an image, downloads it and its description, and uploads it to another wikipedia. Returns the filename which was used to upload the image This function is used by imagetransfer.py and by copy_table.py """ sourceSite = sourceImagePage.site() if ... | 35,379 |
def main(): template_names = [] resolve = False remove = False namespaces = [] editSummary = '' acceptAll = False pageTitles = [] extras = False # If xmlfilename is None, references will be loaded from the live wiki. xmlfilename = None new = None # read command line parameters for arg in wikipedia.handleArgs(): if arg ... | def main(): template_names = [] resolve = False remove = False namespaces = [] editSummary = '' acceptAll = False pageTitles = [] extras = False # If xmlfilename is None, references will be loaded from the live wiki. xmlfilename = None new = None # read command line parameters for arg in wikipedia.handleArgs(): if arg ... | 35,380 |
def main(): mysite = wikipedia.getSite() sa = [] output_directory = "" save_images = False overwrite_images = False overwrite_articles = False for arg in sys.argv[1:]: if arg.startswith("-lang:"): lang = arg[6:] elif arg.startswith("-file:"): f=open(arg[6:], 'r') R=re.compile(r'.*\[\[([^\]]*)\]\].*') m = False for lin... | def main(): mysite = wikipedia.getSite() sa = [] output_directory = "" save_images = False overwrite_images = False overwrite_articles = False for arg in sys.argv[1:]: if arg.startswith("-lang:"): lang = arg[6:] elif arg.startswith("-file:"): f=open(arg[6:], 'r') R=re.compile(r'.*\[\[([^\]]*)\]\].*') m = False for lin... | 35,381 |
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 ... | 35,382 |
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 ... | 35,383 |
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... | 35,384 |
def post_multipart(host, selector, fields, files, cookies): """ Post fields and files to an http host as multipart/form-data. fields is a sequence of (name, value) elements for regular form fields. files is a sequence of (name, filename, value) elements for data to be uploaded as files Return the server's response page... | def post_multipart(host, selector, fields, files, cookies): """ Post fields and files to an http host as multipart/form-data. fields is a sequence of (name, value) elements for regular form fields. files is a sequence of (name, filename, value) elements for data to be uploaded as files Return the server's response page... | 35,385 |
def __init__(self, url, description = u'', keepFilename = False, targetSite = None, urlEncoding = None): self.url = url self.urlEncoding = urlEncoding self.description = description self.keepFilename = keepFilename if config.upload_to_commons: self.targetSite = targetSite or wikipedia.getSite('commons', 'commons') else... | def __init__(self, url, description = u'', keepFilename = False, verifyDescription = True, targetSite = None, urlEncoding = None): self.url = url self.urlEncoding = urlEncoding self.description = description self.keepFilename = keepFilename if config.upload_to_commons: self.targetSite = targetSite or wikipedia.getSite(... | 35,386 |
def upload_image(self, debug=False): """Gets the image at URL self.url, and uploads it to the target wiki. Returns the filename which was used to upload the image. If the upload fails, the user is asked whether to try again or not. If the user chooses not to retry, returns null. """ # Get file contents if '://' in self... | def upload_image(self, debug=False): """Gets the image at URL self.url, and uploads it to the target wiki. Returns the filename which was used to upload the image. If the upload fails, the user is asked whether to try again or not. If the user chooses not to retry, returns null. """ # Get file contents if '://' in self... | 35,387 |
def main(args): url = u'' description = [] keepFilename = False for arg in args: arg = wikipedia.argHandler(arg, 'upload') if arg: if arg.startswith('-keep'): keepFilename = True elif url == u'': url = arg else: description.append(arg) description = u' '.join(description) bot = UploadRobot(url, description, keepFilena... | def main(args): url = u'' description = [] keepFilename = False for arg in args: if arg: if arg.startswith('-keep'): keepFilename = True elif url == u'': url = arg else: description.append(arg) description = u' '.join(description) bot = UploadRobot(url, description, keepFilename) bot.run() | 35,388 |
def main(args): url = u'' description = [] keepFilename = False for arg in args: arg = wikipedia.argHandler(arg, 'upload') if arg: if arg.startswith('-keep'): keepFilename = True elif url == u'': url = arg else: description.append(arg) description = u' '.join(description) bot = UploadRobot(url, description, keepFilena... | def main(args): url = u'' description = [] keepFilename = False for arg in args: arg = wikipedia.argHandler(arg, 'upload') if arg: if arg.startswith('-keep'): keepFilename = True elif url == u'': url = arg else: description.append(arg) description = u' '.join(description) bot = UploadRobot(url, description, keepFilena... | 35,389 |
def setupRegexes(self): # compile regular expressions self.ignore_contents_regexes = [] if self.ignore_contents.has_key(self.mylang): for ig in self.ignore_contents[self.mylang]: self.ignore_contents_regexes.append(re.compile(ig)) | def setupRegexes(self): # compile regular expressions self.ignore_contents_regexes = [] if self.ignore_contents.has_key(self.mylang): for ig in self.ignore_contents[self.mylang]: self.ignore_contents_regexes.append(re.compile(ig)) | 35,390 |
def setupRegexes(self): # compile regular expressions self.ignore_contents_regexes = [] if self.ignore_contents.has_key(self.mylang): for ig in self.ignore_contents[self.mylang]: self.ignore_contents_regexes.append(re.compile(ig)) | def setupRegexes(self): # compile regular expressions self.ignore_contents_regexes = [] if self.ignore_contents.has_key(self.mylang): for ig in self.ignore_contents[self.mylang]: self.ignore_contents_regexes.append(re.compile(ig)) | 35,391 |
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. """ | 35,392 |
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. """ | 35,393 |
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. """ | 35,394 |
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. """ | 35,395 |
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. """ | 35,396 |
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. """ | 35,397 |
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. """ | 35,398 |
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. """ | 35,399 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.