fix geo tools wikipedia module

This commit is contained in:
rolux 2011-10-12 02:14:05 +02:00
commit 80ad054cfa
5 changed files with 414 additions and 2546 deletions

View file

@ -297,10 +297,10 @@ geo = {
'Sint Maarten': ['Sint Maarten, Netherlands Antilles'],
'South Ossetia': ['Shida Kartli'],
# see http://en.wikipedia.org/wiki/Sudan#States_and_regions
'South Sudan': [
'Central Equatoria, Sudan', 'Eastern Equatoria, Sudan', 'Jonglei, Sudan', 'Lakes, Sudan', 'Northern Bahr el Ghazal, Sudan',
'Upper Nile, Sudan', 'Unity, Sudan', 'Warrap, Sudan', 'Western Bahr el Ghazal, Sudan', 'Western Equatoria, Sudan'
],
# 'South Sudan': [
# 'Central Equatoria, Sudan', 'Eastern Equatoria, Sudan', 'Jonglei, Sudan', 'Lakes, Sudan', 'Northern Bahr el Ghazal, Sudan',
# 'Upper Nile, Sudan', 'Unity, Sudan', 'Warrap, Sudan', 'Western Bahr el Ghazal, Sudan', 'Western Equatoria, Sudan'
# ],
'South Yemen': ['Al-Mahrah, Yemen', 'Lahij, Yemen'],
'Soviet Union': [
'Armenia', 'Azerbaijan', 'Belarus', 'Estonia', 'Georgia, Europe',
@ -1102,7 +1102,7 @@ def get_countries():
def get_country_flag(code, url):
# max width on wikipedia
width = 2048
img = read_url(url)
img = read_url(url, cache=False)
png_file = '../png/flags/' + str(width) + '/' + code + '.png'
if url[-4:] == '.svg':
svg_file = '../svg/flags/' + code + '.svg'

View file

@ -340,7 +340,7 @@ def get_country_data(url):
def get_country_flag_url(code, url):
html = read_url(url)
results = re.compile('<div class="fullImageLink" id="file"><a href="(.*?)"', re.DOTALL).findall(html)
url = results[0]
url = 'http:' + results[0]
return url
def get_country_urls():