hi
In this environment setup:
- A py3.4 virtual-env
- Created a Pyramid application (www.pylonsproject.org) using sqlalchemy starterkit.
- Manually replaced chamelion templating system with mako (everything works fine so far and the page is rendering in browser with no problem).
- Converted PyHAML using 2to3 (everything went fine).
- Added "mako.preprocessor = haml.preprocessor" to application's .ini file which will be picked up by mako later.
- Running (in virtual-env)
pserve development.ini
- Visiting application's web page will raise a mako exception.
I put a open('/tmp/x', 'w').write(generate_mako(parse_string(source))) in init.py file to investigate it more, looking at the file 'x' I can see this comment which is by default in pyramid's page has turned to Mako expression:
Original in mytemplate.mako:
<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
Output by PyHAML:
<!-- Bootstrap core JavaScript -->
${================================================== -->}
<!-- Placed at the end of the document so the pages load faster -->
Simply removing the offending line like this:
fixed the problem (for now).
is this really an issue or did I miss something in the docs? That 2to3 thing seems fishy though.
best wishes
hi
In this environment setup:
pserve development.iniI put a open('/tmp/x', 'w').write(generate_mako(parse_string(source))) in init.py file to investigate it more, looking at the file 'x' I can see this comment which is by default in pyramid's page has turned to Mako expression:
Original in mytemplate.mako:
Output by PyHAML:
Simply removing the offending line like this:
fixed the problem (for now).
is this really an issue or did I miss something in the docs? That 2to3 thing seems fishy though.
best wishes