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 2376bb3 commit 81c5869
Show file tree
Hide file tree
Showing 10 changed files with 30 additions and 40 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2018 Alex Laird
Copyright (c) 2018-2019 Alex Laird

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
12 changes: 5 additions & 7 deletions devserver.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
__copyright__ = "Copyright (c) 2018-2019 Alex Laird"
__license__ = "MIT"

import json
import os
import sys
Expand All @@ -13,6 +16,8 @@
from pyngrok import ngrok
from twilio.rest import Client

from lambdas.aqi_GET import lambda_function as aqi_route
from lambdas.inbound_POST import lambda_function as inbound_route
from utils.jsonutils import decimal_default

load_dotenv(dotenv_path=".env.dev")
Expand Down Expand Up @@ -44,13 +49,6 @@
}
)

from lambdas.aqi_GET import lambda_function as aqi_route
from lambdas.inbound_POST import lambda_function as inbound_route

__author__ = "Alex Laird"
__copyright__ = "Copyright 2020, Alex Laird"
__version__ = "1.0.0"

LOGGING = {
"version": 1,
"formatters": {
Expand Down
7 changes: 3 additions & 4 deletions lambdas/aqi_GET/lambda_function.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
__copyright__ = "Copyright (c) 2018-2019 Alex Laird"
__license__ = "MIT"

import json
import logging
import os
Expand All @@ -14,10 +17,6 @@
from utils import metricutils
from utils.decoratorutils import conditional_decorator

__author__ = "Alex Laird"
__copyright__ = "Copyright 2020, Alex Laird"
__version__ = "1.0.0"

DYNAMODB_REGION = os.environ.get("DYNAMODB_REGION")
DYNAMODB_ENDPOINT = os.environ.get("DYNAMODB_ENDPOINT")
DYNAMODB_AQI_TABLE = os.environ.get("DYNAMODB_AQI_TABLE")
Expand Down
7 changes: 3 additions & 4 deletions lambdas/inbound_POST/lambda_function.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
__copyright__ = "Copyright (c) 2018-2019 Alex Laird"
__license__ = "MIT"

import logging
import os
import re
Expand All @@ -9,10 +12,6 @@
from utils import metricutils
from utils.decoratorutils import conditional_decorator

__author__ = "Alex Laird"
__copyright__ = "Copyright 2020, Alex Laird"
__version__ = "1.0.0"

AIR_QUALITY_API_URL = os.environ.get("AIR_QUALITY_API_URL").lower()

_AQI_MESSAGES = {
Expand Down
9 changes: 4 additions & 5 deletions tests/test_aqi.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
__copyright__ = "Copyright (c) 2018-2019 Alex Laird"
__license__ = "MIT"

import unittest
from datetime import datetime, timedelta

import responses
from moto import mock_dynamodb

from .testcase import TestCase
from lambdas.aqi_GET import lambda_function

__author__ = "Alex Laird"
__copyright__ = "Copyright 2020, Alex Laird"
__version__ = "1.0.0"
from .testcase import TestCase


class TestCaseAQI(TestCase):
Expand Down
7 changes: 3 additions & 4 deletions tests/test_inbound.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
__copyright__ = "Copyright (c) 2018-2019 Alex Laird"
__license__ = "MIT"

import unittest

import responses
Expand All @@ -6,10 +9,6 @@
from lambdas.inbound_POST import lambda_function
from .testcase import TestCase

__author__ = "Alex Laird"
__copyright__ = "Copyright 2020, Alex Laird"
__version__ = "1.0.0"


class TestCaseInbound(TestCase):
@mock_dynamodb
Expand Down
7 changes: 3 additions & 4 deletions tests/testcase.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
__copyright__ = "Copyright (c) 2018-2019 Alex Laird"
__license__ = "MIT"

import json
import os
import unittest
Expand All @@ -12,10 +15,6 @@
from lambdas.aqi_GET import lambda_function as aqi_route
from utils.jsonutils import decimal_default

__author__ = "Alex Laird"
__copyright__ = "Copyright 2020, Alex Laird"
__version__ = "1.0.0"


class TestCase(unittest.TestCase):
def given_dynamo_table_exists(self):
Expand Down
5 changes: 2 additions & 3 deletions utils/decoratorutils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
__author__ = "Alex Laird"
__copyright__ = "Copyright 2020, Alex Laird"
__version__ = "0.1.5"
__copyright__ = "Copyright (c) 2018-2019 Alex Laird"
__license__ = "MIT"


def conditional_decorator(dec, condition):
Expand Down
7 changes: 3 additions & 4 deletions utils/jsonutils.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import decimal
__copyright__ = "Copyright (c) 2018-2019 Alex Laird"
__license__ = "MIT"

__author__ = "Alex Laird"
__copyright__ = "Copyright 2020, Alex Laird"
__version__ = "0.1.5"
import decimal


def decimal_default(obj):
Expand Down
7 changes: 3 additions & 4 deletions utils/metricutils.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
from datadog import lambda_metric
__copyright__ = "Copyright (c) 2018-2019 Alex Laird"
__license__ = "MIT"

__author__ = "Alex Laird"
__copyright__ = "Copyright 2020, Alex Laird"
__version__ = "0.1.4"
from datadog import lambda_metric


def increment(metric):
Expand Down

0 comments on commit 81c5869

Please sign in to comment.