From 133050a21927c862c64ef267908a2f936cff4fd2 Mon Sep 17 00:00:00 2001 From: androiddrew Date: Tue, 17 Oct 2017 10:51:42 -0400 Subject: [PATCH] Added MIT License --- LICENSE | 9 +++++++++ apistar_redis/__init__.py | 2 +- apistar_redis/redis_backend.py | 16 ++++++---------- setup.py | 7 +++---- 4 files changed, 19 insertions(+), 15 deletions(-) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..8a3d2dd --- /dev/null +++ b/LICENSE @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) 2017, Andrew Bednar + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/apistar_redis/__init__.py b/apistar_redis/__init__.py index 27f67ad..6320b18 100644 --- a/apistar_redis/__init__.py +++ b/apistar_redis/__init__.py @@ -2,4 +2,4 @@ __author__ = """Drew Bednar""" __email__ = 'drew@androiddrew.com' -__version__ = '0.1.0' \ No newline at end of file +__version__ = '0.1.1' diff --git a/apistar_redis/redis_backend.py b/apistar_redis/redis_backend.py index e5dc844..99966cd 100644 --- a/apistar_redis/redis_backend.py +++ b/apistar_redis/redis_backend.py @@ -1,4 +1,4 @@ -import redis +from redis import StrictRedis as Client from apistar import Component, Settings @@ -19,21 +19,17 @@ class RedisBackend: self.password = redis_config.get('PASSWORD') # TODO add connection pooling - - -class Client: - def __init__(self, backend: RedisBackend): - self.backend = backend + # TODO serialization of strings in the connector settings def get_redis_client(backend: RedisBackend): """ - Create a new redis session + Create a new redis client session """ - client = redis.Redis(host=backend.host, - port=backend.port, - password=backend.password) + client = Client(host=backend.host, + port=backend.port, + password=backend.password) return client diff --git a/setup.py b/setup.py index 75c1aba..5804ada 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,5 @@ from setuptools import setup, find_packages - with open('README.md') as readme_file: readme = readme_file.read() @@ -23,7 +22,7 @@ test_requirements = [ setup( name='apistar_redis', - version='0.1.0', + version='0.1.1', description="A Redis backend Component for Apistar", long_description=readme + '\n\n' + history, author="Drew Bednar", @@ -36,7 +35,7 @@ setup( zip_safe=False, keywords='apistar_redis', classifiers=[ - 'Development Status :: 2 - Pre-Alpha', + 'Development Status :: 1 - Pre-Alpha', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Natural Language :: English', @@ -47,4 +46,4 @@ setup( test_suite='tests', tests_require=test_requirements, setup_requires=setup_requirements, -) \ No newline at end of file +)