Linting and comments

This commit is contained in:
zandercymatics 2023-11-28 11:24:44 -07:00
parent 4594eb7ca3
commit 14355327b2
No known key found for this signature in database
GPG key ID: FF4636ABEC9682B7
4 changed files with 18 additions and 7 deletions

View file

@ -104,6 +104,7 @@ def get_current_full(request, file_path = "migrationdata/current-full.csv"):
def get_current_federal(request, file_path="migrationdata/current-federal.csv"): def get_current_federal(request, file_path="migrationdata/current-federal.csv"):
return serve_file(file_path) return serve_file(file_path)
def serve_file(file_path): def serve_file(file_path):
"""Downloads a file based on a given filepath. Returns a 404 if not found.""" """Downloads a file based on a given filepath. Returns a 404 if not found."""
# TODO - #1403, grab from the S3 instance instead # TODO - #1403, grab from the S3 instance instead

View file

@ -15,9 +15,14 @@ class Command(BaseCommand):
def add_arguments(self, parser): def add_arguments(self, parser):
"""Add our two filename arguments.""" """Add our two filename arguments."""
parser.add_argument("--directory", default="migrationdata", help="Desired directory") parser.add_argument("--directory", default="migrationdata", help="Desired directory")
parser.add_argument("--checkpath", default=True, help="Used for test cases") parser.add_argument(
"--checkpath",
default=True,
help="Flag that determines if we do a check for os.path.exists. Used for test cases",
)
def handle(self, **options): def handle(self, **options):
"""Grabs the directory then creates current-federal.csv in that directory"""
# Ensures a slash is added # Ensures a slash is added
directory = os.path.join(options.get("directory"), "") directory = os.path.join(options.get("directory"), "")
check_path = options.get("checkpath") check_path = options.get("checkpath")

View file

@ -15,9 +15,14 @@ class Command(BaseCommand):
def add_arguments(self, parser): def add_arguments(self, parser):
"""Add our two filename arguments.""" """Add our two filename arguments."""
parser.add_argument("--directory", default="migrationdata", help="Desired directory") parser.add_argument("--directory", default="migrationdata", help="Desired directory")
parser.add_argument("--checkpath", default=True, help="Used for test cases") parser.add_argument(
"--checkpath",
default=True,
help="Flag that determines if we do a check for os.path.exists. Used for test cases",
)
def handle(self, **options): def handle(self, **options):
"""Grabs the directory then creates current-full.csv in that directory"""
# Ensures a slash is added # Ensures a slash is added
directory = os.path.join(options.get("directory"), "") directory = os.path.join(options.get("directory"), "")
check_path = options.get("checkpath") check_path = options.get("checkpath")