Revision: 8671 Author: multichill Date: 2010-10-20 15:08:22 +0000 (Wed, 20 Oct 2010)
Log Message: ----------- Added the location based categorization
Modified Paths: -------------- trunk/pywikipedia/panoramiopicker.py
Modified: trunk/pywikipedia/panoramiopicker.py =================================================================== --- trunk/pywikipedia/panoramiopicker.py 2010-10-20 15:05:53 UTC (rev 8670) +++ trunk/pywikipedia/panoramiopicker.py 2010-10-20 15:08:22 UTC (rev 8671) @@ -166,10 +166,19 @@ desc = desc + u'{{Panoramioreview}}\n'
desc = desc + u'\n' + cats = u'' if addCategory: desc = desc + u'\n[[Category:%s]]\n' % (addCategory,) - # Still have to get a bunch of categories based on the location - desc = desc + u'{{subst:Unc}}\n' + cats = True + + # Get categories based on location + if photoInfo.get(u'latitude') and photoInfo.get(u'longitude'): + cats=imagerecat.getOpenStreetMapCats(photoInfo.get(u'latitude'), photoInfo.get(u'longitude')) + cats=imagerecat.applyAllFilters(cats) + for cat in cats: + desc = desc + u'[[Category:%s]]\n' % (cat,) + if not cats: + desc = desc + u'{{subst:Unc}}\n'
return desc % photoInfo