Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
jsstevenson committed Nov 10, 2023
1 parent e66c0c5 commit baf9c00
Showing 1 changed file with 0 additions and 17 deletions.
17 changes: 0 additions & 17 deletions src/wags_tails/utils/downloads.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import re
import tempfile
import zipfile
from ftplib import FTP
from pathlib import Path
from typing import Callable, Dict, Optional

Expand Down Expand Up @@ -32,22 +31,6 @@ def handle_zip(dl_path: Path, outfile_path: Path) -> None:
os.remove(dl_path)


def download_ftp(host: str, file_dir: str, file_name: str, outfile: Path) -> None:
"""Perform FTP download of remote data file.
:param host: FTP server hostname
:param file_dir: directory path to file
:param file_name: name of file on server
:param outfile: location to save file to
"""
with FTP(host) as ftp:
ftp.login()
ftp.cwd(file_dir)
with open(outfile, "wb") as fp:
# TODO tqdm this
ftp.retrbinary(f"RETR {file_name}", fp.write)


def download_http(
url: str,
outfile_path: Path,
Expand Down

0 comments on commit baf9c00

Please sign in to comment.