diff --git a/.gitignore b/.gitignore index a458256..e336df6 100644 --- a/.gitignore +++ b/.gitignore @@ -39,4 +39,5 @@ nosetests.xml virtualenv venv -.idea \ No newline at end of file +.idea +Dockerfile \ No newline at end of file diff --git a/examples/custom/blog.py b/examples/custom/blog.py index f32436c..c71b8ac 100644 --- a/examples/custom/blog.py +++ b/examples/custom/blog.py @@ -2,7 +2,7 @@ from json import dumps from flask import Flask, redirect, request -from flask.ext.autodoc import Autodoc +from flask_autodoc import Autodoc app = Flask(__name__) diff --git a/examples/factory/blog/doc.py b/examples/factory/blog/doc.py index 17307a6..15231ea 100644 --- a/examples/factory/blog/doc.py +++ b/examples/factory/blog/doc.py @@ -1,5 +1,5 @@ from flask import Blueprint -from flask.ext.autodoc import Autodoc +from flask_autodoc import Autodoc doc = Blueprint('doc', __name__, url_prefix='/doc') diff --git a/examples/simple/blog.py b/examples/simple/blog.py index 52ca75c..548bb8b 100644 --- a/examples/simple/blog.py +++ b/examples/simple/blog.py @@ -1,7 +1,7 @@ from json import dumps from flask import Flask, redirect, request -from flask.ext.autodoc import Autodoc +from flask_autodoc import Autodoc app = Flask(__name__) diff --git a/flask_autodoc/__init__.py b/flask_autodoc/__init__.py index 89e047e..0538e25 100644 --- a/flask_autodoc/__init__.py +++ b/flask_autodoc/__init__.py @@ -1,3 +1,3 @@ __author__ = 'arnaud' -from flask.ext.autodoc.autodoc import Autodoc +from flask_autodoc.autodoc import Autodoc diff --git a/flask_autodoc/autodoc.py b/flask_autodoc/autodoc.py index bb8f23b..78a61c5 100644 --- a/flask_autodoc/autodoc.py +++ b/flask_autodoc/autodoc.py @@ -6,7 +6,7 @@ import inspect from flask import current_app, render_template, render_template_string -from jinja2 import evalcontextfilter +from jinja2 import pass_eval_context try: @@ -55,7 +55,7 @@ def add_custom_nl2br_filters(self, app): _paragraph_re = re.compile(r'(?:\r\n|\r|\n){3,}') @app.template_filter() - @evalcontextfilter + @pass_eval_context def nl2br(eval_ctx, value): result = '\n\n'.join('%s' % p.replace('\n', '
\n') for p in _paragraph_re.split(value)) diff --git a/setup.py b/setup.py index 066e351..b874be1 100644 --- a/setup.py +++ b/setup.py @@ -14,7 +14,7 @@ def readme(): setup( name='Flask-Autodoc', - version='0.1.2', + version='0.2.0', url='http://github.com/acoomans/flask-autodoc', license='MIT', author='Arnaud Coomans', diff --git a/tests/test_autodoc.py b/tests/test_autodoc.py index e839c2f..9c6f650 100644 --- a/tests/test_autodoc.py +++ b/tests/test_autodoc.py @@ -5,7 +5,7 @@ import os from flask import Flask -from flask.ext.autodoc import Autodoc +from flask_autodoc import Autodoc class TestAutodoc(unittest.TestCase): @@ -259,7 +259,7 @@ def ab(param1, param2): self.assertIn('Returns arguments', doc) def testLocation(self): - line_no = inspect.stack()[0][2] + 2 # the doc() line + line_no = inspect.stack()[0][2] + 3 # the doc() line @self.app.route('/location') @self.autodoc.doc() def location():