Skip to content

Commit

Permalink
PEP 8 style updates.
Browse files Browse the repository at this point in the history
  • Loading branch information
alexdlaird committed Mar 4, 2024
1 parent 8781892 commit db5f4a1
Show file tree
Hide file tree
Showing 37 changed files with 108 additions and 148 deletions.
8 changes: 4 additions & 4 deletions conf/configs/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
Settings common to all deployment methods.
"""

__copyright__ = "Copyright (c) 2018 Alex Laird"
__license__ = "MIT"
__version__ = "1.0.1"

import os
import socket

from conf.settings import PROJECT_ID

__author__ = "Alex Laird"
__copyright__ = "Copyright 2018, Alex Laird"
__version__ = "0.3.0"

# Define the base working directory of the application
BASE_DIR = os.path.normpath(os.path.join(os.path.abspath(os.path.dirname(__file__)), '..', '..'))

Expand Down
7 changes: 3 additions & 4 deletions conf/configs/deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@
Settings specific to prod-like deployable code, reading values from system environment variables.
"""

__copyright__ = "Copyright (c) 2018 Alex Laird"
__license__ = "MIT"

import os

from conf.configs import common
from conf.settings import PROJECT_ID

__author__ = "Alex Laird"
__copyright__ = "Copyright 2018, Alex Laird"
__version__ = "0.3.0"

# Application definition

INSTALLED_APPS = common.INSTALLED_APPS
Expand Down
7 changes: 3 additions & 4 deletions conf/configs/dev.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,15 @@
Settings specific to a development environment using Django's `runserver` command, reading values from `.env`.
"""

__copyright__ = "Copyright (c) 2018 Alex Laird"
__license__ = "MIT"

import os
import warnings

from conf.configs import common
from conf.settings import PROJECT_ID

__author__ = "Alex Laird"
__copyright__ = "Copyright 2018, Alex Laird"
__version__ = "0.3.4"

# Define the base working directory of the application
BASE_DIR = os.path.normpath(os.path.join(os.path.abspath(os.path.dirname(__file__)), '..', '..'))

Expand Down
7 changes: 3 additions & 4 deletions conf/configs/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@
Settings specific to running tests, reading values from `.env`.
"""

__copyright__ = "Copyright (c) 2018 Alex Laird"
__license__ = "MIT"

import logging
import os

from conf.configs import common

__author__ = "Alex Laird"
__copyright__ = "Copyright 2018, Alex Laird"
__version__ = "0.3.0"

# Define the base working directory of the application
BASE_DIR = os.path.normpath(os.path.join(os.path.abspath(os.path.dirname(__file__)), '..', '..'))

Expand Down
7 changes: 3 additions & 4 deletions conf/monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,16 @@
Detects changes and restarts the WSGI daemon process. Should only be used in development.
"""

__copyright__ = "Copyright (c) 2018 Alex Laird"
__license__ = "MIT"

import atexit
import os
import queue
import signal
import sys
import threading

__author__ = "Alex Laird"
__copyright__ = "Copyright 2018, Alex Laird"
__version__ = "0.2.0"

_interval = 1.0
_times = {}
_files = []
Expand Down
8 changes: 3 additions & 5 deletions conf/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,11 @@
All configuration files first read `common.py` before applying deployment-specific configurations.
"""

__copyright__ = "Copyright (c) 2018 Alex Laird"
__license__ = "MIT"

import os
import sys
from builtins import str

__author__ = "Alex Laird"
__copyright__ = "Copyright 2018, Alex Laird"
__version__ = "0.3.0"

# Are we running on the dev server
DEV_SERVER = False
Expand Down
7 changes: 3 additions & 4 deletions conf/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
Base URL configuration.
"""

__copyright__ = "Copyright (c) 2018 Alex Laird"
__license__ = "MIT"

import sys

from django.conf import settings as config
Expand All @@ -12,10 +15,6 @@
import myproject.common.urls
import myproject.myapp.urls

__author__ = "Alex Laird"
__copyright__ = "Copyright 2018, Alex Laird"
__version__ = "0.6.0"

urlpatterns = [
# Include app-specific URL files
re_path(r'^', include(myproject.common.urls)),
Expand Down
7 changes: 3 additions & 4 deletions conf/wsgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@
WSGI configuration for Django environment.
"""

__copyright__ = "Copyright (c) 2018 Alex Laird"
__license__ = "MIT"

import os

from django.conf import settings
from django.core.wsgi import get_wsgi_application

__author__ = "Alex Laird"
__copyright__ = "Copyright 2018, Alex Laird"
__version__ = "0.2.0"

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "conf.settings")

application = get_wsgi_application()
Expand Down
7 changes: 3 additions & 4 deletions myproject/auth/admin.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
__copyright__ = "Copyright (c) 2018 Alex Laird"
__license__ = "MIT"

from django import forms
from django.contrib.auth import admin
from django.contrib.auth import get_user_model
Expand All @@ -7,10 +10,6 @@

from myproject.common.admin import BaseModelAdmin, admin_site

__author__ = "Alex Laird"
__copyright__ = "Copyright 2018, Alex Laird"
__version__ = "0.2.0"


class AdminUserCreationForm(UserCreationForm):
def clean_password2(self):
Expand Down
7 changes: 3 additions & 4 deletions myproject/auth/apps.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
from django.apps import AppConfig
__copyright__ = "Copyright (c) 2018 Alex Laird"
__license__ = "MIT"

__author__ = "Alex Laird"
__copyright__ = "Copyright 2018, Alex Laird"
__version__ = "0.2.0"
from django.apps import AppConfig


class AuthConfig(AppConfig):
Expand Down
7 changes: 3 additions & 4 deletions myproject/auth/forms/userloginform.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
__copyright__ = "Copyright (c) 2018 Alex Laird"
__license__ = "MIT"

from django import forms

from myproject.common.forms.baseform import BaseForm

__author__ = "Alex Laird"
__copyright__ = "Copyright 2018, Alex Laird"
__version__ = "0.2.0"


class UserLoginForm(forms.Form, BaseForm):
username = forms.CharField(label='Username')
Expand Down
7 changes: 3 additions & 4 deletions myproject/auth/forms/userregistrationform.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
__copyright__ = "Copyright (c) 2018 Alex Laird"
__license__ = "MIT"

from django import forms
from django.contrib.auth import get_user_model, password_validation
from django.core import exceptions

from myproject.common import enums
from myproject.common.forms.baseform import BaseForm

__author__ = "Alex Laird"
__copyright__ = "Copyright 2018, Alex Laird"
__version__ = "0.2.0"


class UserRegisterForm(forms.ModelForm, BaseForm):
password1 = forms.CharField(label='Password', widget=forms.PasswordInput)
Expand Down
4 changes: 0 additions & 4 deletions myproject/auth/managers/usermanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@
from django.contrib.auth.models import BaseUserManager
from django.db.models import Q

__author__ = "Alex Laird"
__copyright__ = "Copyright 2018, Alex Laird"
__version__ = "0.2.0"

logger = logging.getLogger(__name__)


Expand Down
7 changes: 3 additions & 4 deletions myproject/auth/models/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
User model.
"""

__copyright__ = "Copyright (c) 2018 Alex Laird"
__license__ = "MIT"

import logging

from django.contrib.auth.models import AbstractBaseUser
Expand All @@ -12,10 +15,6 @@
from myproject.common.models.base import BaseModel
from ..managers.usermanager import UserManager

__author__ = "Alex Laird"
__copyright__ = "Copyright 2018, Alex Laird"
__version__ = "0.2.0"

logger = logging.getLogger(__name__)


Expand Down
7 changes: 3 additions & 4 deletions myproject/auth/services/authservice.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
Authentication service functions.
"""

__copyright__ = "Copyright (c) 2018 Alex Laird"
__license__ = "MIT"

import logging

from django.conf import settings
Expand All @@ -11,10 +14,6 @@
from myproject.common.utils import emailutils
from myproject.common.utils.viewutils import set_request_status

__author__ = "Alex Laird"
__copyright__ = "Copyright 2018, Alex Laird"
__version__ = "0.2.0"

logger = logging.getLogger(__name__)


Expand Down
7 changes: 3 additions & 4 deletions myproject/auth/tests/helpers/userhelper.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
from django.contrib.auth import get_user_model
__copyright__ = "Copyright (c) 2018 Alex Laird"
__license__ = "MIT"

__author__ = "Alex Laird"
__copyright__ = "Copyright 2018, Alex Laird"
__version__ = "0.2.0"
from django.contrib.auth import get_user_model


def given_a_user_exists(username='test_user', email='[email protected]', password='test_pass_1!'):
Expand Down
7 changes: 3 additions & 4 deletions myproject/auth/tests/testcaseauthviews.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
__copyright__ = "Copyright (c) 2018 Alex Laird"
__license__ = "MIT"

from django.contrib.auth import get_user_model
from django.test import TestCase
from django.urls import reverse

from myproject.auth.tests.helpers import userhelper

__author__ = "Alex Laird"
__copyright__ = "Copyright 2018, Alex Laird"
__version__ = "0.2.0"


class TestCaseAuthViews(TestCase):
def test_settings_view(self):
Expand Down
7 changes: 3 additions & 4 deletions myproject/auth/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@
Authentication URLs.
"""

__copyright__ = "Copyright (c) 2018 Alex Laird"
__license__ = "MIT"

from django.urls import re_path

from myproject.auth.views import login, logout, forgot, settings, register

__author__ = "Alex Laird"
__copyright__ = "Copyright 2018, Alex Laird"
__version__ = "0.6.0"

urlpatterns = [
# Authentication URLs
re_path(r'^register$', register, name='register'),
Expand Down
7 changes: 3 additions & 4 deletions myproject/auth/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
Authentication view entrance functions.
"""

__copyright__ = "Copyright (c) 2018 Alex Laird"
__license__ = "MIT"

import logging

import pytz
Expand All @@ -17,10 +20,6 @@
from myproject.common.utils.viewutils import set_response_status, get_request_status, set_request_status, \
clear_response_status

__author__ = "Alex Laird"
__copyright__ = "Copyright 2018, Alex Laird"
__version__ = "0.2.0"

logger = logging.getLogger(__name__)


Expand Down
7 changes: 3 additions & 4 deletions myproject/common/admin.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
__copyright__ = "Copyright (c) 2018 Alex Laird"
__license__ = "MIT"

from django.conf import settings
from django.contrib.admin import ModelAdmin
from django.contrib.admin.sites import AdminSite

__author__ = "Alex Laird"
__copyright__ = "Copyright 2018, Alex Laird"
__version__ = "0.2.0"


class MyProjectAdminSite(AdminSite):
"""
Expand Down
7 changes: 3 additions & 4 deletions myproject/common/apps.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
__copyright__ = "Copyright (c) 2018 Alex Laird"
__license__ = "MIT"

from urllib.parse import urlparse

from django.apps import AppConfig
from django.conf import settings

__author__ = "Alex Laird"
__copyright__ = "Copyright 2018, Alex Laird"
__version__ = "0.3.4"


class CommonConfig(AppConfig):
name = 'myproject.common'
Expand Down
7 changes: 3 additions & 4 deletions myproject/common/cache/locmemkeys.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
__copyright__ = "Copyright (c) 2018 Alex Laird"
__license__ = "MIT"

import re

from django.core.cache.backends.locmem import LocMemCache

__author__ = "Alex Laird"
__copyright__ = "Copyright 2018, Alex Laird"
__version__ = "0.2.0"


class LocMemKeysCache(LocMemCache):
"""
Expand Down
5 changes: 2 additions & 3 deletions myproject/common/enums.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
__author__ = "Alex Laird"
__copyright__ = "Copyright 2018, Alex Laird"
__version__ = "0.2.0"
__copyright__ = "Copyright (c) 2018 Alex Laird"
__license__ = "MIT"

TIME_ZONE_CHOICES = (
('Africa',
Expand Down
Loading

0 comments on commit db5f4a1

Please sign in to comment.