12345678910111213141516171819 |
- #!/usr/bin/env python
- # -*- coding: utf-8 -*-
- """
- @author: Deepcold
- @file: read_yaml.py
- @time: 2019/8/19 15:45
- """
- import os
- import yaml
- from bin.utils.covert_dict_object import dict_to_object
- from config import SOURCE_ROOT
- def read_yaml(file_name):
- yaml_path = os.path.join(SOURCE_ROOT, "properties", file_name)
- with open(yaml_path, encoding="utf8") as f:
- config_text = yaml.load(f.read(), Loader=yaml.FullLoader)
- config = dict_to_object(config_text)
- return config
|