comparison tincan.py @ 26:cc6ba7834294 draft header-includes

Some minor bug fixes, but boy, does Chameleon stink.
author David Barts <n5jrn@me.com>
date Sun, 26 May 2019 13:14:26 -0700
parents e93e5e746cc5
children 2e3ac3d7b0a4
comparison
equal deleted inserted replaced
25:e93e5e746cc5 26:cc6ba7834294
531 raise TinCanError(str(e)) from e 531 raise TinCanError(str(e)) from e
532 try: 532 try:
533 self._body = self._tclass(source=rendered) 533 self._body = self._tclass(source=rendered)
534 self._body.prepare() 534 self._body.prepare()
535 except Exception as e: 535 except Exception as e:
536 raise TinCanError("{0}: template error: {1!s}".format(urlpath, e)) from e 536 raise TinCanError("{0}: template error: {1!s}".format(self._urlpath, e)) from e
537 return rendered 537 return rendered
538 538
539 def _dumpbody(self, rendered, based_on, logname): 539 def _dumpbody(self, rendered, based_on, logname):
540 if self._save_includes: 540 if self._save_includes:
541 try: 541 try:
542 with open(based_on + 'i', w) as fp: 542 with open(based_on + "i", "w") as fp:
543 fp.write(rendered) 543 fp.write(rendered)
544 except OSError as e: 544 except OSError as e:
545 raise TinCanError("{0}: {1!s}".format(logname, e)) from e 545 raise TinCanError("{0}: {1!s}".format(logname, e)) from e
546 546
547 def _splitpath(self, unsplit): 547 def _splitpath(self, unsplit):