jenkins-bot has submitted this change and it was merged.
Change subject: (bug 55129)(bug 54898) Add nightlies version file support
......................................................................
(bug 55129)(bug 54898) Add nightlies version file support
The nightly generation has also been updated to use this format.
This is also a workaround for Bug 61310 (bot will not crash anymore)
Change-Id: Idf6114558b63627ab56f7c16d9f6f3ce436aa706
---
M pywikibot/version.py
1 file changed, 7 insertions(+), 5 deletions(-)
Approvals:
Mpaa: Looks good to me, approved
Nullzero: Looks good to me, but someone else must approve
Russell Blau: Looks good to me, but someone else must approve
jenkins-bot: Verified
diff --git a/pywikibot/version.py b/pywikibot/version.py
index 1a63073..26417f4 100644
--- a/pywikibot/version.py
+++ b/pywikibot/version.py
@@ -50,10 +50,10 @@
(tag, rev, date, hsh) = getversion_svn(_program_dir)
else:
(tag, rev, date, hsh) = getversion_git(_program_dir)
- except ParseError:
+ except Exception:
try:
(tag, rev, date, hsh) = getversion_nightly()
- except ParseError:
+ except Exception:
try:
version = getfileversion('pywikibot/__init__.py')
if not version:
@@ -162,13 +162,15 @@
def getversion_nightly():
- data = open(os.path.join(wikipediatools.get_base_dir(), 'version'))
+ data = open(os.path.join(os.path.split(__file__)[0], 'version'))
tag = data.readline().strip()
- date = time.strptime(data.readline()[:19], '%Y-%m-%dT%H:%M:%S')
rev = data.readline().strip()
+ date = time.strptime(data.readline()[:19], '%Y-%m-%dT%H:%M:%S')
+ hsh = data.readline().strip()
+
if not date or not tag or not rev:
raise ParseError
- return (tag, rev, date, '(unknown)')
+ return (tag, rev, date, hsh)
def getversion_onlinerepo(repo=None):
--
To view, visit https://gerrit.wikimedia.org/r/113185
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Idf6114558b63627ab56f7c16d9f6f3ce436aa706
Gerrit-PatchSet: 3
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: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: Mpaa <mpaa.wiki(a)gmail.com>
Gerrit-Reviewer: Nullzero <nullzero.free(a)gmail.com>
Gerrit-Reviewer: Russell Blau <russblau(a)imapmail.org>
Gerrit-Reviewer: jenkins-bot <>
DrTrigon has submitted this change and it was merged.
Change subject: bugfix; '\number' from e.g. date cause 'sre_constants.error: invalid group reference'
......................................................................
bugfix; '\number' from e.g. date cause 'sre_constants.error: invalid group reference'
Change-Id: I35633d22f9f96f776198344cb7c1f89f1e8e9e12
---
M catimages.py
1 file changed, 4 insertions(+), 2 deletions(-)
Approvals:
DrTrigon: Verified; Looks good to me, approved
diff --git a/catimages.py b/catimages.py
index f44de4d..bdfa7bd 100644
--- a/catimages.py
+++ b/catimages.py
@@ -4054,13 +4054,15 @@
def _append_to_template(self, text, name, append):
# mask/search template to append to
pattern = re.compile(u"(\{\{%s.*?\n)(\s*\}\}\n{2})" % name, flags=re.S)
- template = pattern.search(text).groups()
+ match = pattern.search(text)
+ template = match.groups()
# append to template
template = u"".join([template[0], append, u"\n", template[1]])
# apply changes
- text = pattern.sub(template, text)
+ #text = pattern.sub(template, text) # '\number' from e.g. date cause 'sre_constants.error: invalid group reference'
+ text = text.replace(match.group(0), template)
return text
# gather data from all information interfaces
--
To view, visit https://gerrit.wikimedia.org/r/115382
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I35633d22f9f96f776198344cb7c1f89f1e8e9e12
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 <>
jenkins-bot has submitted this change and it was merged.
Change subject: Fix and rewrite PageGenerator's query string
......................................................................
Fix and rewrite PageGenerator's query string
The old code has a flaw when, for example, iiprop is in kwargs. Instead of
"xxx|timestamp|...", the query string will be "xxxtimestamp|..."
which is wrong. This patch fixes the problem and remove redundancy
of the code.
Change-Id: I7d496a612d32c70ccb53d2cdcf95cc036944d808
---
M pywikibot/data/api.py
1 file changed, 11 insertions(+), 18 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/data/api.py b/pywikibot/data/api.py
index a574935..45c5d04 100644
--- a/pywikibot/data/api.py
+++ b/pywikibot/data/api.py
@@ -769,27 +769,20 @@
version of each Page (default False)
"""
+ def appendParams(params, key, value):
+ if key in params:
+ params[key] += '|' + value
+ else:
+ params[key] = value
# get some basic information about every page generated
- if 'prop' in kwargs:
- kwargs['prop'] += "|info|imageinfo|categoryinfo"
- else:
- kwargs['prop'] = 'info|imageinfo|categoryinfo'
+ appendParams(kwargs, 'prop', 'info|imageinfo|categoryinfo')
if g_content:
# retrieve the current revision
- kwargs['prop'] += "|revisions"
- if "rvprop" in kwargs:
- kwargs["rvprop"] += "ids|timestamp|flags|comment|user|content"
- else:
- kwargs["rvprop"] = "ids|timestamp|flags|comment|user|content"
- if "inprop" in kwargs:
- if "protection" not in kwargs["inprop"]:
- kwargs["inprop"] += "|protection"
- else:
- kwargs['inprop'] = 'protection'
- if "iiprop" in kwargs:
- kwargs["iiprop"] += 'timestamp|user|comment|url|size|sha1|metadata'
- else:
- kwargs['iiprop'] = 'timestamp|user|comment|url|size|sha1|metadata'
+ appendParams(kwargs, 'prop', 'revisions')
+ appendParams(kwargs, 'rvprop', 'ids|timestamp|flags|comment|user|content')
+ if not ('inprop' in kwargs and 'protection' in kwargs['inprop']):
+ appendParams(kwargs, 'inprop', 'protection')
+ appendParams(kwargs, 'iiprop', 'timestamp|user|comment|url|size|sha1|metadata')
QueryGenerator.__init__(self, generator=generator, **kwargs)
self.resultkey = "pages" # element to look for in result
--
To view, visit https://gerrit.wikimedia.org/r/114949
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I7d496a612d32c70ccb53d2cdcf95cc036944d808
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Nullzero <nullzero.free(a)gmail.com>
Gerrit-Reviewer: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: Mpaa <mpaa.wiki(a)gmail.com>
Gerrit-Reviewer: Pyfisch <pyfisch(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 61231) use OSError as WindowsError does not exist on unix hosts
......................................................................
(bug 61231) use OSError as WindowsError does not exist on unix hosts
Change-Id: I8daea57bae5f296167956bd3f435ba2c93adff75
---
M pywikibot/version.py
1 file changed, 1 insertion(+), 1 deletion(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/version.py b/pywikibot/version.py
index 1a63073..3691529 100644
--- a/pywikibot/version.py
+++ b/pywikibot/version.py
@@ -131,7 +131,7 @@
cmd = 'git'
try:
subprocess.Popen([cmd], stdout=subprocess.PIPE).communicate()
- except WindowsError:
+ except OSError:
# some windows git versions provide git.cmd instead of git.exe
cmd = 'git.cmd'
--
To view, visit https://gerrit.wikimedia.org/r/114988
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I8daea57bae5f296167956bd3f435ba2c93adff75
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot <>
jenkins-bot has submitted this change and it was merged.
Change subject: new mw version 1.23wmf14
......................................................................
new mw version 1.23wmf14
Change-Id: If193524dec5c350e3c37e76849b7f27724ab7a99
---
M pywikibot/family.py
1 file changed, 1 insertion(+), 1 deletion(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/family.py b/pywikibot/family.py
index a426b46..da92ada 100644
--- a/pywikibot/family.py
+++ b/pywikibot/family.py
@@ -1065,7 +1065,7 @@
"""Return Wikimedia projects version number as a string."""
# Don't use this, use versionnumber() instead. This only exists
# to not break family files.
- return '1.23wmf13'
+ return '1.23wmf14'
def shared_image_repository(self, code):
return ('commons', 'commons')
--
To view, visit https://gerrit.wikimedia.org/r/114938
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: If193524dec5c350e3c37e76849b7f27724ab7a99
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot <>
jenkins-bot has submitted this change and it was merged.
Change subject: new mw version 1.23wmf14
......................................................................
new mw version 1.23wmf14
Change-Id: I9f8e24625eec2244cf0c805def9bde9ecc89ce92
---
M family.py
1 file changed, 1 insertion(+), 1 deletion(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/family.py b/family.py
index 739e63a..dec7ae7 100644
--- a/family.py
+++ b/family.py
@@ -4944,7 +4944,7 @@
"""Return Wikimedia projects version number as a string."""
# Don't use this, use versionnumber() instead. This only exists
# to not break family files.
- return '1.23wmf13'
+ return '1.23wmf14'
def shared_image_repository(self, code):
return ('commons', 'commons')
--
To view, visit https://gerrit.wikimedia.org/r/114939
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I9f8e24625eec2244cf0c805def9bde9ecc89ce92
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/compat
Gerrit-Branch: master
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot <>
DrTrigon has submitted this change and it was merged.
Change subject: bugfix; deactivate (for now) pyexiv2 parts since the cause segfaults
......................................................................
bugfix; deactivate (for now) pyexiv2 parts since the cause segfaults
Change-Id: I41dd3ae87293224caea92e62532097448fab1030
---
M catimages.py
1 file changed, 26 insertions(+), 23 deletions(-)
Approvals:
DrTrigon: Verified; Looks good to me, approved
diff --git a/catimages.py b/catimages.py
index a488011..e95bd8a 100644
--- a/catimages.py
+++ b/catimages.py
@@ -305,20 +305,23 @@
return self._buffer_EXIF
res = {}
- enable_recovery() # enable recovery from hard crash
+ enable_recovery('exif') # enable recovery from hard crash
try:
if hasattr(pyexiv2, 'ImageMetadata'):
- metadata = pyexiv2.ImageMetadata(self.file_name)
- metadata.read()
-
- for key in metadata.exif_keys:
- res[key] = metadata[key]
-
- for key in metadata.iptc_keys:
- res[key] = metadata[key]
-
- for key in metadata.xmp_keys:
- res[key] = metadata[key]
+# TODO: find solution to avoid segfaults (error/exit code 139)
+# file pyexiv2 bug report
+# metadata = pyexiv2.ImageMetadata(self.file_name)
+# metadata.read()
+#
+# for key in metadata.exif_keys:
+# res[key] = metadata[key]
+#
+# for key in metadata.iptc_keys:
+# res[key] = metadata[key]
+#
+# for key in metadata.xmp_keys:
+# res[key] = metadata[key]
+ pass
else:
image = pyexiv2.Image(self.file_name)
image.readMetadata()
@@ -335,7 +338,7 @@
pass
except RuntimeError:
pass
- disable_recovery() # disable since everything worked out fine
+ disable_recovery() # disable since everything worked out fine
# http://www.sno.phy.queensu.ca/~phil/exiftool/
@@ -1043,9 +1046,9 @@
# groupThreshold (set groupThreshold to 0 to turn off the grouping completely).
# detectMultiScale(img, hit_threshold=0, win_stride=Size(),
# padding=Size(), scale0=1.05, group_threshold=2)
- enable_recovery() # enable recovery from hard crash
+ enable_recovery('hog') # enable recovery from hard crash
ret = hog.detectMultiScale(img, 0.25, (8,8), (32,32), 1.05, 2)
- disable_recovery() # disable since everything worked out fine
+ disable_recovery() # disable since everything worked out fine
if cv2.__version__ == '$Rev: 4557 $': # TS
found = ret
else: #'2.4.5' or else (e.g. on fedora 18)
@@ -1545,10 +1548,10 @@
# sys.stdout handeled, but with freopen which could give issues
import jseg
# e.g. "segdist -i test3.jpg -t 6 -r9 test3.map.gif"
- enable_recovery() # enable recovery from hard crash
+ enable_recovery('jseg') # enable recovery from hard crash
jseg.segdist_cpp.main([item.encode('utf-8') for item in
("segdist -i %s -t 6 -r9 %s"%(tmpjpg, tmpgif)).split(" ")])
- disable_recovery() # disable since everything worked out fine
+ disable_recovery() # disable since everything worked out fine
#out = open((tmpgif + ".stdout"), "r").read() # reading stdout
#print out
os.remove(tmpgif + ".stdout")
@@ -1780,9 +1783,9 @@
int(img.size[1] / scale)))
img = smallImg
- enable_recovery() # enable recovery from hard crash
+ enable_recovery('dmtx') # enable recovery from hard crash
#res = dm_read.decode(img.size[0], img.size[1], buffer(img.tostring()))
- disable_recovery() # disable since everything worked out fine
+ disable_recovery() # disable since everything worked out fine
#print res
result = []
@@ -2642,9 +2645,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
+ enable_recovery('pdftotext') # enable recovery from hard crash
proc.wait()
- disable_recovery() # disable since everything worked out fine
+ disable_recovery() # disable since everything worked out fine
if proc.returncode:
raise ImportError("pdftotext not found!")
data = open(self.image_path+'.txt', 'r').readlines()
@@ -4560,9 +4563,9 @@
# for functions in C/C++ that might crash hard without any exception throwed
# e.g. an abort due to an assert or something else
-def enable_recovery():
+def enable_recovery(note=''):
recoveryfile = open(os.path.join(scriptdir, 'cache/catimages_recovery'), "w")
- recoveryfile.write('')
+ recoveryfile.write(note)
recoveryfile.close()
--
To view, visit https://gerrit.wikimedia.org/r/114467
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I41dd3ae87293224caea92e62532097448fab1030
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 <>