jenkins-bot has submitted this change and it was merged.
Change subject: def Family is in pywikibot.site, not pywikibot
......................................................................
def Family is in pywikibot.site, not pywikibot
Change-Id: I0cd7c265597573ef88cdac1580bf0e5ec28960b6
---
M pywikibot/textlib.py
1 file changed, 1 insertion(+), 1 deletion(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/textlib.py b/pywikibot/textlib.py
index 5f1650a..4ce5607 100644
--- a/pywikibot/textlib.py
+++ b/pywikibot/textlib.py
@@ -411,7 +411,7 @@
# when interwiki links forward to another family, retrieve pages & other
# infos there
if fam.interwiki_forward:
- fam = pywikibot.Family(fam.interwiki_forward)
+ fam = pywikibot.site.Family(fam.interwiki_forward)
result = {}
# Ignore interwiki links within nowiki tags, includeonly tags, pre tags,
# and HTML comments
--
To view, visit https://gerrit.wikimedia.org/r/111192
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I0cd7c265597573ef88cdac1580bf0e5ec28960b6
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot <>
jenkins-bot has submitted this change and it was merged.
Change subject: (bug 60610) define variables mysite, linktrail, pep8 changes
......................................................................
(bug 60610) define variables mysite, linktrail, pep8 changes
synchronized with core, rebased
Change-Id: I1b30397063e24f920b11ee6ae485cf0e72eb3fce
---
M disambredir.py
1 file changed, 8 insertions(+), 5 deletions(-)
Approvals:
Mpaa: Looks good to me, approved
jenkins-bot: Verified
diff --git a/disambredir.py b/disambredir.py
index ff120d9..373295a 100644
--- a/disambredir.py
+++ b/disambredir.py
@@ -40,8 +40,11 @@
def treat(text, linkedPage, targetPage):
""" Based on the method of the same name in solve_disambiguation.py. """
# make a backup of the original text so we can show the changes later
+ mysite = pywikibot.getSite()
+ linktrail = mysite.linktrail()
linkR = re.compile(
- r'\[\[(?P<title>[^\]\|#]*)(?P<section>#[^\]\|]*)?(\|(?P<label>[^\]]*))?\]\](?P<linktrail>' + linktrail + ')')
+ r'\[\[(?P<title>[^\]\|#]*)(?P<section>#[^\]\|]*)?(\|(?P<label>[^\]]*))?\]\](?P<linktrail>%s)'
+ % linktrail)
curpos = 0
# This loop will run until we have finished the current page
while True:
@@ -54,7 +57,7 @@
if m.group('title') == '' or mysite.isInterwikiLink(m.group('title')):
continue
else:
- actualLinkPage = pywikibot.Page(page.site(), m.group('title'))
+ actualLinkPage = pywikibot.Page(page.site, m.group('title'))
# Check whether the link found is to page.
if actualLinkPage != linkedPage:
continue
@@ -63,9 +66,9 @@
context = 30
# at the beginning of the link, start red color.
# at the end of the link, reset the color to default
- pywikibot.output(text[max(0, m.start() - context):m.start()] +
- '\03{lightred}' + text[m.start():m.end()] +
- '\03{default}' + text[m.end():m.end() + context])
+ pywikibot.output(text[max(0, m.start() - context): m.start()] +
+ '\03{lightred}' + text[m.start(): m.end()] +
+ '\03{default}' + text[m.end(): m.end() + context])
while True:
choice = pywikibot.input(
u"Option (N=do not change, y=change link to \03{lightpurple}%s\03{default}, r=change and replace text, u=unlink)"
--
To view, visit https://gerrit.wikimedia.org/r/110331
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I1b30397063e24f920b11ee6ae485cf0e72eb3fce
Gerrit-PatchSet: 5
Gerrit-Project: pywikibot/compat
Gerrit-Branch: master
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Andre Engels <andreengels(a)gmail.com>
Gerrit-Reviewer: Huji <huji.huji(a)gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: Mpaa <mpaa.wiki(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot <>
jenkins-bot has submitted this change and it was merged.
Change subject: (bug 55127) Allow user to abort during http request
......................................................................
(bug 55127) Allow user to abort during http request
KeyboardInterrupts are only processed during Python code, and
thus not during lock acquisition.
Change-Id: Ieea4a9d35ae7b26921584f4b52e4c2f7cf2e63d0
---
M pywikibot/comms/http.py
1 file changed, 2 insertions(+), 1 deletion(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/comms/http.py b/pywikibot/comms/http.py
index 5e7407b..2aafc7d 100644
--- a/pywikibot/comms/http.py
+++ b/pywikibot/comms/http.py
@@ -140,7 +140,8 @@
kwargs["headers"].setdefault("user-agent", useragent)
request = threadedhttp.HttpRequest(baseuri, *args, **kwargs)
http_queue.put(request)
- request.lock.acquire()
+ while not request.lock.acquire(False):
+ time.sleep(0.1)
#TODO: do some error correcting stuff
if isinstance(request.data, SSLHandshakeError):
--
To view, visit https://gerrit.wikimedia.org/r/110867
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ieea4a9d35ae7b26921584f4b52e4c2f7cf2e63d0
Gerrit-PatchSet: 2
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot <>
jenkins-bot has submitted this change and it was merged.
Change subject: (bug 55127) Allow user to cut off pending network requests at shutdown
......................................................................
(bug 55127) Allow user to cut off pending network requests at shutdown
If an exception was raised, an extra message is shown to the user,
suggesting to use ctrl-c to abort processing. Otherwise this message
is only shown if the bot is running in verbose mode.
Change-Id: Ie5cf53f97877e61c30e19e10cc2c0fdee647dcac
---
M pywikibot/comms/http.py
1 file changed, 14 insertions(+), 3 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/comms/http.py b/pywikibot/comms/http.py
index 6a4c287..5e7407b 100644
--- a/pywikibot/comms/http.py
+++ b/pywikibot/comms/http.py
@@ -21,9 +21,11 @@
__version__ = '$Id$'
__docformat__ = 'epytext'
+import sys
import urllib
import logging
import atexit
+import time
try:
from httplib2 import SSLHandshakeError
@@ -86,9 +88,18 @@
def _flush():
for i in threads:
http_queue.put(None)
- pywikibot.log(u'Waiting for threads to finish... ')
- for i in threads:
- i.join()
+
+ message = u'Waiting for %i network thread(s) to finish. Press ctrl-c to abort' % len(threads)
+ if hasattr(sys, 'last_type'):
+ # we quit because of an exception
+ print sys.last_type
+ pywikibot.critical(message)
+ else:
+ pywikibot.log(message)
+
+ while any(t for t in threads if t.isAlive()):
+ time.sleep(.1)
+
pywikibot.log(u"All threads finished.")
atexit.register(_flush)
--
To view, visit https://gerrit.wikimedia.org/r/110866
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ie5cf53f97877e61c30e19e10cc2c0fdee647dcac
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot <>