[stringtemplate-interest] problem with simple group inheritance
Chris Pizzi
cpizzi at nis-retail.com
Wed Jun 18 09:55:13 PDT 2008
I am having a problem with simple group inheritance in Python
stringtemplate 3.1. It seems that if a template is not found under the
sub-group's root directory, it never tries to find it in the super-group's.
Given this directory layout:
./super/sup.st
./sub/sub.st
with super.st containing:
SUPER
and sub.st containing:
SUB $sup()$
I would expect the following to yield "SUB SUPER", however I get an
error instead:
>>> from stringtemplate3 import StringTemplateGroup
>>> sup = StringTemplateGroup("super","./super")
>>> sub = StringTemplateGroup("sub","./sub")
>>> sub.superGroup = sup
>>> print sub.getInstanceOf("sub")
Got IOError writing to writerAutoIndentWriter
SUB
>>>
Am I misunderstanding inheritance, or is this actually a problem? For
now I have patched groups.py to make it behave the way I'm expecting:
--- groups.py 2008-06-18 12:36:30.000000000 -0400
+++ /tmp/groups.py 2008-06-18 12:43:48.000000000 -0400
@@ -477,6 +477,8 @@
br.close()
# FIXME: eek, that's ugly
+ except IOError:
+ template = None
except Exception, e:
raise
--
Chris Pizzi
Sr. Programmer
National In-Store
2 N aTamiami Trail, 9th Fl
Sarasota, FL 34236
Phone 941-554-2685
Mobile 941-586-6004
www.nis-retail.com
Notice: This communication may contain privileged or other confidential
information. If you have received it in error, please advise the sender
by reply email and immediately delete the message and any attachments
without copying or disclosing the contents. Thank you.
More information about the stringtemplate-interest
mailing list