Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python3 compatibility problem #8

Open
trickidicki opened this issue Nov 21, 2018 · 0 comments
Open

Python3 compatibility problem #8

trickidicki opened this issue Nov 21, 2018 · 0 comments

Comments

@trickidicki
Copy link

config.py is incompatible with Python3. Suggested fix:

import six
...

def _inject_filters(app, filters):
    """Inject a set of filters into a Flask app.

    Args:
        app (object): The Flask application.
        filters (dict): A dictionary of name and functions.

    Returns:
        app (object): The Flask application.
    """
    for name, func in six.iteritems(filters):
        app.jinja_env.filters[name] = func
    return app

...
def _inject_template_globals(app, funcs):
    """Inject a set of functions into a Flask app as template_globals.

    Args:
        app (object): The Flask application.
        funcs (dict): A dictionary of name and functions.

    Returns:
        app (object): The Flask application.
    """
    for name, func in six.iteritems(funcs):
        app.add_template_global(name, func)
    return app

Cheers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant