test
This commit is contained in:
13
lib/support/base/yaml.py
Normal file
13
lib/support/base/yaml.py
Normal file
@@ -0,0 +1,13 @@
|
||||
import yaml
|
||||
|
||||
class SupportYaml(object):
|
||||
@classmethod
|
||||
def write_yaml(cls, filepath, data):
|
||||
with open(filepath, 'w', encoding='utf8') as f:
|
||||
yaml.dump(data, f, default_flow_style=False, allow_unicode=True)
|
||||
|
||||
@classmethod
|
||||
def read_yaml(self, filepath):
|
||||
with open(filepath, encoding='utf8') as file:
|
||||
data = yaml.load(file, Loader=yaml.FullLoader)
|
||||
return data
|
||||
Reference in New Issue
Block a user