Add File
This commit is contained in:
15
backend/apps/template/template.py
Normal file
15
backend/apps/template/template.py
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
import yaml
|
||||||
|
|
||||||
|
base_template = None
|
||||||
|
|
||||||
|
|
||||||
|
def load():
|
||||||
|
with open('./template.yaml', 'r', encoding='utf-8') as f:
|
||||||
|
global base_template
|
||||||
|
base_template = yaml.load(f, Loader=yaml.SafeLoader)
|
||||||
|
|
||||||
|
|
||||||
|
def get_base_template():
|
||||||
|
if not base_template:
|
||||||
|
load()
|
||||||
|
return base_template
|
||||||
Reference in New Issue
Block a user