mirror of
https://github.com/rspeer/wordfreq.git
synced 2024-12-23 09:21:37 +00:00
Two small stylistic tweaks
This commit is contained in:
parent
2b2bd943d2
commit
ea29469643
@ -58,15 +58,11 @@ def download(url, dest_filename):
|
|||||||
Download the file at `url` to `dest_filename`. Show a progress bar
|
Download the file at `url` to `dest_filename`. Show a progress bar
|
||||||
while downloading.
|
while downloading.
|
||||||
"""
|
"""
|
||||||
base_dir = os.path.dirname(dest_filename)
|
ensure_dir_exists(dest_filename)
|
||||||
if not os.path.exists(base_dir):
|
|
||||||
os.makedirs(base_dir)
|
|
||||||
|
|
||||||
tracker = ProgressTracker(url)
|
tracker = ProgressTracker(url)
|
||||||
urlretrieve(url, dest_filename, reporthook=tracker.report_progress)
|
urlretrieve(url, dest_filename, reporthook=tracker.report_progress)
|
||||||
tracker.finish()
|
tracker.finish()
|
||||||
logger.info("Saved database to %s" % dest_filename)
|
logger.info("Saved database to %s" % dest_filename)
|
||||||
return True
|
|
||||||
|
|
||||||
|
|
||||||
def download_and_extract_raw_data(url=None, root_dir=None):
|
def download_and_extract_raw_data(url=None, root_dir=None):
|
||||||
|
Loading…
Reference in New Issue
Block a user