Hide keyboard shortcuts

Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

1""" 

2@file 

3@brief About templates. 

4""" 

5import os 

6 

7 

8def get_template(name): 

9 """ 

10 Get a template name. 

11 

12 @param name template name 

13 @return content 

14 """ 

15 this = os.path.dirname(name) 

16 tm = os.path.join(this, name) 

17 if not os.path.exists(tm): 

18 raise FileNotFoundError("Unable to find template '{0}'.".format(name)) 

19 with open(tm, "r", encoding="utf-8") as f: 

20 return f.read()