http://www.mediawiki.org/wiki/Special:Code/pywikipedia/11710
Revision: 11710
Author: drtrigon
Date: 2013-07-02 20:55:33 +0000 (Tue, 02 Jul 2013)
Log Message:
-----------
follow up; to r11709, r11707 since the we have in fact different behaviour for different OpenCV versions
Modified Paths:
--------------
trunk/pywikipedia/catimages.py
Modified: trunk/pywikipedia/catimages.py
===================================================================
--- trunk/pywikipedia/catimages.py 2013-07-02 20:39:58 UTC (rev 11709)
+++ trunk/pywikipedia/catimages.py 2013-07-02 20:55:33 UTC (rev 11710)
@@ -1031,8 +1031,12 @@
# detectMultiScale(img, hit_threshold=0, win_stride=Size(),
# padding=Size(), scale0=1.05, group_threshold=2)
enable_recovery() # enable recovery from hard crash
- found, w = hog.detectMultiScale(img, 0.25, (8,8), (32,32), 1.05, 2)
+ ret = hog.detectMultiScale(img, 0.25, (8,8), (32,32), 1.05, 2)
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)
+ found, w = ret
found = list(found)
# people haar/cascaded classifier
http://www.mediawiki.org/wiki/Special:Code/pywikipedia/11709
Revision: 11709
Author: drtrigon
Date: 2013-07-02 20:39:58 +0000 (Tue, 02 Jul 2013)
Log Message:
-----------
bug fix; ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
(is a follow-up to r11707)
Modified Paths:
--------------
trunk/pywikipedia/catimages.py
Modified: trunk/pywikipedia/catimages.py
===================================================================
--- trunk/pywikipedia/catimages.py 2013-07-02 13:37:22 UTC (rev 11708)
+++ trunk/pywikipedia/catimages.py 2013-07-02 20:39:58 UTC (rev 11709)
@@ -1031,9 +1031,9 @@
# detectMultiScale(img, hit_threshold=0, win_stride=Size(),
# padding=Size(), scale0=1.05, group_threshold=2)
enable_recovery() # enable recovery from hard crash
- found = list(hog.detectMultiScale(img, 0.25, (8,8), (32,32), 1.05, 2))
+ found, w = hog.detectMultiScale(img, 0.25, (8,8), (32,32), 1.05, 2)
disable_recovery() # disable since everything worked out fine
- found = [item for item in found if item]
+ found = list(found)
# people haar/cascaded classifier
# use 'haarcascade_fullbody.xml', ... also (like face detection)
http://www.mediawiki.org/wiki/Special:Code/pywikipedia/11707
Revision: 11707
Author: drtrigon
Date: 2013-07-01 21:33:58 +0000 (Mon, 01 Jul 2013)
Log Message:
-----------
bug fix; solve IndexError: index 0 is out of bounds for axis 0 with size 0
bug fix; solve TypeError: argument of type 'float' is not iterable
Modified Paths:
--------------
trunk/pywikipedia/catimages.py
Modified: trunk/pywikipedia/catimages.py
===================================================================
--- trunk/pywikipedia/catimages.py 2013-07-01 13:04:55 UTC (rev 11706)
+++ trunk/pywikipedia/catimages.py 2013-07-01 21:33:58 UTC (rev 11707)
@@ -199,10 +199,10 @@
misc += [exif['DescProducer']] if 'DescProducer' in exif else []
misc += [exif['DescCreator']] if 'DescCreator' in exif else []
- result = { 'Software': exif['Software'] if 'Software' in exif else u'-',
- 'Desc': exif['Desc'] if 'Desc' in exif else u'-',
- 'Comment': exif['Comment'] if 'Comment' in exif else u'-',
- 'Producer': exif['Producer'] if 'Producer' in exif else u'-',
+ result = { 'Software': u'%s'%exif['Software'] if 'Software' in exif else u'-',
+ 'Desc': u'%s'%exif['Desc'] if 'Desc' in exif else u'-',
+ 'Comment': u'%s'%exif['Comment'] if 'Comment' in exif else u'-',
+ 'Producer': u'%s'%exif['Producer'] if 'Producer' in exif else u'-',
'Misc': u'\n'.join(misc) if misc else u'-',}
#'Output_Extension': exif['Output_extension'] if 'Output_extension' in exif else u'-',
#'DescProducer': exif['DescProducer'] if 'DescProducer' in exif else u'-',
@@ -1033,6 +1033,7 @@
enable_recovery() # enable recovery from hard crash
found = list(hog.detectMultiScale(img, 0.25, (8,8), (32,32), 1.05, 2))
disable_recovery() # disable since everything worked out fine
+ found = [item for item in found if item]
# people haar/cascaded classifier
# use 'haarcascade_fullbody.xml', ... also (like face detection)
http://www.mediawiki.org/wiki/Special:Code/pywikipedia/11704
Revision: 11704
Author: siebrand
Date: 2013-06-30 17:01:59 +0000 (Sun, 30 Jun 2013)
Log Message:
-----------
Localisation updates from http://translatewiki.net.
Modified Paths:
--------------
branches/rewrite/scripts/i18n/weblinkchecker.py
Modified: branches/rewrite/scripts/i18n/weblinkchecker.py
===================================================================
--- branches/rewrite/scripts/i18n/weblinkchecker.py 2013-06-30 12:20:15 UTC (rev 11703)
+++ branches/rewrite/scripts/i18n/weblinkchecker.py 2013-06-30 17:01:59 UTC (rev 11704)
@@ -327,8 +327,10 @@
},
# Author: Dbc334
'sl': {
+ 'weblinkchecker-archive_msg': u'Spletno stran je shranil Internet Archive. Prosimo, razmislite o povezavi na ustrezno arhivirano različico: [%(URL)s].',
'weblinkchecker-caption': u'Mrtva povezava',
'weblinkchecker-summary': u'Robot: Poročanje o nedosegljivi zunanji povezavi',
+ 'weblinkchecker-report': u'Med več samodejnimi zaganjanji je bot ugotovil, da naslednja zunanja povezava ni na voljo. Prosimo, preverite, ali povezava zares ne deluje, in jo v tem primeru popravite ali odstranite.',
},
# Author: Rancher
'sr': {
http://www.mediawiki.org/wiki/Special:Code/pywikipedia/11703
Revision: 11703
Author: multichill
Date: 2013-06-30 12:20:15 +0000 (Sun, 30 Jun 2013)
Log Message:
-----------
Globe can be null like at https://www.wikidata.org/w/api.php?action=wbgetentities&ids=Q9831&format=js… . Than "data['globe']"==None so globes[data['globe']] will throw a Keyerror. Changed it to default to earth when it's null.
Modified Paths:
--------------
branches/rewrite/pywikibot/__init__.py
Modified: branches/rewrite/pywikibot/__init__.py
===================================================================
--- branches/rewrite/pywikibot/__init__.py 2013-06-30 02:03:30 UTC (rev 11702)
+++ branches/rewrite/pywikibot/__init__.py 2013-06-30 12:20:15 UTC (rev 11703)
@@ -164,9 +164,17 @@
for k in site.globes():
globes[site.globes()[k]] = k
+ globekey = data['globe']
+ if globekey:
+ # FIXME: Should probably use get() with some error handling when it's an unknown globe
+ globe = globes[data['globe']]
+ else:
+ # Default to earth or should we use None here?
+ globe = 'earth'
+
return Coordinate(data['latitude'], data['longitude'],
data['altitude'], data['precision'],
- globes[data['globe']], site=site)
+ globe, site=site)
@property
def precision(self):