jenkins-bot has submitted this change and it was merged.
Change subject: new mw release 1.23wmf12
......................................................................
new mw release 1.23wmf12
Change-Id: I381ccb11bc3252b76fae3ccb6cd2c340b56a18d1
---
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 611853e..9821605 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.23wmf11'
+ return '1.23wmf12'
def shared_image_repository(self, code):
return ('commons', 'commons')
--
To view, visit https://gerrit.wikimedia.org/r/112242
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I381ccb11bc3252b76fae3ccb6cd2c340b56a18d1
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: api.py: do not call self.update_limit() twice
......................................................................
api.py: do not call self.update_limit() twice
Change-Id: I0c4a0990ad79743eb57a39287bfa4973ca070a93
---
M pywikibot/data/api.py
1 file changed, 5 insertions(+), 2 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/data/api.py b/pywikibot/data/api.py
index d40cb3c..a574935 100644
--- a/pywikibot/data/api.py
+++ b/pywikibot/data/api.py
@@ -516,6 +516,7 @@
kwargs["indexpageids"] = "" # always ask for list of pageids
self.request = Request(**kwargs)
self.prefix = None
+ self.api_limit = None
self.update_limit() # sets self.prefix
if self.api_limit is not None and "generator" in kwargs:
self.prefix = "g" + self.prefix
@@ -582,12 +583,15 @@
"""
limit = int(value)
+
# don't update if limit is greater than maximum allowed by API
- self.update_limit()
if self.api_limit is None:
self.query_limit = limit
else:
self.query_limit = min(self.api_limit, limit)
+ pywikibot.debug(u"%s: Set query_limit to %i."
+ % (self.__class__.__name__, self.query_limit),
+ _logger)
def set_maximum_items(self, value):
"""Set the maximum number of items to be retrieved from the wiki.
@@ -606,7 +610,6 @@
def update_limit(self):
"""Set query limit for self.module based on api response"""
- self.api_limit = None
for mod in self.module.split('|'):
for param in self._modules[mod].get("parameters", []):
if param["name"] == "limit":
--
To view, visit https://gerrit.wikimedia.org/r/110686
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I0c4a0990ad79743eb57a39287bfa4973ca070a93
Gerrit-PatchSet: 6
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Mpaa <mpaa.wiki(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: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot <>
jenkins-bot has submitted this change and it was merged.
Change subject: enable -fromlang option
......................................................................
enable -fromlang option
itercode() method is a generator which gives all sites the
featured articles are verified from given by -fromall or fromlang
option.
Change-Id: I89acef20cf0d6549fcca647f82ba8b79939249ba
---
M scripts/featured.py
1 file changed, 42 insertions(+), 67 deletions(-)
Approvals:
Pyfisch: Looks good to me, approved
jenkins-bot: Verified
diff --git a/scripts/featured.py b/scripts/featured.py
index 45a57bc..56c121e 100644
--- a/scripts/featured.py
+++ b/scripts/featured.py
@@ -28,7 +28,6 @@
-fromlang:xx,yy xx,yy,zz,.. are the languages to be verified.
-fromlang:ar--fi Another possible with range the languages
- (sorry, not implemented yet)
-fromall to verify all languages.
@@ -230,14 +229,51 @@
'nocache': list(),
'side': False, # not template_on_top
'quiet': False,
+ 'interactive': False,
})
super(FeaturedBot, self).__init__(**kwargs)
self.editcounter = 0
- self.fromlang = None
self.cache = dict()
self.filename = None
self.site = pywikibot.Site()
+ if self.getOption('fromlang') is True: # must be a list
+ self.options['fromlang'] = False
+
+ def itercode(self, task):
+ """ generator for site codes to be processed """
+ if task == 'good':
+ item_no = good_name['wikidata'][1]
+ elif task == 'featured':
+ item_no = featured_name['wikidata'][1]
+ dp = pywikibot.ItemPage(pywikibot.Site().data_repository(), item_no)
+ dp.get()
+ ### Quick and dirty hack - any ideas?
+ # use wikipedia sites only
+ generator = (lang.replace('_', '-') for (lang, fam) in
+ sorted([key.split('wiki')
+ for key in dp.sitelinks.keys()])
+ if not fam)
+
+ if self.getOption('fromall'):
+ return generator
+ elif self.getOption('fromlang'):
+ fromlang = self.getOption('fromlang')
+ if len(fromlang) == 1 and fromlang[0].find("--") >= 0:
+ start, end = fromlang[0].split("--", 1)
+ if not start:
+ start = ""
+ if not end:
+ end = "zzzzzzz"
+ return (code for code in generator
+ if code >= start and code <= end)
+ else:
+ return (code for code in generator if code in fromlang)
+ else:
+ pywikibot.warning(u'No sites given to verify %s articles.\n'
+ u'Please use -fromlang: or fromall option\n'
+ % task)
+ return ()
def hastemplate(self, task):
add_tl, remove_tl = self.getTemplateList(self.site.lang, task)
@@ -294,21 +330,8 @@
% (task, self.site))
return
- if self.getOption('fromall'):
- item_no = good_name['wikidata'][1]
- dp = pywikibot.ItemPage(pywikibot.Site().data_repository(), item_no)
- dp.get()
-
- ### Quick and dirty hack - any ideas?
- # use wikipedia sites only
- self.fromlang = [lang.replace('_', '-') for (lang, fam) in
- [key.split('wiki') for key in dp.sitelinks.keys()]
- if not fam]
- else:
- return # 2DO
- self.fromlang.sort()
self.readcache(task)
- for code in self.fromlang:
+ for code in self.itercode(task):
try:
self.treat(code, task)
except KeyboardInterrupt:
@@ -334,21 +357,8 @@
% (task, self.site))
return
- if self.getOption('fromall'):
- item_no = featured_name['wikidata'][1]
- dp = pywikibot.ItemPage(pywikibot.Site().data_repository(), item_no)
- dp.get()
-
- ### Quick and dirty hack - any ideas?
- # use wikipedia sites only
- self.fromlang = [lang.replace('_', '-') for (lang, fam) in
- [key.split('wiki') for key in dp.sitelinks.keys()]
- if not fam]
- else:
- return # 2DO
- self.fromlang.sort()
self.readcache(task)
- for code in self.fromlang:
+ for code in self.itercode(task):
try:
self.treat(code, task)
except KeyboardInterrupt:
@@ -532,6 +542,7 @@
% (findtemplate.replace(u' ', u'[ _]'),
site.code), re.IGNORECASE)
+ interactive = self.getOption('interactive')
tosite = self.site
if not fromsite.lang in self.cache:
self.cache[fromsite.lang] = {}
@@ -616,17 +627,12 @@
interactive = 0
afterpage = u"!"
-## featuredcount = False
- fromlang = []
- processType = 'featured'
- part = False
options = {}
for arg in pywikibot.handleArgs():
if arg == '-interactive':
interactive = 1
elif arg.startswith('-fromlang:'):
- fromlang = arg[10:].split(",")
- part = True
+ options[arg[1:9]] = arg[10:].split(",")
elif arg.startswith('-after:'):
afterpage = arg[7:]
elif arg.startswith('-nocache:'):
@@ -634,37 +640,6 @@
else:
options[arg[1:].lower()] = True
- if part:
- try:
- # BUG: range with zh-min-nan (3 "-")
- if len(fromlang) == 1 and fromlang[0].index("-") >= 0:
- start, end = fromlang[0].split("--", 1)
- if not start:
- start = ""
- if not end:
- end = "zzzzzzz"
- if processType == 'good':
- fromlang = [lang for lang in good_name.keys()
- if lang >= start and lang <= end]
- elif processType == 'list':
- fromlang = [lang for lang in lists_name.keys()
- if lang >= start and lang <= end]
- elif processType == 'former':
- fromlang = [lang for lang in former_name.keys()
- if lang >= start and lang <= end]
- else:
- fromlang = [lang for lang in featured_name.keys()
- if lang >= start and lang <= end]
- except:
- pass
-
-## for ll in fromlang:
-## fromsite = pywikibot.getSite(ll)
-## if featuredcount:
-## try:
-## featuredArticles(fromsite, processType).next()
-## except StopIteration:
-## continue
if options:
bot = FeaturedBot(**options)
bot.run()
--
To view, visit https://gerrit.wikimedia.org/r/111752
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I89acef20cf0d6549fcca647f82ba8b79939249ba
Gerrit-PatchSet: 5
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: DrTrigon <dr.trigon(a)surfeu.ch>
Gerrit-Reviewer: Huji <huji.huji(a)gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: Meno25 <meno25mail(a)gmail.com>
Gerrit-Reviewer: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: Pyfisch <pyfisch(a)gmail.com>
Gerrit-Reviewer: Siebrand <siebrand(a)wikimedia.org>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot <>
DrTrigon has submitted this change and it was merged.
Change subject: bugfix; StreamException: cannot get a seconds duration when no TempoIndication classes are found in or before this Stream.
......................................................................
bugfix; StreamException: cannot get a seconds duration when no TempoIndication classes are found in or before this Stream.
Change-Id: Iebaf9af0789f2de41ef4d55b9907f78e64cbc1f8
---
M catimages.py
1 file changed, 7 insertions(+), 1 deletion(-)
Approvals:
DrTrigon: Verified; Looks good to me, approved
diff --git a/catimages.py b/catimages.py
index b748658..e00bda0 100644
--- a/catimages.py
+++ b/catimages.py
@@ -3049,6 +3049,8 @@
# midi audio stream/feature extraction, detect streams of notes; parts
def _detect_Streams(self):
+ import _music21 as music21
+
# like in '_OggFile' (streams) a nice content listing of MIDI (music21)
d = self._util_get_DataStreams_MUSIC21()
if not d:
@@ -3064,12 +3066,16 @@
#print mm.durationToSeconds(part.duration.quarterLength)
#print sum([item.seconds for item in stream]) # sum over all Note(s)
#print part.metadata
+ try:
+ duration = part.seconds
+ except music21.stream.StreamException:
+ duration = None
data.append({'ID': (i + 1),
'Format': u'(audio/midi)',
# note rate / noteduration ...??
'Rate': u'%s/-/-' % d["channels"][i],
'Dimension': (None, None),
- 'Duration': part.seconds,})
+ 'Duration': duration,})
self._features['Streams'] = data
return
--
To view, visit https://gerrit.wikimedia.org/r/112235
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Iebaf9af0789f2de41ef4d55b9907f78e64cbc1f8
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 <>
jenkins-bot has submitted this change and it was merged.
Change subject: Minor fix for typo in copyright message
......................................................................
Minor fix for typo in copyright message
Change-Id: I3270db85b4d28ac5f2ac91e4428d4378344bd32e
---
M pywikibot/__init__.py
1 file changed, 1 insertion(+), 1 deletion(-)
Approvals:
Legoktm: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/__init__.py b/pywikibot/__init__.py
index b5ea3a3..bd7bd73 100644
--- a/pywikibot/__init__.py
+++ b/pywikibot/__init__.py
@@ -3,7 +3,7 @@
The initialization file for the Pywikibot framework.
"""
#
-# (C) Pywikibot team, 2008-213
+# (C) Pywikibot team, 2008-2013
#
# Distributed under the terms of the MIT license.
#
--
To view, visit https://gerrit.wikimedia.org/r/111947
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I3270db85b4d28ac5f2ac91e4428d4378344bd32e
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Sn1per <geofbot(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: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot <>