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

Fix usage of deprecated 'environmentfilter' function from jinja #108

Merged
merged 1 commit into from
Mar 29, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions qface/helper/qtcpp.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
Provides helper functionality specificially for Qt C++/QML code generators
"""
import qface.idl.domain as domain
from jinja2 import environmentfilter
try:
from jinja2 import pass_environment
except ImportError:
from jinja2 import environmentfilter as pass_environment


def upper_first(s):
Expand Down Expand Up @@ -182,7 +185,7 @@ def signalName(s):
return s

@staticmethod
@environmentfilter
@pass_environment
def parameters(env, s, filter=None, spaces=True):
if not filter:
filter = Filters.parameterType
Expand All @@ -203,7 +206,7 @@ def parameters(env, s, filter=None, spaces=True):
return indent.join([filter(a) for a in args])

@staticmethod
@environmentfilter
@pass_environment
def signature(env, s, expand=False, filter=None):
if not filter:
filter = Filters.returnType
Expand Down