From: SourceForge.net <no...@so...> - 2005-04-13 06:12:54
|
Bugs item #1163629, was opened at 2005-03-15 22:00 Message generated for change (Comment added) made by richard You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=402788&aid=1163629&group_id=31577 Category: Web interface Group: 0.8.x >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Michael Twomey (micktwomey) Assigned to: Richard Jones (richard) Summary: find_template filename logic slightly faulty Initial Comment: I've been using XML templates (e.g. home.atom.xml and xmlwidgets.xml) with roundup 0.8 and I'm encountering issues with it not being able to find them. I think the problem is in the code in roundup.cgi.templating.find_template which tries to look for html and xml files: # try with a .html or .xml extension (new-style) for extension in '.html', '.xml': filename = filename + extension src = os.path.join(dir, filename) if os.path.exists(src): return (src, filename) On the first pass it will look for foo.html but on the second pass it will look for foo.html.xml since filename has been clobbered. Changing the code to this fixes it: # try with a .html or .xml extension (new-style) for extension in '.html', '.xml': f = filename + extension src = os.path.join(dir, f) if os.path.exists(src): return (src, f) I've attached a diff against CVS HEAD too. Applying this patch to my copy of roundup lets it find my xml templates. Without this change my roundup instance won't even start as it has a fit over xmlwidgets.xml. ---------------------------------------------------------------------- >Comment By: Richard Jones (richard) Date: 2005-04-13 16:12 Message: Logged In: YES user_id=6405 Applied, thanks! ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=402788&aid=1163629&group_id=31577 |