jenkins-bot has submitted this change and it was merged.
Change subject: Add support for geographic coordinates to claimit.py
......................................................................
Add support for geographic coordinates to claimit.py
Change-Id: I4cae7e0bf3adca8674cfc7c4bb1eef8a330d461c
---
M scripts/claimit.py
1 file changed, 20 insertions(+), 2 deletions(-)
Approvals:
Merlijn van Deen: Looks good to me, approved
jenkins-bot: Verified
diff --git a/scripts/claimit.py b/scripts/claimit.py
index f326a4c..808b33d 100755
--- a/scripts/claimit.py
+++ b/scripts/claimit.py
@@ -7,9 +7,20 @@
python claimit.py [pagegenerators] P1 Q2 P123 Q456
-You can use any typical pagegenerator to provide with a list of pages
-
+You can use any typical pagegenerator to provide with a list of pages.
Then list the property-->target pairs to add.
+
+For geographic coordinates:
+
+python claimit.py [pagegenerators] P625 [lat-dec],[long-dec],[prec]
+
+[lat-dec] and [long-dec] represent the latitude and longitude respectively,
+and [prec] represents the precision. All values are in decimal degrees,
+not DMS. If [prec] is omitted, the default precision is 0.0001 degrees.
+
+Example:
+
+python claimit.py [pagegenerators] P625 -23.3991,-52.0910,0.0001
"""
#
# (C) Legoktm, 2013
@@ -111,6 +122,13 @@
target = pywikibot.ItemPage(repo, commandline_claims[i + 1])
elif claim.getType() == 'string':
target = commandline_claims[i + 1]
+ elif claim.getType() == 'globecoordinate':
+ coord_args = map(float, commandline_claims[i + 1].split(','))
+ if len(coord_args) >= 3:
+ precision = coord_args[2]
+ else:
+ precision = 0.0001 # Default value (~10 m at equator)
+ target = pywikibot.Coordinate(coord_args[0], coord_args[1], precision=precision)
else:
raise NotImplementedError(
"%s datatype is not yet supported by claimit.py"
--
To view, visit https://gerrit.wikimedia.org/r/97453
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I4cae7e0bf3adca8674cfc7c4bb1eef8a330d461c
Gerrit-PatchSet: 2
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Gerrit Patch Uploader <gerritpatchuploader(a)gmail.com>
Gerrit-Reviewer: Gerrit Patch Uploader <gerritpatchuploader(a)gmail.com>
Gerrit-Reviewer: Guoguo12 <Guoguo12(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: jenkins-bot
DrTrigon has submitted this change and it was merged.
Change subject: work-a-round; for "MaxTriesExceededError" in catimages.py during debug info/log output
......................................................................
work-a-round; for "MaxTriesExceededError" in catimages.py during debug info/log output
Change-Id: I8d2b5dee5ea1ef80cb87ad765f92c51e59240475
---
M catimages.py
1 file changed, 15 insertions(+), 9 deletions(-)
Approvals:
DrTrigon: Verified; Looks good to me, approved
jenkins-bot: Verified
diff --git a/catimages.py b/catimages.py
index c751df5..e91084f 100644
--- a/catimages.py
+++ b/catimages.py
@@ -4411,15 +4411,21 @@
# "HTTPError: 504 Gateway Time-out" leading finally to "MaxTriesExceededError"
# (why is that...?!?? FIX THIS in the framework core e.g. 'postForm'!)
tmp = outresult
- while tmp:
- i = np.array([m.start() for m in re.finditer(u"\n\n==", tmp)] +
- [len(tmp)])
- pos = i[np.where((i - 500 * 1024) <= 0)[0][-1]]
- pywikibot.output(u"Size of bunch to write: %s byte(s)"
- % len(tmp[:pos]))
- outpage.put(tmp[:pos], comment="bot writing log for last run")
- tmp = tmp[pos:]
- if pywikibot.simulate:
+ ### BUG 57495: "MaxTriesExceededError" in catimages.py during debug info/log output
+ ### ('try ... except' has to be considered just a work-a-round)
+ try:
+ while tmp:
+ i = np.array([m.start() for m in re.finditer(u"\n\n==", tmp)] +
+ [len(tmp)])
+ pos = i[np.where((i - 500 * 1024) <= 0)[0][-1]]
+ pywikibot.output(u"Size of bunch to write: %s byte(s)"
+ % len(tmp[:pos]))
+ outpage.put(tmp[:pos], comment="bot writing log for last run")
+ tmp = tmp[pos:]
+ except pywikibot.MaxTriesExceededError:
+ pywikibot.exception()
+ pywikibot.output(u"Problem writing debug info to wiki, using file instead.")
+ if pywikibot.simulate or tmp:
#print u"--- " * 20
#print u"--- " * 20
#print outresult
--
To view, visit https://gerrit.wikimedia.org/r/97356
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I8d2b5dee5ea1ef80cb87ad765f92c51e59240475
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/compat
Gerrit-Branch: master
Gerrit-Owner: DrTrigon <dr.trigon(a)surfeu.ch>
Gerrit-Reviewer: DrTrigon <dr.trigon(a)surfeu.ch>
Gerrit-Reviewer: jenkins-bot
DrTrigon has submitted this change and it was merged.
Change subject: bugfix; solve cases where the PDF processing just hang and stopped the bot from continuing
......................................................................
bugfix; solve cases where the PDF processing just hang and stopped the bot from continuing
Change-Id: I33075a2663950533421f2d48f71ef77eed38962f
---
M catimages.py
1 file changed, 2 insertions(+), 0 deletions(-)
Approvals:
DrTrigon: Verified; Looks good to me, approved
diff --git a/catimages.py b/catimages.py
index 516cf81..c751df5 100644
--- a/catimages.py
+++ b/catimages.py
@@ -2642,7 +2642,9 @@
#proc = Popen("pdftotext -layout %s %s" % (self.image_path, self.image_path+'.txt'),
proc = Popen("pdftotext %s %s" % (self.image_path, self.image_path+'.txt'),
shell=True, stderr=PIPE)#.stderr.readlines()
+ enable_recovery() # enable recovery from hard crash
proc.wait()
+ disable_recovery() # disable since everything worked out fine
if proc.returncode:
raise ImportError("pdftotext not found!")
data = open(self.image_path+'.txt', 'r').readlines()
--
To view, visit https://gerrit.wikimedia.org/r/97297
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I33075a2663950533421f2d48f71ef77eed38962f
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/compat
Gerrit-Branch: master
Gerrit-Owner: DrTrigon <dr.trigon(a)surfeu.ch>
Gerrit-Reviewer: DrTrigon <dr.trigon(a)surfeu.ch>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: jenkins-bot