Add an app builder

This commit is contained in:
Valentin Niess
2020-04-02 00:10:20 +02:00
parent 83ee9e5f0c
commit f23a2dc25f
10 changed files with 320 additions and 42 deletions

View File

@@ -1,4 +1,8 @@
import os
try:
from urllib.request import urlopen as _urlopen
except ImportError:
from urllib2 import urlopen as _urlopen
try:
from urllib.request import urlretrieve as _urlretrieve
except ImportError:
@@ -8,7 +12,15 @@ except ImportError:
from .log import debug
__all__ = ['urlretrieve']
__all__ = ['urlopen', 'urlretrieve']
def urlopen(url, *args, **kwargs):
'''Open a remote file
'''
baseurl, urlname = os.path.split(url)
debug('DOWNLOAD', '%s from %s', baseurl, urlname)
return _urlopen(url, *args, **kwargs)
def urlretrieve(url, filename=None):