Discussion:
[Trac-dev] Jinja2 branch ready to merge
Christian Boos
2017-01-30 00:23:26 UTC
Permalink
Hello,

Thanks to all who tested the branch and provided feedback!
In particular, thanks to the feedback from Peter, I reorganized the
migration document (*) so that it starts with some examples, continues
with the changes needed in the Python code (+ since today a section
about i18n for plugins), before finishing with the changes needed in the
templates. I hope things are clearer this way and a bit more engaging to
read.

I think the branch is now in good enough state to be merged on trunk.
At which point we could encourage people to migrate their plugins as
well, get some more feedback and polishing done, and release 1.3.2
shortly after (mid- to end of February).

So if there's no objections, I'll proceed with the merge later this week.

On a related note, the restyling changes which are also demonstrated on
t.e.o/testing jointly with the Jinja2 branch may or may not be ready for
1.3.2 as well, for now they'll stay on +testing. Once the Jinja2 merge
is done, I'll rebase the wiki-restyling branch on trunk and start to
make use of the Jinja2 engine to generate the .css (statically).

-- Christian

(*) https://trac.edgewall.org/wiki/TracDev/PortingFromGenshiToJinja
--
You received this message because you are subscribed to the Google Groups "Trac Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to trac-dev+***@googlegroups.com.
To post to this group, send email to trac-***@googlegroups.com.
Visit this group at https://groups.google.com/group/trac-dev.
For more options, visit https://groups.google.com/d/optout.
Jun Omae
2017-01-30 03:00:03 UTC
Permalink
Hi,
Post by Christian Boos
I think the branch is now in good enough state to be merged on trunk.
At which point we could encourage people to migrate their plugins as
well, get some more feedback and polishing done, and release 1.3.2
shortly after (mid- to end of February).
I'm trying [dd0c9626a] (cboos/+testing) but project index page doesn't work.

----------------------------------------
Exception happened during processing of request from ('192.168.11.21', 58599)
Traceback (most recent call last):
File "/usr/lib/python2.7/SocketServer.py", line 593, in process_request_thread
self.finish_request(request, client_address)
...
File "/venv/py27-1.3/local/lib/python2.7/site-packages/jinja2/loaders.py",
line 187, in get_source
raise TemplateNotFound(template)
TemplateNotFound: jindex.html
----------------------------------------

After the patch, it seems to be fine.

diff --git a/trac/web/main.py b/trac/web/main.py
index 4b1c46392..b25e2adf0 100644
--- a/trac/web/main.py
+++ b/trac/web/main.py
@@ -783,7 +783,7 @@ def send_project_index(environ, start_response,
parent_dir=None,
tmpl_path, template = os.path.split(env_index_template)
loadpaths.insert(0, tmpl_path)
else:
- template = 'jindex.html'
+ template = 'index.html'

data = {'trac': {'version': TRAC_VERSION,
'time': user_time(req, format_datetime)},
--
Jun Omae <***@gmail.com> (大前 潤)
--
You received this message because you are subscribed to the Google Groups "Trac Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to trac-dev+***@googlegroups.com.
To post to this group, send email to trac-***@googlegroups.com.
Visit this group at https://groups.google.com/group/trac-dev.
For more options, visit https://groups.google.com/d/optout.
Christian Boos
2017-02-01 08:27:13 UTC
Permalink
Post by Jun Omae
Hi,
Post by Christian Boos
I think the branch is now in good enough state to be merged on trunk.
At which point we could encourage people to migrate their plugins as
well, get some more feedback and polishing done, and release 1.3.2
shortly after (mid- to end of February).
I'm trying [dd0c9626a] (cboos/+testing) but project index page doesn't work.
----------------------------------------
TemplateNotFound: jindex.html
----------------------------------------
Thanks for the feedback, I fixed that and another remaining "j*.html" issue.

I'm going to merge today on the svn trunk, in small blocks mirroring the
commits on the git branch, so please hold off committing on trunk in the
meantime, thanks!

-- Christian
--
You received this message because you are subscribed to the Google Groups "Trac Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to trac-dev+***@googlegroups.com.
To post to this group, send email to trac-***@googlegroups.com.
Visit this group at https://groups.google.com/group/trac-dev.
For more options, visit https://groups.google.com/d/optout.
Christian Boos
2017-02-01 11:06:15 UTC
Permalink
Post by Christian Boos
I'm going to merge today on the svn trunk, in small blocks mirroring
the commits on the git branch, so please hold off committing on trunk
in the meantime, thanks!
It's there! (completed at r15474).

Enjoy ;-)


You can now resume working on trunk, but please be careful when merging
template changes:
- obviously the template files are now Jinja2 templates,
- perhaps less obviously, if your changes affect a "generic"
template, you may also need to modify its legacy Genshi version in
trac/templates/genshi/

The "generic" Genshi templates like layout.html, admin.html,
list_of_attachments.html, etc. have all been kept in this directory, so
that we can continue to support most plugins rendering their own Genshi
templates and including one of those templates. We no longer have
functional tests exercising them, neither do we use them in plain Trac,
so only do the absolute minimal changes there. Hopefully none will be
needed, until they get decommissioned for good in Trac 1.5.1.


Also, yesterday I did some minor but numerous changes related to the
translations in the templates, so it might very well be that I also
introduced new minor errors as a result. Increased exposure will
hopefully reveal them (and others!). I plan to upgrade +testing later
today, and t.e.o later this week, with a 1.3.2 milestone next week if
nothing big shows up.

-- Christian
--
You received this message because you are subscribed to the Google Groups "Trac Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to trac-dev+***@googlegroups.com.
To post to this group, send email to trac-***@googlegroups.com.
Visit this group at https://groups.google.com/group/trac-dev.
For more options, visit https://groups.google.com/d/optout.
osimons
2017-02-01 17:48:03 UTC
Permalink
Well done, Christian (+ helpers/testers)!

I have not looked at the details of the internal Trac changes, but I just
got my FullBlogPlugin to work with latest trunk yesterday and figured I
might as well keep it working today as well. The changes needed where quite
small:

https://trac-hacks.org/changeset/16217

I'll leave the template conversion to Jinja2 for later – or for others ;-)


:::simon
Post by Christian Boos
Post by Christian Boos
I'm going to merge today on the svn trunk, in small blocks mirroring
the commits on the git branch, so please hold off committing on trunk
in the meantime, thanks!
It's there! (completed at r15474).
Enjoy ;-)
--
You received this message because you are subscribed to the Google Groups "Trac Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to trac-dev+***@googlegroups.com.
To post to this group, send email to trac-***@googlegroups.com.
Visit this group at https://groups.google.com/group/trac-dev.
For more options, visit https://groups.google.com/d/optout.
Christian Boos
2017-02-01 19:47:04 UTC
Permalink
Post by osimons
Well done, Christian (+ helpers/testers)!
Thanks!
Post by osimons
I have not looked at the details of the internal Trac changes, but I
just got my FullBlogPlugin to work with latest trunk yesterday and
figured I might as well keep it working today as well. The changes
https://trac-hacks.org/changeset/16217
Nice, I haven't thought about the need for a version to indicate that it
is Jinja2-enabled, but I guess testing .jenv is effective enough.
We could also add an explicit .jinja2 flag if you think this would be
better.
Post by osimons
I'll leave the template conversion to Jinja2 for later – or for others ;-)
Ah... I could really benefit from your feedback here, as I think the
migration document could still benefit from some more polish before
advertising it further. The feedback from Peter was already quite useful
and I could use more of that, because at this point it's no longer
obvious for me what important point I could have left out and is only in
my head ;-)

In any case, enjoy the new version!

-- Christian
--
You received this message because you are subscribed to the Google Groups "Trac Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to trac-dev+***@googlegroups.com.
To post to this group, send email to trac-***@googlegroups.com.
Visit this group at https://groups.google.com/group/trac-dev.
For more options, visit https://groups.google.com/d/optout.
Loading...