Skip to content

Commit

Permalink
Black formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
palewire committed Sep 10, 2022
1 parent 76c4879 commit aa5deb4
Show file tree
Hide file tree
Showing 61 changed files with 42,078 additions and 10,988 deletions.
1 change: 1 addition & 0 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ requests-mock = "*"
twine = "*"
setuptools-scm = "*"
django-internetarchive-storage = "*"
black = "*"

[requires]
python_version = "3.9"
74 changes: 67 additions & 7 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 11 additions & 7 deletions calaccess_raw/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,29 @@
"""
import os
from django.conf import settings
default_app_config = 'calaccess_raw.apps.CalAccessRawConfig'

default_app_config = "calaccess_raw.apps.CalAccessRawConfig"


def get_data_directory():
"""
Returns download directory for data storage downloaded data.
"""
if getattr(settings, 'CALACCESS_DATA_DIR', None):
return getattr(settings, 'CALACCESS_DATA_DIR')
elif getattr(settings, 'BASE_DIR', None):
return os.path.join(getattr(settings, 'BASE_DIR'), 'data')
raise ValueError("CAL-ACCESS download directory not configured. Set either \
CALACCESS_DATA_DIR or BASE_DIR in settings.py")
if getattr(settings, "CALACCESS_DATA_DIR", None):
return getattr(settings, "CALACCESS_DATA_DIR")
elif getattr(settings, "BASE_DIR", None):
return os.path.join(getattr(settings, "BASE_DIR"), "data")
raise ValueError(
"CAL-ACCESS download directory not configured. Set either \
CALACCESS_DATA_DIR or BASE_DIR in settings.py"
)


def get_model_list():
"""
Returns a model list with all the data tables in this application.
"""
from django.apps import apps

model_list = apps.get_app_config("calaccess_raw").models.values()
return [m for m in model_list if "CalAccessBaseModel" in str(m.__base__)]
Loading

0 comments on commit aa5deb4

Please sign in to comment.