jenkins-bot has submitted this change and it was merged.
Change subject: (bug 66523) Do not break script when wikidata item does not exists.
......................................................................
(bug 66523) Do not break script when wikidata item does not exists.
Now we just ignore the given page.
Change-Id: I823fff01427d6559eadf1aef92d7c77e420aa72b
---
M scripts/harvest_template.py
1 file changed, 1 insertion(+), 0 deletions(-)
Approvals:
John Vandenberg: Looks good to me, approved
jenkins-bot: Verified
diff --git a/scripts/harvest_template.py b/scripts/harvest_template.py
index 263b838..a8ba023 100755
--- a/scripts/harvest_template.py
+++ b/scripts/harvest_template.py
@@ -119,6 +119,7 @@
if not item.exists():
pywikibot.output('%s doesn\'t have a wikidata item :(' % page)
#TODO FIXME: We should provide an option to create the page
+ return
item.get()
if set(self.fields.values()) <= set(item.claims.keys()):
pywikibot.output(u'%s item %s has claims for all properties. Skipping' % (page, item.title()))
--
To view, visit https://gerrit.wikimedia.org/r/139096
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I823fff01427d6559eadf1aef92d7c77e420aa72b
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: JAn Dudík <jan.dudik(a)gmail.com>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: Legoktm <legoktm.wikipedia(a)gmail.com>
Gerrit-Reviewer: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: Multichill <maarten(a)mdammers.nl>
Gerrit-Reviewer: jenkins-bot <>
jenkins-bot has submitted this change and it was merged.
Change subject: Log the script start date and time UTC
......................................................................
Log the script start date and time UTC
The date can be helpful when looking at an old log file,
and is a cheap way of recording what the pywiki repo version
was at the time the command was run.
Change-Id: I02e97f59f07e1321c69181e2dc10a6c919603f9b
---
M pywikibot/bot.py
1 file changed, 4 insertions(+), 0 deletions(-)
Approvals:
Mpaa: Looks good to me, but someone else must approve
Multichill: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/bot.py b/pywikibot/bot.py
index b40cfa8..a41183a 100644
--- a/pywikibot/bot.py
+++ b/pywikibot/bot.py
@@ -23,6 +23,7 @@
import sys
import re
import json
+import datetime
_logger = "bot"
@@ -256,6 +257,9 @@
# script call
log(u'COMMAND: %s' % unicode(sys.argv))
+ # script call time stamp
+ log(u'DATE: %s UTC' % str(datetime.datetime.utcnow()))
+
# new framework release/revision? (handleArgs needs to be called first)
try:
log(u'VERSION: %s' %
--
To view, visit https://gerrit.wikimedia.org/r/137007
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I02e97f59f07e1321c69181e2dc10a6c919603f9b
Gerrit-PatchSet: 2
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: Mpaa <mpaa.wiki(a)gmail.com>
Gerrit-Reviewer: Multichill <maarten(a)mdammers.nl>
Gerrit-Reviewer: jenkins-bot <>
jenkins-bot has submitted this change and it was merged.
Change subject: (bug 66256) decrease api high limit and update the paramstring
......................................................................
(bug 66256) decrease api high limit and update the paramstring
Sometimes Category.articles() does not retrieve any pages but fails
into 503 server error. The given api Request waits some minutes,
halves the limit and restarts the request. Unfortunately the
request paramstring was never updated. This patch solves that bug.
Change-Id: I65c0e8b63555161d9e147776195d97732fc8dc3c
---
M pywikibot/data/api.py
1 file changed, 2 insertions(+), 2 deletions(-)
Approvals:
John Vandenberg: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/data/api.py b/pywikibot/data/api.py
index 47e7912..157a99b 100644
--- a/pywikibot/data/api.py
+++ b/pywikibot/data/api.py
@@ -3,7 +3,7 @@
Interface functions to Mediawiki's api.php
"""
#
-# (C) Pywikipedia bot team, 2007-12
+# (C) Pywikipedia bot team, 2007-14
#
# Distributed under the terms of the MIT license.
#
@@ -249,8 +249,8 @@
@return: The data retrieved from api.php (a dict)
"""
- paramstring = self.http_params()
while True:
+ paramstring = self.http_params()
action = self.params.get("action", "")
simulate = self._simulate(action)
if simulate:
--
To view, visit https://gerrit.wikimedia.org/r/137936
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I65c0e8b63555161d9e147776195d97732fc8dc3c
Gerrit-PatchSet: 3
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: Legoktm <legoktm.wikipedia(a)gmail.com>
Gerrit-Reviewer: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: Russell Blau <russblau(a)imapmail.org>
Gerrit-Reviewer: Steinsplitter <steinsplitter(a)wikipedia.de>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot <>
jenkins-bot has submitted this change and it was merged.
Change subject: Fix bug 54568
......................................................................
Fix bug 54568
I changed the regex to a more complex thing to handle
the problem of catching ")" at the end of URL if it's
used in bracket
I tested it on several different texts and it was okay
Change-Id: I6f3addcaf93d4d7499e3ec169255f284ab70a526
---
M pywikibot/textlib.py
M weblinkchecker.py
2 files changed, 8 insertions(+), 11 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/textlib.py b/pywikibot/textlib.py
index bb6fb9a..41c61ab 100644
--- a/pywikibot/textlib.py
+++ b/pywikibot/textlib.py
@@ -871,18 +871,18 @@
# not allowed inside links. For example, in this wiki text:
# ''Please see http://www.example.org.''
# .'' shouldn't be considered as part of the link.
- regex = r'(?P<url>http[s]?://[^%(notInside)s]*?[^%(notAtEnd)s]' \
+ regex = r'https?://[^%(notInside)s]*?[^%(notAtEnd)s]' \
r'(?=[%(notAtEnd)s]*\'\')|http[s]?://[^%(notInside)s]*' \
- r'[^%(notAtEnd)s])' % {'notInside': notInside, 'notAtEnd': notAtEnd}
- regexb = r'(?P<urlb>http[s]?://[^%(notInside)s]*?[^%(notAtEnd)s]' \
+ r'[^%(notAtEnd)s]' % {'notInside': notInside, 'notAtEnd': notAtEnd}
+ regexb = r'https?://[^%(notInside)s]*?[^%(notAtEnd)s]' \
r'(?=[%(notAtEnd)s]*\'\')|http[s]?://[^%(notInside)s]*' \
- r'[^%(notAtEnd)s])' % {'notInside': notInside, 'notAtEnd': notAtEndb}
+ r'[^%(notAtEnd)s]' % {'notInside': notInside, 'notAtEnd': notAtEndb}
if withoutBracketed:
- regex = r'(?<!\[)' + regex
+ regex = r'(?<!\[)(?P<url>%s)' % regex
elif onlyBracketed:
- regex = r'\[' + regexb
+ regex = r'\[(?P<url>%s)' % regexb
else:
- regex=r'(?:(?<!\[)'+ regex+r'|\['+regexb+')'
+ regex = r'(?P<url>(?<!\[)%s|\[%s)' % (regex, regexb)
linkR = re.compile(regex)
return linkR
diff --git a/weblinkchecker.py b/weblinkchecker.py
index eafd7ed..ca41986 100644
--- a/weblinkchecker.py
+++ b/weblinkchecker.py
@@ -175,10 +175,7 @@
text = pywikibot.removeDisabledParts(text)
linkR = pywikibot.compileLinkR(withoutBracketed, onlyBracketed)
for m in linkR.finditer(text):
- if m.group('url'):
- yield m.group('url')
- else:
- yield m.group('urlb')
+ yield m.group('url')
class XmlDumpPageGenerator:
--
To view, visit https://gerrit.wikimedia.org/r/119964
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I6f3addcaf93d4d7499e3ec169255f284ab70a526
Gerrit-PatchSet: 3
Gerrit-Project: pywikibot/compat
Gerrit-Branch: master
Gerrit-Owner: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: Ricordisamoa <ricordisamoa(a)openmailbox.org>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot <>