O'Reilly logo

Python 2.6 Text Processing Beginner's Guide by Jeff McNeil

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action - adding another inheritance layer

So, while we've built the ability to generate an e-mail message, we haven't yet added any header generation or a place to insert things such as copyright and disclaimer links. These are all things we'll want to support if we're going to be sending out professional messages. Let's add another level above our existing top.txt file that contains this additional information.

  1. Add a new template to the templates directory and name it master.txt. Enter the following Mako template code:
     <%doc>\ This file contains all global e-mail data. Things such as headers, copyright footers, and "almost protocol level" data should go here. </%doc> ${self.write_headers()} ${next.body()}\ ${self.copyright()}\ \ <%def ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required