tw2 and genshi <xi:include href="imaster.html" />

41 views
Skip to first unread message

Rene van Paassen

unread,
Jun 6, 2012, 4:36:54 AM6/6/12
to toscawidge...@googlegroups.com
Hi, 

I am using tw2 in combination with bottle and genshi templates. 

tw2.core 2.0.0 worked for that set-up

for 

tw2.core-2.1.0a4, I am getting trouble reading in an included genshi master template. 

I added my application's location to the python path, and using dotted notation, I can find the page-specific templates themselves. However, whatever I try to get the *included by genshi* master template read does not work. It used to work in the older tw2. The only think that helps is putting the included master template in the directory where I start up my program, which is an OK fix for now, but I would really like to know how to tell genshi -- when used in combination with tw2 -- where to look for included templates. 


The tw2 / genshi bit of the error log is:

Module _session:264 in loginpage         
>>  return UserLogin.req().display()
Module tw2.core.widgets:397 in display         
>>  return self.generate_output(displays_on)
Module tw2.core.widgets:434 in generate_output         
>>  mw,
Module tw2.core.templating:175 in render         
>>  return callback(kwargs)
Module tw2.core.templating:136 in <lambda>         
>>  ''.join(tmpl.generate(**kwargs).serialize('xhtml'))
Module genshi.template.base:532 in generate         
>>  stream = self.stream
Module genshi.template.base:442 in stream         
>>  self._stream = list(self._prepare(self._stream))
Module genshi.template.base:492 in _prepare         
>>  cls=cls or self.__class__)
Module genshi.template.loader:246 in load         
>>  raise TemplateNotFound(filename, search_path)
TemplateNotFound: Template "master.html" not found

Thanks

Rene



Ralph Bean

unread,
Jun 6, 2012, 9:23:50 AM6/6/12
to toscawidge...@googlegroups.com
Hi Rene,
This is just a shortcoming of my programming: sorry!

In 2.1.0a, I blew away the old templating system and replaced it
with a new, hopefully simplified one with support for new templating
engines like jinja2, kajiki, and chameleon. I'll try and come up
with a solution for you soon.

Yours-
-Ralph

On Wed, Jun 06, 2012 at 01:36:54AM -0700, Rene van Paassen wrote:
> Hi,
>
> I am using tw2 in combination with bottle and genshi templates.
>
> tw2.core 2.0.0 worked for that set-up
>
> for
>
> tw2.core-2.1.0a4, I am getting trouble reading in an included genshi master
> template.
>
> I added my application's location to the python path, and using dotted
> notation, I can find the page-specific templates themselves. However,
> whatever I try to get the *included by genshi* master template read does
> not work. It used to work in the older tw2. The only think that helps is
> putting the included master template in the directory where I start up my
> program, which is an OK fix for now, but I would really like to know how to
> tell genshi -- when used in combination with tw2 -- where to look for
> included templates.
>
>
> The tw2 / genshi bit of the error log is:
>
> Module _session:*264* in loginpage <http://localhost:8001/practicon/index#>
> >> <http://localhost:8001/practicon/index#>*return* UserLogin*.*req*(**)**
> .*display*(**)*
> Module tw2.core.widgets:*397* in display <http://localhost:8001/practicon/index#>
> >> <http://localhost:8001/practicon/index#>*return* self*.*generate_output
> *(*displays_on*)*
> Module tw2.core.widgets:*434* in generate_output <http://localhost:8001/practicon/index#>
> >> <http://localhost:8001/practicon/index#>mw*,*
> Module tw2.core.templating:*175* in render <http://localhost:8001/practicon/index#>
> >> <http://localhost:8001/practicon/index#>*return* callback*(*kwargs*)*
> Module tw2.core.templating:*136* in <lambda> <http://localhost:8001/practicon/index#>
> >> <http://localhost:8001/practicon/index#>''*.*join*(*tmpl*.*generate*(**
> ***kwargs*)**.*serialize*(*'xhtml'*)**)*
> Module genshi.template.base:*532* in generate <http://localhost:8001/practicon/index#>
> >> <http://localhost:8001/practicon/index#>stream *=* self*.*stream
> Module genshi.template.base:*442* in stream <http://localhost:8001/practicon/index#>
> >> <http://localhost:8001/practicon/index#>self*.*_stream *=* list*(*self*
> .*_prepare*(*self*.*_stream*)**)*
> Module genshi.template.base:*492* in _prepare <http://localhost:8001/practicon/index#>
> >> <http://localhost:8001/practicon/index#>cls*=*cls *or* self*.*__class__
> *)*
> Module genshi.template.loader:*246* in load <http://localhost:8001/practicon/index#>
> >> <http://localhost:8001/practicon/index#>*raise* TemplateNotFound*(*
> filename*,* search_path*)*
> *TemplateNotFound: Template "master.html" not found*
> *
> *
> *Thanks*,
>
> Rene
>
>
>
> --
> You received this message because you are subscribed to the Google Groups "ToscaWidgets-discuss" group.
> To view this discussion on the web visit https://groups.google.com/d/msg/toscawidgets-discuss/-/mX_r1IBtoPsJ.
> To post to this group, send email to toscawidge...@googlegroups.com.
> To unsubscribe from this group, send email to toscawidgets-dis...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/toscawidgets-discuss?hl=en.
>

Ralph Bean

unread,
Jun 6, 2012, 10:16:17 AM6/6/12
to toscawidge...@googlegroups.com
I pushed a commit and another alpha release that should fix the issue
for you:

https://github.com/toscawidgets/tw2.core/commit/fc58e929ac6cd04eb3bb698eff9249f97b85d31c

Please let us know if you're still having problems.

Yours-
-Ralph

On Wed, Jun 06, 2012 at 01:36:54AM -0700, Rene van Paassen wrote:
> Hi,
>
> I am using tw2 in combination with bottle and genshi templates.
>
> tw2.core 2.0.0 worked for that set-up
>
> for
>
> tw2.core-2.1.0a4, I am getting trouble reading in an included genshi master
> template.
>
> I added my application's location to the python path, and using dotted
> notation, I can find the page-specific templates themselves. However,
> whatever I try to get the *included by genshi* master template read does
> not work. It used to work in the older tw2. The only think that helps is
> putting the included master template in the directory where I start up my
> program, which is an OK fix for now, but I would really like to know how to
> tell genshi -- when used in combination with tw2 -- where to look for
> included templates.
>
>
> The tw2 / genshi bit of the error log is:
>

Rene van Paassen

unread,
Jun 7, 2012, 6:36:52 AM6/7/12
to toscawidge...@googlegroups.com
Op woensdag 6 juni 2012 16:16:17 UTC+2 schreef Ralph Bean het volgende:
I pushed a commit and another alpha release that should fix the issue
for you:

    https://github.com/toscawidgets/tw2.core/commit/fc58e929ac6cd04eb3bb698eff9249f97b85d31c

Please let us know if you're still having problems.

I tested this, and it works. Thanks very much for the quick fix!

René
Reply all
Reply to author
Forward
0 new messages