Merge pull request #1233 from Sworddragon/master

Fixes for building
This commit is contained in:
oy 2014-06-21 13:22:03 +02:00
commit 165a8e740b
2 changed files with 11 additions and 4 deletions

View file

@ -113,7 +113,7 @@ if not maps_dir:
sys.exit(-1)
print("adding files")
shutil.copy("readme.txt", package_dir)
shutil.copy("readme.md", package_dir)
shutil.copy("license.txt", package_dir)
shutil.copy("storage.cfg", package_dir)

View file

@ -7,10 +7,17 @@ elif sys.version_info[0] == 3:
url_lib = urllib.request
def fetch_file(url):
print("trying %s" % url)
try:
print("trying %s" % url)
local = dict(url_lib.urlopen(url).info())["content-disposition"].split("=")[1]
local = dict(url_lib.urlopen(url).info())
if "Content-Disposition" in local:
key_name = "Content-Disposition"
elif "content-disposition" in local:
key_name = "content-disposition"
else:
return False
local = local[key_name].split("=")[1]
url_lib.urlretrieve(url, local)
return local
except:
except IOError:
return False