From 6b00e6cc829602cec7e6b6b73f94febd28bfa9a3 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Sat, 3 Oct 2015 10:34:06 +0300 Subject: Move template texts into files --- jtlib/app.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'jtlib/app.py') diff --git a/jtlib/app.py b/jtlib/app.py index a560c26..8e0303a 100644 --- a/jtlib/app.py +++ b/jtlib/app.py @@ -93,3 +93,8 @@ class JournalTool(cliapp.Application): return args[0], pathname elif len(args) > 1: raise cliapp.AppException('Must give at most one draft number') + + def read_template(self, basename): + filename = os.path.join(self.app_directory(), 'templates', basename) + with open(filename) as f: + return f.read() -- cgit v1.2.1