From 1ff624aaf720f6e953c8475ad56a7a59f47ea956 Mon Sep 17 00:00:00 2001 From: Mike Crute Date: Sat, 7 Oct 2017 01:06:00 +0000 Subject: Import directly from modules Importing from the base of a module is deprecated and will be removed in a future major version. Nothing internally should be doing this. --- pandora/clientbuilder.py | 3 ++- pandora/models/pandora.py | 4 ++-- tests/test_pandora/test_clientbuilder.py | 3 ++- tests/test_pandora/test_models.py | 7 +++++-- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/pandora/clientbuilder.py b/pandora/clientbuilder.py index 6c29678..53abdf4 100644 --- a/pandora/clientbuilder.py +++ b/pandora/clientbuilder.py @@ -7,7 +7,8 @@ configuration formats into a fully built APIClient. import os.path from .py2compat import ConfigParser -from . import Encryptor, APITransport, DEFAULT_API_HOST, APIClient +from .client import APIClient +from .transport import Encryptor, APITransport, DEFAULT_API_HOST class TranslatingDict(dict): diff --git a/pandora/models/pandora.py b/pandora/models/pandora.py index 3ffac7d..c041b40 100644 --- a/pandora/models/pandora.py +++ b/pandora/models/pandora.py @@ -1,6 +1,6 @@ -from .. import BaseAPIClient -from . import Field, PandoraModel, PandoraListModel, PandoraDictListModel +from ..client import BaseAPIClient from ..errors import ParameterMissing +from . import Field, PandoraModel, PandoraListModel, PandoraDictListModel class Station(PandoraModel): diff --git a/tests/test_pandora/test_clientbuilder.py b/tests/test_pandora/test_clientbuilder.py index 5ac6e7d..aaccdf8 100644 --- a/tests/test_pandora/test_clientbuilder.py +++ b/tests/test_pandora/test_clientbuilder.py @@ -3,7 +3,8 @@ from unittest import TestCase import pandora.clientbuilder as cb from pandora.py2compat import Mock -from pandora import APIClient, DEFAULT_API_HOST +from pandora.client import APIClient +from pandora.transport import DEFAULT_API_HOST class TestTranslatingDict(TestCase): diff --git a/tests/test_pandora/test_models.py b/tests/test_pandora/test_models.py index 37a760f..2ae7d11 100644 --- a/tests/test_pandora/test_models.py +++ b/tests/test_pandora/test_models.py @@ -1,12 +1,15 @@ from unittest import TestCase from datetime import datetime from pandora.py2compat import Mock, patch -from pandora import APIClient -from pandora.models.pandora import AdItem, PlaylistModel, SearchResultItem, SearchResult + +from pandora.client import APIClient from pandora.errors import ParameterMissing +from pandora.models.pandora import SearchResult +from pandora.models.pandora import AdItem, PlaylistModel, SearchResultItem import pandora.models as m + class TestField(TestCase): def test_defaults(self): -- cgit v1.2.3