Browse Source

More refined code

bugfixes
gau1991 10 years ago
parent
commit
fa8088a3eb
  1. 4
      ee/core/download.py

4
ee/core/download.py

@ -1,6 +1,7 @@
"""EasyEngine download core classes."""
import urllib.request
import urllib.error
import os
class EEDownload():
@ -10,6 +11,9 @@ class EEDownload():
def download(url, filename):
try:
directory = os.path.dirname(filename)
if not os.path.exists(directory):
os.makedirs(directory)
urllib.request.urlretrieve(url, filename)
return True
except urllib.error.URLError as e:

Loading…
Cancel
Save