Roundup Tracker - Issues

Issue 2550890

classification
debug filter for Jinja2
Type: behavior Severity: normal
Components: Infrastructure Versions: devel
process
Status: closed out of date
:
: rouilj : antmail, ber, rouilj, techtonik
Priority: : jinja2, patch

Created on 2015-06-22 13:30 by antmail, last changed 2019-10-25 15:13 by rouilj.

Files
File name Uploaded Description Edit Remove
debugfilter.patch antmail, 2015-06-22 13:30
Messages
msg5323 Author: [hidden] (antmail) Date: 2015-06-22 13:30
Attached patch make available 'debug' filter for dumping variable values
and attributes.

One may use it as {{ var1 | debug }} in templates to see what var1 is.

P.S. Requires python 2.5+
msg5459 Author: [hidden] (ber) Date: 2016-01-13 16:15
I wonder what potential drawbacks are, but in principle
it sounds useful. Should probably be documented somewhere
so that template developers see it.
msg5548 Author: [hidden] (rouilj) Date: 2016-04-30 02:32
I think this can be merged.

Would a note in CHANGES.txt be sufficient documentation?
I don't see any jinja2 docs currently in the tree.

Maybe a note on:

  http://www.roundup-tracker.org/cgi-bin/moin.cgi/Jinja2

which is referenced in the template info file for the jinja2
template?

Thoughts? If I don't see anything in a week or so I'll merge changelog
it and ad a note to the wiki.
msg5549 Author: [hidden] (rouilj) Date: 2016-04-30 02:35
Oh I forgot to mention I see the note:

  The v1.5.x releases of Roundup were the last to support
  Python v2.5

and 

- Fix version_check.py to require at least python 2.5 (anatoly techtonik)

in the CHANGES.txt file. So this patch can be added since we support
only 2.5 and newer which is required for the patch to work.
msg5558 Author: [hidden] (antmail) Date: 2016-05-02 09:34
I'm   sorry.   There  are holidays in my country now so I'll  reply in
details few days later.

About 'debug' filter.
In version 2.7 of Jinja2 there is a similar but slightly simpler function

pprint(value, verbose=False)

I think Anatoly Techtonik have to judge this patch.

> John Rouillard added the comment:

> I think this can be merged.

> Would a note in CHANGES.txt be sufficient documentation?
> I don't see any jinja2 docs currently in the tree.

> Maybe a note on:

>   http://www.roundup-tracker.org/cgi-bin/moin.cgi/Jinja2

> which is referenced in the template info file for the jinja2
> template?

> Thoughts? If I don't see anything in a week or so I'll merge changelog
> it and ad a note to the wiki.

> ________________________________________________
> Roundup tracker <issues@roundup-tracker.org>
> <http://issues.roundup-tracker.org/issue2550890>
> ________________________________________________
msg5560 Author: [hidden] (rouilj) Date: 2016-05-02 23:13
Anatoly,

Anthony requested that you look at this patch to see if it needs to
be/should merged.

Can you take a look and leave a note.

Thanks

-- rouilj
msg5564 Author: [hidden] (techtonik) Date: 2016-05-07 07:11
I am trying to take a look at this, but getting constantly
distracted. Jinja2 issue about adding {debug} builtin is
here:

https://github.com/pallets/jinja/issues/174#issue-10048682

The line in return statement should be """ """.format() string
for readability.

It would be nice to see test output and, ideally, test for it,
also submitted to upstream, so we won't have to maintain
this ourselves.

Protected _attributes are probably fine, __private could be
hidden.

additional_filters declaration should be placed on top
before it is used in the text.

And the distractions I am thinking of is to be able to run
Jinja2 test on https://sandstorm.io/ =)

On Tue, May 3, 2016 at 2:13 AM, John Rouillard
<issues@roundup-tracker.org> wrote:
>
> John Rouillard added the comment:
>
> Anatoly,
>
> Anthony requested that you look at this patch to see if it needs to
> be/should merged.
>
> Can you take a look and leave a note.
>
> Thanks
>
> -- rouilj
>
> ________________________________________________
> Roundup tracker <issues@roundup-tracker.org>
> <http://issues.roundup-tracker.org/issue2550890>
> ________________________________________________
msg6772 Author: [hidden] (rouilj) Date: 2019-10-25 15:13
Looking at the reference Anatoly added,
it looks like 2.11 and newer of jinja include a native debug
mechanism for templates.

Closing this as supported by upstream project.

-- rouilj
History
Date User Action Args
2019-10-25 15:13:02rouiljsetstatus: open -> closed
type: behavior
resolution: out of date
messages: + msg6772
2016-05-07 07:11:56techtoniksetmessages: + msg5564
2016-05-02 23:13:59rouiljsetmessages: + msg5560
2016-05-02 23:12:59rouiljsetnosy: + techtonik
2016-05-02 09:34:36antmailsetmessages: + msg5558
2016-04-30 02:37:26rouiljsetassignee: rouilj
2016-04-30 02:35:52rouiljsetmessages: + msg5549
2016-04-30 02:32:35rouiljsetmessages: + msg5548
2016-01-13 16:23:24bersetstatus: new -> open
2016-01-13 16:15:27bersetkeywords: + patch
nosy: + ber
messages: + msg5459
2016-01-13 16:13:10bersetkeywords: + jinja2, - patch
2015-06-28 03:38:34rouiljsetnosy: + rouilj
2015-06-22 13:30:13antmailcreate