moved all data access layer code into a new selene.data package

pull/40/head
Chris Veilleux 2019-02-07 13:14:40 -06:00
parent aac78cfdbe
commit 0b28b18b39
46 changed files with 16 additions and 17 deletions

View File

@ -1,6 +1,6 @@
from selene.api import SeleneEndpoint
from selene.device import get_device_by_id
from selene.data.device import get_device_by_id
from selene.util.db import get_db_connection

View File

@ -1,5 +1,5 @@
from selene.api import SeleneEndpoint
from selene.device.repository.setting import get_device_settings
from selene.data.device.repository import get_device_settings
from selene.util.db import get_db_connection

View File

@ -1,5 +1,5 @@
from selene.api import SeleneEndpoint
from selene.skill.repository.skill import get_skill_settings_by_device_id_and_version_hash
from selene.data.skill.repository.skill import get_skill_settings_by_device_id_and_version_hash
from selene.util.db import get_db_connection

View File

@ -1,6 +1,6 @@
from selene.api import SeleneEndpoint
from selene.skill.repository.skill import get_skill_settings_by_device_id
from selene.data.skill.repository.skill import get_skill_settings_by_device_id
from selene.util.db import get_db_connection

View File

@ -1,5 +1,5 @@
from selene.api import SeleneEndpoint
from selene.device.repository.device import get_subscription_type_by_device_id
from selene.data.device.repository import get_subscription_type_by_device_id
from selene.util.db import get_db_connection

View File

@ -8,7 +8,7 @@ authentication, which uses a 3rd party authentication, like Google.
from binascii import a2b_base64
from http import HTTPStatus
from selene.account import Account, AccountRepository, RefreshTokenRepository
from selene.data.account import Account, AccountRepository, RefreshTokenRepository
from selene.api import SeleneEndpoint
from selene.util.auth import AuthenticationError
from selene.util.db import get_db_connection

View File

@ -3,7 +3,7 @@
from http import HTTPStatus
from logging import getLogger
from selene.account import RefreshTokenRepository
from selene.data.account import RefreshTokenRepository
from selene.api import SeleneEndpoint
from selene.util.db import get_db_connection

View File

@ -8,7 +8,7 @@ on our database and build JWTs for access and refresh.
from http import HTTPStatus
from selene.api import SeleneEndpoint
from selene.account import AccountRepository, RefreshTokenRepository
from selene.data.account import AccountRepository, RefreshTokenRepository
from selene.util.auth import AuthenticationError
from selene.util.db import get_db_connection

View File

@ -3,7 +3,7 @@ import os
from behave import fixture, use_fixture
from sso_api.api import sso
from selene.account import AccountRepository
from selene.data.account import AccountRepository
from selene.util.db import get_db_connection

View File

@ -2,7 +2,7 @@ from http import HTTPStatus
from behave import given, then, when
from hamcrest import assert_that, equal_to, has_item, is_not
from selene.account import RefreshTokenRepository
from selene.data.account import RefreshTokenRepository
from selene.api.testing import get_account, validate_token_cookies
from selene.util.auth import AuthenticationTokenGenerator
from selene.util.db import get_db_connection

View File

@ -5,7 +5,7 @@ from http import HTTPStatus
from flask import after_this_request, current_app, request
from flask_restful import Resource
from selene.account import Account, AccountRepository, RefreshTokenRepository
from selene.data.account import Account, AccountRepository, RefreshTokenRepository
from selene.util.auth import (
AuthenticationError,
AuthenticationTokenGenerator,

View File

@ -1,6 +1,6 @@
from hamcrest import assert_that, equal_to, has_item
from selene.account import Account, AccountRepository
from selene.data.account import Account, AccountRepository
from selene.util.db import get_db_connection
ACCESS_TOKEN_COOKIE_KEY = 'seleneAccess'

View File

@ -1,8 +1,8 @@
from dataclasses import dataclass
from datetime import datetime
from selene.device.entity.text_to_speech import TextToSpeech
from selene.device.entity.wake_word import WakeWord
from selene.data.device.entity.text_to_speech import TextToSpeech
from selene.data.device import WakeWord
@dataclass

View File

@ -1,7 +1,7 @@
from os import path
from typing import List
from selene.device.entity.device import Device
from selene.data.device import Device
from selene.util.db import DatabaseQuery, fetch
SQL_DIR = path.join(path.dirname(__file__), 'sql')

View File

@ -0,0 +1 @@

View File

@ -1,2 +0,0 @@
from selene.device.repository.device import get_device_by_id
from selene.device.repository.device import get_devices_by_account_id