Skip to content
This repository has been archived by the owner on Jul 13, 2023. It is now read-only.

Commit

Permalink
refactor: autopush.settings -> autopush.config
Browse files Browse the repository at this point in the history
  • Loading branch information
pjenvey committed Jul 31, 2017
1 parent 7ef7d73 commit 4707e57
Show file tree
Hide file tree
Showing 21 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion autopush/base.py
Expand Up @@ -7,9 +7,9 @@
from twisted.python import failure

if TYPE_CHECKING: # pragma: nocover
from autopush.config import AutopushConfig # noqa
from autopush.db import DatabaseManager # noqa
from autopush.metrics import IMetrics # noqa
from autopush.settings import AutopushConfig # noqa


class BaseHandler(cyclone.web.RequestHandler):
Expand Down
2 changes: 1 addition & 1 deletion autopush/settings.py → autopush/config.py
@@ -1,4 +1,4 @@
"""Autopush Settings Object and Setup"""
"""Autopush Config Object and Setup"""
import json
import socket
from argparse import Namespace # noqa
Expand Down
2 changes: 1 addition & 1 deletion autopush/db.py
Expand Up @@ -81,7 +81,7 @@
)

if TYPE_CHECKING: # pragma: nocover
from autopush.settings import AutopushConfig, DDBTableConfig # noqa
from autopush.config import AutopushConfig, DDBTableConfig # noqa


# Typing
Expand Down
2 changes: 1 addition & 1 deletion autopush/diagnostic_cli.py
Expand Up @@ -6,10 +6,10 @@
import configargparse
from twisted.logger import Logger

from autopush.config import AutopushConfig
from autopush.db import DatabaseManager
from autopush.main import AutopushMultiService
from autopush.main_argparse import add_shared_args
from autopush.settings import AutopushConfig


PUSH_RE = re.compile(r"push/(?:(?P<api_ver>v\d+)/)?(?P<token>[^/]+)")
Expand Down
2 changes: 1 addition & 1 deletion autopush/http.py
Expand Up @@ -18,10 +18,10 @@
)

from autopush.base import BaseHandler
from autopush.config import AutopushConfig # noqa
from autopush.db import DatabaseManager
from autopush.router import routers_from_settings
from autopush.router.interface import IRouter # noqa
from autopush.settings import AutopushConfig # noqa
from autopush.ssl import AutopushSSLContextFactory # noqa
from autopush.web.health import (
HealthHandler,
Expand Down
4 changes: 2 additions & 2 deletions autopush/main.py
Expand Up @@ -28,13 +28,13 @@
)
import autopush.utils as utils
import autopush.logging as logging
from autopush.exceptions import InvalidSettings
from autopush.config import AutopushConfig
from autopush.db import DatabaseManager
from autopush.exceptions import InvalidSettings
from autopush.haproxy import HAProxyServerEndpoint
from autopush.logging import PushLogger
from autopush.main_argparse import parse_connection, parse_endpoint
from autopush.router import routers_from_settings
from autopush.settings import AutopushConfig
from autopush.websocket import (
ConnectionWSSite,
PushServerFactory,
Expand Down
2 changes: 1 addition & 1 deletion autopush/metrics.py
Expand Up @@ -11,7 +11,7 @@
from autopush.utils import get_ec2_instance_id

if TYPE_CHECKING: # pragma: nocover
from autopush.settings import AutopushConfig # noqa
from autopush.config import AutopushConfig # noqa


class IMetrics(object):
Expand Down
2 changes: 1 addition & 1 deletion autopush/router/__init__.py
Expand Up @@ -8,14 +8,14 @@

from twisted.web.client import Agent # noqa

from autopush.config import AutopushConfig # noqa
from autopush.db import DatabaseManager # noqa
from autopush.router.apnsrouter import APNSRouter
from autopush.router.gcm import GCMRouter
from autopush.router.interface import IRouter # noqa
from autopush.router.simple import SimpleRouter
from autopush.router.webpush import WebPushRouter
from autopush.router.fcm import FCMRouter
from autopush.settings import AutopushConfig # noqa

__all__ = ["APNSRouter", "FCMRouter", "GCMRouter", "WebPushRouter",
"SimpleRouter"]
Expand Down
2 changes: 1 addition & 1 deletion autopush/router/apnsrouter.py
Expand Up @@ -53,7 +53,7 @@ def __init__(self, ap_settings, router_conf, metrics,
"""Create a new APNS router and connect to APNS
:param ap_settings: Configuration settings
:type ap_settings: autopush.settings.AutopushConfig
:type ap_settings: autopush.config.AutopushConfig
:param router_conf: Router specific configuration
:type router_conf: dict
:param load_connections: (used for testing)
Expand Down
2 changes: 1 addition & 1 deletion autopush/tests/support.py
Expand Up @@ -2,13 +2,13 @@
from twisted.logger import ILogObserver
from zope.interface import implementer

from autopush.config import DDBTableConfig
from autopush.db import (
DatabaseManager,
Router,
Storage
)
from autopush.metrics import SinkMetrics
from autopush.settings import DDBTableConfig


@implementer(ILogObserver)
Expand Down
2 changes: 1 addition & 1 deletion autopush/tests/test_endpoint.py
Expand Up @@ -10,6 +10,7 @@


import autopush.utils as utils
from autopush.config import AutopushConfig
from autopush.db import (
ProvisionedThroughputExceededException,
Message,
Expand All @@ -21,7 +22,6 @@
from autopush.metrics import SinkMetrics
from autopush.router import routers_from_settings
from autopush.router.interface import IRouter
from autopush.settings import AutopushConfig
from autopush.tests.client import Client
from autopush.tests.test_db import make_webpush_notification
from autopush.tests.support import test_db
Expand Down
2 changes: 1 addition & 1 deletion autopush/tests/test_health.py
Expand Up @@ -9,11 +9,11 @@
from twisted.trial import unittest

from autopush import __version__
from autopush.config import AutopushConfig
from autopush.db import DatabaseManager
from autopush.exceptions import MissingTableException
from autopush.http import EndpointHTTPFactory
from autopush.logging import begin_or_register
from autopush.settings import AutopushConfig
from autopush.tests.client import Client
from autopush.tests.support import TestingLogObserver
from autopush.web.health import HealthHandler, StatusHandler
Expand Down
2 changes: 1 addition & 1 deletion autopush/tests/test_integration.py
Expand Up @@ -34,13 +34,13 @@

import autopush.db as db
from autopush import __version__
from autopush.config import AutopushConfig
from autopush.db import (
get_month,
has_connected_this_month
)
from autopush.logging import begin_or_register
from autopush.main import ConnectionApplication, EndpointApplication
from autopush.settings import AutopushConfig
from autopush.utils import base64url_encode
from autopush.metrics import SinkMetrics, DatadogMetrics
from autopush.tests.support import TestingLogObserver
Expand Down
2 changes: 1 addition & 1 deletion autopush/tests/test_log_check.py
Expand Up @@ -6,9 +6,9 @@
from twisted.logger import globalLogPublisher
from twisted.trial import unittest

from autopush.config import AutopushConfig
from autopush.http import EndpointHTTPFactory
from autopush.logging import begin_or_register
from autopush.settings import AutopushConfig
from autopush.tests.client import Client
from autopush.tests.support import TestingLogObserver
from autopush.web.log_check import LogCheckHandler
Expand Down
2 changes: 1 addition & 1 deletion autopush/tests/test_main.py
Expand Up @@ -14,14 +14,14 @@
import hyper.tls

import autopush.db
from autopush.config import AutopushConfig
from autopush.db import DatabaseManager, get_rotating_message_table
from autopush.exceptions import InvalidSettings
from autopush.http import skip_request_logging
from autopush.main import (
ConnectionApplication,
EndpointApplication,
)
from autopush.settings import AutopushConfig
from autopush.tests.support import test_db
from autopush.utils import resolve_ip

Expand Down
2 changes: 1 addition & 1 deletion autopush/tests/test_router.py
Expand Up @@ -19,6 +19,7 @@
import pyfcm
from hyper.http20.exceptions import HTTP20Error

from autopush.config import AutopushConfig
from autopush.db import (
Message,
ProvisionedThroughputExceededException,
Expand All @@ -34,7 +35,6 @@
FCMRouter,
)
from autopush.router.interface import RouterResponse, IRouter
from autopush.settings import AutopushConfig
from autopush.tests import MockAssist
from autopush.tests.support import test_db
from autopush.web.base import Notification
Expand Down
2 changes: 1 addition & 1 deletion autopush/tests/test_web_base.py
Expand Up @@ -9,10 +9,10 @@
from twisted.python.failure import Failure
from twisted.trial import unittest

from autopush.config import AutopushConfig
from autopush.db import ProvisionedThroughputExceededException
from autopush.http import EndpointHTTPFactory
from autopush.exceptions import InvalidRequest
from autopush.settings import AutopushConfig
from autopush.metrics import SinkMetrics
from autopush.tests.support import test_db

Expand Down
2 changes: 1 addition & 1 deletion autopush/tests/test_web_validation.py
Expand Up @@ -773,8 +773,8 @@ def test_old_current_month(self):

class TestWebPushRequestSchemaUsingVapid(unittest.TestCase):
def _make_fut(self):
from autopush.config import AutopushConfig
from autopush.web.webpush import WebPushRequestSchema
from autopush.settings import AutopushConfig
settings = AutopushConfig(
hostname="localhost",
statsd_host=None,
Expand Down
2 changes: 1 addition & 1 deletion autopush/tests/test_web_webpush.py
Expand Up @@ -7,10 +7,10 @@
from twisted.internet.defer import inlineCallbacks
from twisted.trial import unittest

from autopush.config import AutopushConfig
from autopush.db import Message
from autopush.http import EndpointHTTPFactory
from autopush.router.interface import IRouter, RouterResponse
from autopush.settings import AutopushConfig
from autopush.tests.client import Client
from autopush.tests.support import test_db

Expand Down
2 changes: 1 addition & 1 deletion autopush/tests/test_websocket.py
Expand Up @@ -26,10 +26,10 @@
from twisted.web.client import Agent

import autopush.db as db
from autopush.config import AutopushConfig
from autopush.db import DatabaseManager
from autopush.http import InternalRouterHTTPFactory
from autopush.metrics import SinkMetrics
from autopush.settings import AutopushConfig
from autopush.tests import MockAssist
from autopush.utils import WebPushNotification
from autopush.tests.client import Client
Expand Down
2 changes: 1 addition & 1 deletion autopush/websocket.py
Expand Up @@ -84,6 +84,7 @@

from autopush import __version__
from autopush.base import BaseHandler
from autopush.config import AutopushConfig # noqa
from autopush.db import (
has_connected_this_month,
hasher,
Expand All @@ -95,7 +96,6 @@
from autopush.noseplugin import track_object
from autopush.protocol import IgnoreBody
from autopush.metrics import IMetrics, make_tags # noqa
from autopush.settings import AutopushConfig # noqa
from autopush.ssl import AutopushSSLContextFactory # noqa
from autopush.types import JSONDict # noqa
from autopush.utils import (
Expand Down

0 comments on commit 4707e57

Please sign in to comment.