def read(self):
# ensure yaml uses a defaultdict(str)
yaml.add_representer(collections.defaultdict,
Representer.represent_str)
try:
with open(os.path.expanduser(self.path), 'r') as fh:
self.conf = yaml.load(fh)
except Exception as ex:
logger.error("Unable to read config (%s): %s" % (self.path, ex))
sys.exit(1)
评论列表
文章目录