Opened 16 years ago
Closed 15 years ago
#302 closed defect (fixed)
PATCH - REGRESSION - Genshi 0.5.1 xinclude functionality overrides TemplateLoader's default_class
Reported by: | genshi.20.dlobue@… | Owned by: | cmlenz |
---|---|---|---|
Priority: | major | Milestone: | 0.6 |
Component: | Parsing | Version: | 0.5.1 |
Keywords: | Cc: |
Description
Genshi 0.5.1 xinclude functionality overrides the TemplateLoader? default_class, and doesn't include a way to use the default_class on documents imported using ximport.
This specifically causes problems when using GHRML.
Attached patch contains fix.
Attachments (2)
Change History (8)
Changed 16 years ago by genshi.20.dlobue@…
comment:1 follow-up: ↓ 2 Changed 16 years ago by jochen.kupperschmidt@…
Badly tripped about this very issue in the last few days. I'd love to see this changed in the upcoming 0.5.2 release.
Regarding the patch, I would even go one step further and make 'default' the default key. That way, one only needs to specify it when XIncluding other template types, but not when using just MarkupTemplate or GHRMLTemplate. See my attached patch.
comment:2 in reply to: ↑ 1 Changed 15 years ago by genshi.20.dlobue@…
Replying to jochen.kupperschmidt@…:
Badly tripped about this very issue in the last few days. I'd love to see this changed in the upcoming 0.5.2 release.
Regarding the patch, I would even go one step further and make 'default' the default key. That way, one only needs to specify it when XIncluding other template types, but not when using just MarkupTemplate or GHRMLTemplate. See my attached patch.
I wanted to do that too, but I figured my change had a greater chance of making it into the project if its impact on the rest of Genshi was as small as possible.
Along those lines, in order to finish getting xincludes to work I had to make a change in GHRML as well as Genshi. Actually its the other way around, I was trying to fix the problem in GHRML and not touch Genshi, but it wasn't possible with what I know about python. But I digress, if you'd like a patch for the other half to my solution shoot me an email (so we don't steer the ticket off topic) at: genshi.20.dlobue@…
comment:3 Changed 15 years ago by jochen.kupperschmidt@…
If I'm not totally mistaken, I didn't do any changes to GHRML to get includes for both layout and fragments/"partials" to work.
Regarding the proposed patch, I came across other parts of Genshi regarding includes that contain something like ... or self.__class__. *Maybe* my extended patch could allow to simplify those cases in response.
comment:4 Changed 15 years ago by cmlenz
- Milestone changed from 0.5.2 to 0.6
Milestone 0.5.2 deleted
comment:5 Changed 15 years ago by cmlenz
- Status changed from new to assigned
comment:6 Changed 15 years ago by cmlenz
- Resolution set to fixed
- Status changed from assigned to closed
Applied a change based on Jochen's patch in [1103].
Patch adds 'default' as a valid value to the parse attribute in xi:include tags.