From 21ddd6b242303abe779b51b8f068794f215d10d5 Mon Sep 17 00:00:00 2001 From: whiteUnicorn Date: Mon, 12 Sep 2016 14:41:51 +0900 Subject: [PATCH 1/2] Fix all ExtDeprecationWarning Change all flask.ext.cache to flask_cache. --- docs/index.rst | 8 ++++---- examples/hello.py | 2 +- flask_cache/__init__.py | 2 +- flask_cache/jinja2ext.py | 2 +- test_cache.py | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/index.rst b/docs/index.rst index 2ed3a23..3a50324 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -1,7 +1,7 @@ Flask-Cache ================ -.. module:: flask.ext.cache +.. module:: flask_cache Installation ------------ @@ -20,7 +20,7 @@ Set Up Cache is managed through a ``Cache`` instance:: from flask import Flask - from flask.ext.cache import Cache + from flask_cache import Cache app = Flask(__name__) # Check Configuring Flask-Cache section for more details @@ -167,7 +167,7 @@ Set timeout to "del" to delete cached value:: If keys are provided, you may easily generate the template fragment key and delete it from outside of the template context:: - from flask.ext.cache import make_template_fragment_key + from flask_cache import make_template_fragment_key key = make_template_fragment_key("key1", vary_on=["key2", "key3"]) cache.delete(key) @@ -192,7 +192,7 @@ Here's an example script to empty your application's cache: .. code-block:: python - from flask.ext.cache import Cache + from flask_cache import Cache from yourapp import app, your_cache_config diff --git a/examples/hello.py b/examples/hello.py index abb068c..7f7a543 100644 --- a/examples/hello.py +++ b/examples/hello.py @@ -2,7 +2,7 @@ from datetime import datetime from flask import Flask, jsonify -from flask.ext.cache import Cache +from flask_cache import Cache app = Flask(__name__) diff --git a/flask_cache/__init__.py b/flask_cache/__init__.py index 85d90e3..ffe62a5 100644 --- a/flask_cache/__init__.py +++ b/flask_cache/__init__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- """ - flask.ext.cache + flask_cache ~~~~~~~~~~~~~~ Adds cache support to your application. diff --git a/flask_cache/jinja2ext.py b/flask_cache/jinja2ext.py index 73be6ac..6d85fe7 100644 --- a/flask_cache/jinja2ext.py +++ b/flask_cache/jinja2ext.py @@ -30,7 +30,7 @@ from jinja2 import nodes from jinja2.ext import Extension -from flask.ext.cache import make_template_fragment_key +from flask_cache import make_template_fragment_key JINJA_CACHE_ATTR_NAME = '_template_fragment_cache' diff --git a/test_cache.py b/test_cache.py index 9811572..752ffa2 100644 --- a/test_cache.py +++ b/test_cache.py @@ -7,7 +7,7 @@ import string from flask import Flask, render_template, render_template_string -from flask.ext.cache import Cache, function_namespace, make_template_fragment_key +from flask_cache import Cache, function_namespace, make_template_fragment_key if sys.version_info < (2,7): import unittest2 as unittest From 5cbff498e9a0b2ec998c8b109688141111fa0586 Mon Sep 17 00:00:00 2001 From: whiteUnicorn Date: Mon, 12 Sep 2016 15:17:15 +0900 Subject: [PATCH 2/2] Remove all --use-mirrors options --- .travis.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 65ab4ef..4ce41b7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,11 +3,11 @@ python: - "2.7" - "3.3" install: - - pip install . --use-mirrors - - pip install coverage --use-mirrors - - pip install redis --use-mirrors - - "if [[ $TRAVIS_PYTHON_VERSION == 2.7* ]]; then pip install pylibmc --use-mirrors; fi" - - "if [[ $TRAVIS_PYTHON_VERSION == 3.3* ]]; then pip install python3-memcached --use-mirrors; fi" + - pip install . + - pip install coverage + - pip install redis + - "if [[ $TRAVIS_PYTHON_VERSION == 2.7* ]]; then pip install pylibmc; fi" + - "if [[ $TRAVIS_PYTHON_VERSION == 3.3* ]]; then pip install python3-memcached; fi" script: nosetests --with-coverage --cover-package=flask_cache services: - memcached