def from_file(cls, file_loc, **kwargs):
if not os.path.exists(file_loc):
raise IOError('File not found: {}'.format(file_loc))
with open(file_loc, 'r') as yf:
config = yaml.safe_load(yf)
config.update(kwargs)
return cls(config_loc_=file_loc, **config)
评论列表
文章目录