Template engine configured before configuration loaded?

0 views
Skip to first unread message

Matthew Bevan

unread,
Sep 11, 2006, 2:54:50 PM9/11/06
to turbo...@googlegroups.com
Howdy!

In attempting to run down the problem with sitetemplate, I've added a print statement to _load_engines in turbogears.view.base to output the configuration of "tg.sitetemplate".

Running a new quick-started project, adding back the tg.sitetemplate line in app.cfg, and adding a template to sttest/templates called sitetemplate.kid, results in the following:

WARNING:  turbogears.view.templates.sitetemplate
2006-09-11 11:45:37,839 turbogears.controllers DEBUG Exposing <function index at 0x171a670>
2006-09-11 11:45:37,840 turbogears.controllers DEBUG template: sttest.templates.welcome, format: None, allow_json: None, content-type: None
WARNING:  turbogears.view.templates.sitetemplate
2006-09-11 11:45:40,245 turbogears.controllers DEBUG Exposing <function index at 0x171a670>
2006-09-11 11:45:40,246 turbogears.controllers DEBUG template: sttest.templates.welcome, format: None, allow_json: None, content-type: None
2006-09-11 11:45:40,248 cherrypy.msg INFO CONFIG: Server parameters:
2006-09-11 11:45:40,249 cherrypy.msg INFO CONFIG:   server.environment: development
2006-09-11 11:45:40,249 cherrypy.msg INFO CONFIG:   server.log_to_screen: True
2006-09-11 11:45:40,250 cherrypy.msg INFO CONFIG:   server.log_file:
2006-09-11 11:45:40,250 cherrypy.msg INFO CONFIG:   server.log_tracebacks: True
2006-09-11 11:45:40,251 cherrypy.msg INFO CONFIG:   server.log_request_headers: True
2006-09-11 11:45:40,251 cherrypy.msg INFO CONFIG:   server.protocol_version: HTTP/1.0
2006-09-11 11:45:40,252 cherrypy.msg INFO CONFIG:   server.socket_host:
2006-09-11 11:45:40,252 cherrypy.msg INFO CONFIG:   server.socket_port: 8080
2006-09-11 11:45:40,252 cherrypy.msg INFO CONFIG:   server.socket_file:
2006-09-11 11:45:40,253 cherrypy.msg INFO CONFIG:   server.reverse_dns: False
2006-09-11 11:45:40,253 cherrypy.msg INFO CONFIG:   server.socket_queue_size: 5
2006-09-11 11:45:40,254 cherrypy.msg INFO CONFIG:   server.thread_pool: 10
2006-09-11 11:45:40,291 turbogears.view DEBUG Loading base templates
Registering Service sttest: development._http._tcp port 8080 path=/
2006-09-11 11:45:40,524 cherrypy.msg INFO HTTP: Serving HTTP on http://localhost:8080/
Got a reply for sttest: development._http._tcp.local.: Name now registered and active

My print statement would not be subject to duplication because of a logging misconfiguration (which I have seen elsewhere).  It's being run twice, and is never pulling the correct value.  It would seem that the configuration is never actually loaded until the "Server paramaters:" line.

What's going on here?

(P.s. I know there is a logger set up in turbogears.view.base, but I can't seem to use it.  Keeps complaining about "no handler configured for turbogears.view"...)

Matthew Bevan, Systems Administrator
Top Floor Computer Systems Ltd.


Matthew Bevan

unread,
Sep 11, 2006, 3:07:35 PM9/11/06
to turbo...@googlegroups.com
I've changed the debugging prompt to appear after engine_options gets built and I see that it ignores all of my options set in app.cfg:

engine_options = {'kid.sitetemplate': 'turbogears.view.templates.sitetemplate', 'kid.i18n_filter': <function i18n_filter at 0x137ae30>, 'kid.encoding': 'utf-8', 'kid.precompiled': False, 'kid.i18n.run_template_filter': False, 'kid.reloadbases': False}

In my app.cfg:

tg.sitetemplate = "sttest.templates.sitetemplate"
kid.precompiled = True

The sitetemplate issue seems to be a symptom of a larger problem.

Ksenia Marasanova

unread,
Sep 11, 2006, 4:32:53 PM9/11/06
to turbo...@googlegroups.com
I think this is the same problem as with i18n filter:
http://groups.google.com/group/turbogears-trunk/msg/3a965e0ac7e00a7a

Matthew Bevan

unread,
Sep 11, 2006, 5:16:48 PM9/11/06
to turbo...@googlegroups.com
I think this is the same problem as with i18n filter:

It does indeed appear to be.  Is there a ticket for it?

http://trac.turbogears.org/turbogears/changeset/1728 (from the linked discussion) would be the breaking change.  All this bother just to get a few lazy test cases working.  :P
Reply all
Reply to author
Forward
0 new messages