- tfile_list = [os.path.join(basedir.get(), 'covermail.tmpl'),
- os.path.join(os.path.expanduser('~'), '.stgit', 'templates',
- 'covermail.tmpl'),
- os.path.join(sys.prefix,
- 'share', 'stgit', 'templates', 'covermail.tmpl')]
-
- tmpl = None
- for tfile in tfile_list:
- if os.path.isfile(tfile):
- tmpl = file(tfile).read()
- break
- if not tmpl:
- raise CmdException, 'No cover message template file found'
+ tmpl = templates.get_template('covermail.tmpl')
+ if not tmpl:
+ raise CmdException, 'No cover message template file found'