mirror of
https://github.com/Cockatrice/Magic-Spoiler.git
synced 2026-08-25 10:55:18 -05:00
Error log to YAML (#137)
* Error log to YAML * Also dump debug print to YAML
This commit is contained in:
8
main.py
8
main.py
@@ -10,6 +10,7 @@ import io
|
||||
import sys
|
||||
import verify_files
|
||||
import requests
|
||||
import yaml
|
||||
from lxml import etree
|
||||
|
||||
presets = {
|
||||
@@ -66,9 +67,8 @@ def save_setjson(mtgs, filename):
|
||||
|
||||
|
||||
def save_errorlog(errorlog):
|
||||
with open('out/errors.json', 'w') as outfile:
|
||||
json.dump(errorlog, outfile, sort_keys=True,
|
||||
indent=2, separators=(',', ': '))
|
||||
with open('out/errors.yml', 'w') as outfile:
|
||||
yaml.safe_dump(errorlog, outfile, default_flow_style=False)
|
||||
|
||||
|
||||
def save_xml(xmlstring, outfile):
|
||||
@@ -184,7 +184,7 @@ if __name__ == '__main__':
|
||||
if presets['dumpErrors']:
|
||||
if errorlog != {}:
|
||||
print '//----- DUMPING ERROR LOG -----'
|
||||
print json.dumps(errorlog, ensure_ascii=False, encoding='utf8', indent=2, sort_keys=True, separators=(',', ':'))
|
||||
print yaml.safe_dump(errorlog, default_flow_style=False)
|
||||
print '//----- END ERROR LOG -----'
|
||||
else:
|
||||
print "No Detected Errors!"
|
||||
|
||||
Reference in New Issue
Block a user