
--
You received this message because you are subscribed to the Google Groups "TurboGears" group.
To post to this group, send email to turbo...@googlegroups.com.
To unsubscribe from this group, send email to turbogears+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/turbogears?hl=en.
Turbogears-2.1.5/tg/dottednames/jinja_lookup.py
20 # Check if dottedname
21 if not template.endswith('.html'):
22 # Get the actual filename from dotted finder
23 finder = config['pylons.app_globals'].dotted_filename_finder
24 template = finder.get_dotted_filename(
25 template_name=template,
26 template_extension=self.template_extension)
27 else:
28 return FileSystemLoader.get_source(self, environment, template)
I don't really understand the meaning of this code. Why the extension determines the loader to be used? I have templates with other extenions besides .html.
It's the first time i face a problem like this, How do I have to act? Will you propose some modification to this code? Do I have to apply my own patch to all my code?

--
I can make it work by commenting lines from 20 thru 27, and always load templates using FileSystemLoader I don't really need a patch to get it work, I was just wondering how these things happen. I can even wait for your patch to be merged into the trunk or whatever change that makes it work without hacking TG 2.1.5.

--
When using dotted names you are expected not to specify the extension
of the file.
The expected syntax is @expose('proj.templates.index') and not
@expose('proj.templates.index.html') for that reason the loaders
supposed that you aren't using the dotted notation if you specified an
extension to the template because in that case you probably wrote
@expose('proj/templates/index.html') and you don't want TG to be
trying to load the "proj/templates/index/html.html" file.
That is the reason why the loaders usually disable the dotted notation
format if you specified the file extension.
Also the released 2.1.5 has the template_extension class variable, so
that is not strictly the 2.1.5 code. Probably he changed it while
pasting it to make more obvious the issue.
>
> I could prepare a patch to set the template extension if that is what you
> need, but it may get merged later.
>
That it probably a good idea anyway.
It would permit to use dotted loader with any kind of extension
instead of only the default one. We can probably store a dictionary
with extensions to use for each template engine inside the tg.config
(so that the user is able to change it inside the app_cfg.py) and use
that for choosing the template extension inside the loaders.

Thanks Michael for this new release. Is there any roadmap for the future
or it's not yet decided what will be worked on?
Damien
On 04/07/2012 08:17 AM, Michael Pedersen wrote:
> The TurboGears team is proud to announce the release of TurboGears 2.1.4!
>
> This release has many new features and bugfixes, all of them listed
> below. Due to issues with getting 2.2 released, we have chosen to
> produce another 2.1 based released. As a result, this release will be
> the final 2.1.x release, and the final release that will support Python 2.4.
>
> We strongly recommend you upgrade. We are seeing benefits of newer
> template engines and faster response speeds, and it's only going to improve.
>
> * Backport template rendering parameters from 2.2
> * Add hook for render calls to be able to hook even partials
> * Test unit for validation messing hooks
> * Improved Jinja template support for Python 2.4
> * Avoid running wrong decoration hooks when controller is switched
> due to a validation error
> * Permit to avoid doctype injection when manually rendering
> templates with tg.render.render
> * Added new new command (tgdevelop tgdeps) to setup.cfg to help with
> creating a good working virtualenv.
> * Added jinja2 template loader with dotted notation.
> * Fixed multiple paginators in same page
> * Fixed missing tw.forms dependency when auth is disabled
>
>
> --
> Michael J. Pedersen
> My Online Resume: http://www.icelus.org/ -- Google+ http://plus.ly/pedersen
> Google Talk: m.ped...@icelus.org <mailto:m.ped...@icelus.org> --
> Twitter: pedersentg
Yes,
a few weeks ago Michael posted the report of a meeting the TurboGears
team had recently with the roadmap.
https://groups.google.com/d/topic/turbogears/N1xh_r0Sjt4/discussion
Basically:
2.2 -> the upcoming release will have as the major change the switch
to ToscaWidgets2 as the default for new applications.
Existing applications will continue to use ToscaWidgets1 and it will
also be possible to mix the two.
Dispatch will be Crank based which is faster then the current dispatch code.
Some repoze.what-* dependencies won't be necessary anymore and got removed.
Refactoring of the documentation, master/slave bultin support and
various other improvements.
This will be the last Pylons based releae
This release will drop Python 2.4 support
2.3 -> The major change will be the Pylons dependency removal.
Apps that didn't rely on the pylons namespace, but used only the tg
one (tg.request, tg.response and so on) will continue to work without
any required change.
If the application requires Pylons somehow, a compatibility mode will
be available where TG will continue to work with pylons monkeypatching
it.
This release will drop Python 2.5 support and the codebase will start
to move forward to Python3.
After 2.3 Python3 support will probably be the main focus.
For all the major changes in 2.2 and 2.3 moving forward should require
minimum changes and when the major change breaks compatibility an
option to make tg work as before will always be available.
Sounds good for TW2: this is one of the things I'm looking for :)
Damien