def save_data_yaml(self, filename=None, *args):
''' Save or show the results in YAML '''
if filename:
self.stream = open(filename, 'w')
else:
self.stream = sys.stdout
try:
for game_log, stats in args:
print >> self.stream, '### Stats per second of the log file %s:\n' % game_log
print >> self.stream, '# Zero is significant (count missing lines): %s' % str(self.significantzero)
print >> self.stream, yaml.dump(stats, default_flow_style=False, Dumper=Dumper)
print >> self.stream, '---' # YAML objects separator
except:
print >> self.stream, yaml.dump_all(args, default_flow_style=False, Dumper=Dumper)
logdiagnostic.py 文件源码
python
阅读 25
收藏 0
点赞 0
评论 0
评论列表
文章目录