Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4d9eab6

Browse files
committed
Reduce max_line_length from 120 to 80
1 parent 2a98042 commit 4d9eab6

File tree

4 files changed

+45
-28
lines changed

4 files changed

+45
-28
lines changed

.coafile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ bears =
99
GitCommitBear,
1010

1111
use_spaces = True
12-
max_line_length = 120
12+
max_line_length = 80
1313
max_lines_per_file = 1000
1414

1515
ci_keywords = FIXME, pdb.set_trace()

HISTORY.rst

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,21 @@ History
44
0.3.0 (2016-07-18)
55
------------------
66

7-
- **Backwards incompatible:** The ``FlaskRedis.init_app`` method no longer takes a ``strict`` parameter. Pass this flag
8-
when creating your ``FlaskRedis`` instance, instead.
9-
- **Backwards incompatible:** The extension will now be registered under the (lowercased) config prefix of the instance.
10-
The default config prefix is ``'REDIS'``, so unless you change that, you can still access the extension via
7+
- **Backwards incompatible:** The ``FlaskRedis.init_app`` method no longer takes
8+
a ``strict`` parameter. Pass this flag when creating your ``FlaskRedis``
9+
instance, instead.
10+
- **Backwards incompatible:** The extension will now be registered under the
11+
(lowercased) config prefix of the instance. The default config prefix is
12+
``'REDIS'``, so unless you change that, you can still access the extension via
1113
``app.extensions['redis']`` as before.
12-
- **Backwards incompatible:** The default class has been changed to ``redis.StrictRedis``. You can switch back to the
13-
old ``redis.Redis`` class by specifying ``strict=False`` in the ``FlaskRedis`` kwargs.
14-
- You can now pass all supported ``Redis`` keyword arguments (such as ``decode_responses``) to ``FlaskRedis`` and they
15-
will be correctly passed over to the ``redis-py`` instance. Thanks, @giyyapan!
16-
- Usage like ``redis_store['key'] = value``, ``redis_store['key']``, and ``del redis_store['key']`` is now supported.
17-
Thanks, @ariscn!
14+
- **Backwards incompatible:** The default class has been changed to
15+
``redis.StrictRedis``. You can switch back to the old ``redis.Redis`` class by
16+
specifying ``strict=False`` in the ``FlaskRedis`` kwargs.
17+
- You can now pass all supported ``Redis`` keyword arguments (such as
18+
``decode_responses``) to ``FlaskRedis`` and they will be correctly passed over
19+
to the ``redis-py`` instance. Thanks, @giyyapan!
20+
- Usage like ``redis_store['key'] = value``, ``redis_store['key']``, and
21+
``del redis_store['key']`` is now supported. Thanks, @ariscn!
1822

1923
0.2.0 (4/15/2015)
2024
-----------------

README.rst

Lines changed: 26 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ Flask-Redis
99
:target: https://coveralls.io/github/underyx/flask-redis
1010
:alt: Test Coverage
1111

12-
.. image:: https://landscape.io/github/underyx/flask-redis/master/landscape.svg?style=flat
12+
.. image:: https://landscape.io/github/underyx/flask-redis/master/landscape.svg
13+
?style=flat
1314
:target: https://landscape.io/github/underyx/flask-redis
1415
:alt: Code Health
1516

@@ -45,7 +46,8 @@ Or if you *must* use easy_install:
4546
Configuration
4647
-------------
4748

48-
Your configuration should be declared within your Flask config. Set the URL of your database like this:
49+
Your configuration should be declared within your Flask config. Set the URL of
50+
your database like this:
4951

5052
.. code-block:: python
5153
@@ -78,7 +80,8 @@ or
7880
redis_store.init_app(app)
7981
return app
8082
81-
or perhaps you want to use the old, plain ``Redis`` class instead of ``StrictRedis``
83+
or perhaps you want to use the old, plain ``Redis`` class instead of
84+
``StrictRedis``
8285

8386
.. code-block:: python
8487
@@ -91,8 +94,9 @@ or perhaps you want to use the old, plain ``Redis`` class instead of ``StrictRed
9194
9295
or maybe you want to use
9396
`mockredis <https://github.com/locationlabs/mockredis>`_ to make your unit
94-
tests simpler. As of ``mockredis`` 2.9.0.10, it does not have the ``from_url()``
95-
classmethod that ``FlaskRedis`` depends on, so we wrap it and add our own.
97+
tests simpler. As of ``mockredis`` 2.9.0.10, it does not have the
98+
``from_url()`` classmethod that ``FlaskRedis`` depends on, so we wrap it and add
99+
our own.
96100

97101
.. code-block:: python
98102
@@ -121,7 +125,8 @@ classmethod that ``FlaskRedis`` depends on, so we wrap it and add our own.
121125
Usage
122126
-----
123127

124-
``FlaskRedis`` proxies attribute access to an underlying Redis connection. So treat it as if it were a regular ``Redis``
128+
``FlaskRedis`` proxies attribute access to an underlying Redis connection. So
129+
treat it as if it were a regular ``Redis``
125130
instance.
126131

127132
.. code-block:: python
@@ -132,21 +137,27 @@ instance.
132137
def index():
133138
return redis_store.get('potato', 'Not Set')
134139
135-
**Protip:** The redis-py_ package currently holds the 'redis' namespace, so if you are looking to make use of it, your
136-
Redis object shouldn't be named 'redis'.
140+
**Protip:** The redis-py_ package currently holds the 'redis' namespace, so if
141+
you are looking to make use of it, your Redis object shouldn't be named 'redis'.
137142

138-
For detailed instructions regarding the usage of the client, check the redis-py_ documentation.
143+
For detailed instructions regarding the usage of the client, check the redis-py_
144+
documentation.
139145

140-
Advanced features, such as Lua scripting, pipelines and callbacks are detailed within the projects README.
146+
Advanced features, such as Lua scripting, pipelines and callbacks are detailed
147+
within the projects README.
141148

142149
Contribute
143150
----------
144151

145-
#. Check for open issues or open a fresh issue to start a discussion around a feature idea or a bug. There is a
146-
Contributor Friendly tag for issues that should be ideal for people who are not very familiar with the codebase yet.
147-
#. Fork `the repository`_ on Github to start making your changes to the **master** branch (or branch off of it).
148-
#. Write a test which shows that the bug was fixed or that the feature works as expected.
149-
#. Send a pull request and bug the maintainer until it gets merged and published.
152+
#. Check for open issues or open a fresh issue to start a discussion around a
153+
feature idea or a bug. There is a Contributor Friendly tag for issues that
154+
should be ideal for people who are not very familiar with the codebase yet.
155+
#. Fork `the repository`_ on Github to start making your changes to the
156+
**master** branch (or branch off of it).
157+
#. Write a test which shows that the bug was fixed or that the feature works as
158+
expected.
159+
#. Send a pull request and bug the maintainer until it gets merged and
160+
published.
150161

151162
.. _`the repository`: https://github.com/underyx/flask-redis
152163
.. _redis-py: https://github.com/andymccurdy/redis-py

flask_redis/__init__.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def __init__(self, app=None, strict=True, config_prefix='REDIS', **kwargs):
2121

2222
@classmethod
2323
def from_custom_provider(cls, provider, app=None, **kwargs):
24-
assert provider is not None, 'your custom provider cannot be None, come on'
24+
assert provider is not None, 'your custom provider is None, come on'
2525

2626
# We never pass the app parameter here, so we can call init_app
2727
# ourselves later, after the provider class has been set
@@ -38,7 +38,9 @@ def init_app(self, app, **kwargs):
3838
)
3939

4040
self.provider_kwargs.update(kwargs)
41-
self._redis_client = self.provider_class.from_url(redis_url, **self.provider_kwargs)
41+
self._redis_client = self.provider_class.from_url(
42+
redis_url, **self.provider_kwargs
43+
)
4244

4345
if not hasattr(app, 'extensions'):
4446
app.extensions = {}

0 commit comments

Comments
 (0)