Navigation Menu

Skip to content

Commit

Permalink
Rename from Flask-Cache to Flask-Caching
Browse files Browse the repository at this point in the history
  • Loading branch information
sh4nks committed Jul 4, 2016
1 parent 3dc0b3e commit 093b50e
Show file tree
Hide file tree
Showing 13 changed files with 78 additions and 33 deletions.
4 changes: 3 additions & 1 deletion CHANGES
Expand Up @@ -10,7 +10,9 @@ Version 1.0.0 TBA
`Flask's documentation <http://flask.pocoo.org/docs/0.11/extensions/#flask-before-0-8>`_
for more information regarding this matter. This also fixes the
deprecation warning from Flask.
- Lots of PEP8 and Documentation fixes
- Lots of PEP8 and Documentation fixes.
- Renamed this fork Flask-Caching (``flask_caching``) as it will now be
available on PyPI for download.

In addition to the above mentioned fixes, following pull requests have been
merged into this fork of `Flask-Cache <https://github.com/thadeusb/flask-cache>`_:
Expand Down
1 change: 1 addition & 0 deletions CONTRIBUTORS
Expand Up @@ -7,3 +7,4 @@ dahlia (Hong Minhee)
jab (Joshua Bronson)
kennethreitz (Kenneth Reitz)
Thomas Waldmann
sh4nks (Peter Justin)
1 change: 1 addition & 0 deletions LICENSE
@@ -1,4 +1,5 @@
Copyright (c) 2010 by Thadeus Burgess.
Copyright (c) 2016 by Peter Justin.

Some rights reserved.

Expand Down
46 changes: 44 additions & 2 deletions README.md
@@ -1,8 +1,15 @@
# Flask-Cache
Flask-Caching
=============

[![Build Status](https://travis-ci.org/sh4nks/flask-caching.svg?branch=master)](https://travis-ci.org/sh4nks/flask-caching)
[![Coverage Status](https://coveralls.io/repos/sh4nks/flask-caching/badge.png)](https://coveralls.io/r/sh4nks/flask-caching)
[![PyPI Version](https://img.shields.io/pypi/v/Flask-Caching.svg)](https://pypi.python.org/pypi/Flask-Caching)
[![License](https://img.shields.io/badge/license-BSD-yellow.svg)](https://github.com/sh4nks/flask-caching)

Adds easy cache support to Flask.

Following PRs have been merged into this fork:
This is a fork of the [Flask-Cache](https://github.com/thadeusb/flask-cache)
extension and the following pull requests have been merged into this fork:

- [#90 Update documentation: route decorator before cache](https://github.com/thadeusb/flask-cache/pull/90)
- [#95 Pass the memoize parameters into unless().](https://github.com/thadeusb/flask-cache/pull/95)
Expand All @@ -16,3 +23,38 @@ Following PRs have been merged into this fork:
- [#127 Improve doc for using @cached on view](https://github.com/thadeusb/flask-cache/pull/127)
- [#128 Doc for delete_memoized](https://github.com/thadeusb/flask-cache/pull/128)
- [#129 tries replacing inspect.getargspec with either signature or getfullargspec if possible](https://github.com/thadeusb/flask-cache/pull/129)

For the complete changelog, have a look at the ``CHANGES`` file.


Setup
-----

The Cache Extension can either be initialized directly:

```python
from flask import Flask
from flask_caching import Cache

app = Flask(__name__)
# For more configuration options, check out the documentation
cache = Cache(app, config={'CACHE_TYPE': 'simple'})
```

Or through the factory method:

```python
cache = Cache(config={'CACHE_TYPE': 'simple'})

app = Flask(__name__)
cache.init_app(app)
```


Links
=====

* [Documentation](https://pythonhosted.org/Flask-Caching/)
* [Source Code](https://github.com/sh4nks/flask-caching)
* [Issues](https://github.com/sh4nks/flask-caching/issues)
* [Original Flask-Cache Extension](https://github.com/thadeusb/flask-cache)
4 changes: 2 additions & 2 deletions docs/conf.py
Expand Up @@ -19,7 +19,7 @@
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
sys.path.append(os.path.abspath('_themes'))

from flask_cache import __version__, __versionfull__
from flask_caching import __version__

# -- General configuration -----------------------------------------------------

Expand Down Expand Up @@ -53,7 +53,7 @@
# The short X.Y version.
version = __version__
# The full version, including alpha/beta/rc tags.
release = __versionfull__
release = __version__

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
8 changes: 4 additions & 4 deletions docs/index.rst
@@ -1,26 +1,26 @@
Flask-Cache
===========

.. module:: flask_cache
.. module:: flask_caching

Installation
------------

Install the extension with one of the following commands::

$ easy_install Flask-Cache
$ easy_install Flask-Caching

or alternatively if you have pip installed::

$ pip install Flask-Cache
$ pip install Flask-Caching

Set Up
------

Cache is managed through a ``Cache`` instance::

from flask import Flask
from flask_cache import Cache
from flask_caching import Cache

app = Flask(__name__)
# Check Configuring Flask-Cache section for more details
Expand Down
2 changes: 1 addition & 1 deletion examples/hello.py
Expand Up @@ -2,7 +2,7 @@
from datetime import datetime

from flask import Flask, jsonify
from flask_cache import Cache
from flask_caching import Cache


app = Flask(__name__)
Expand Down
9 changes: 4 additions & 5 deletions flask_cache/__init__.py → flask_caching/__init__.py
@@ -1,12 +1,12 @@
# -*- coding: utf-8 -*-
"""
flask_cache
~~~~~~~~~~~
flask_caching
~~~~~~~~~~~~~
Adds cache support to your application.
:copyright: (c) 2010 by Thadeus Burgess.
:license: BSD, see LICENSE for more details
:license: BSD, see LICENSE for more details.
"""
import base64
import functools
Expand All @@ -22,8 +22,7 @@

from ._compat import PY2

__version__ = '0.13'
__versionfull__ = __version__
__version__ = '1.0.0'

logger = logging.getLogger(__name__)

Expand Down
4 changes: 2 additions & 2 deletions flask_cache/_compat.py → flask_caching/_compat.py
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
"""
flask_cache._compat
~~~~~~~~~~~~~~~~~~~
flask_caching._compat
~~~~~~~~~~~~~~~~~~~~~
Some py2/py3 compatibility support based on a stripped down
version of six so we don't have to depend on a specific version
Expand Down
6 changes: 3 additions & 3 deletions flask_cache/backends.py → flask_caching/backends.py
@@ -1,12 +1,12 @@
# -*- coding: utf-8 -*-
"""
flask_cache.backends
~~~~~~~~~~~~~~~~~~~~
flask_caching.backends
~~~~~~~~~~~~~~~~~~~~~~
Various caching backends.
:copyright: (c) 2010 by Thadeus Burgess.
:license: BSD, see LICENSE for more details
:license: BSD, see LICENSE for more details.
"""
import pickle
from werkzeug.contrib.cache import (BaseCache, NullCache, SimpleCache,
Expand Down
8 changes: 4 additions & 4 deletions flask_cache/jinja2ext.py → flask_caching/jinja2ext.py
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
"""
flask_cache.jinja2ext
~~~~~~~~~~~~~~~~~~~~~
flask_caching.jinja2ext
~~~~~~~~~~~~~~~~~~~~~~~
Jinja2 extension that adds support for caching template fragments.
Expand Down Expand Up @@ -32,11 +32,11 @@
{% endcache %}
:copyright: (c) 2010 by Thadeus Burgess.
:license: BSD, see LICENSE for more details
:license: BSD, see LICENSE for more details.
"""
from jinja2 import nodes
from jinja2.ext import Extension
from flask_cache import make_template_fragment_key
from flask_caching import make_template_fragment_key

JINJA_CACHE_ATTR_NAME = '_template_fragment_cache'

Expand Down
16 changes: 8 additions & 8 deletions setup.py
@@ -1,7 +1,7 @@
#!/usr/bin/env python
"""
Flask-Cache
-----------
Flask-Caching
-------------
Adds cache support to your Flask application
Expand All @@ -10,16 +10,16 @@
from setuptools import setup

setup(
name='Flask-Cache',
name='Flask-Caching',
version='0.13',
url='http://github.com/thadeusb/flask-cache',
url='https://github.com/sh4nks/flask-caching',
license='BSD',
author='Thadeus Burgess',
author_email='thadeusb@thadeusb.com',
description='Adds cache support to your Flask application',
author='Peter Justin',
author_email='Peter Justin',
description='Adds caching support to your Flask application',
long_description=__doc__,
packages=[
'flask_cache',
'flask_caching',
],
zip_safe=False,
platforms='any',
Expand Down
2 changes: 1 addition & 1 deletion test_cache.py
Expand Up @@ -8,7 +8,7 @@
import string

from flask import Flask, render_template, render_template_string
from flask_cache import Cache, function_namespace, make_template_fragment_key
from flask_caching import Cache, function_namespace, make_template_fragment_key

if sys.version_info < (2, 7):
import unittest2 as unittest
Expand Down

0 comments on commit 093b50e

Please sign in to comment.