# coding: utf-8
import json
import os
-from iso8601 import parse_date
from xml.sax.saxutils import escape
def serialize_comicxml(doujinshi, dir):
+ from iso8601 import parse_date
with open(os.path.join(dir, 'ComicInfo.xml'), 'w') as f:
f.write('<?xml version="1.0" encoding="utf-8"?>\n')
- f.write('<ComicInfo xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">\n')
+ f.write('<ComicInfo xmlns:xsd="http://www.w3.org/2001/XMLSchema" '
+ 'xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">\n')
xml_write_simple_tag(f, 'Manga', 'Yes')
def xml_write_simple_tag(f, name, val, indent=1):
- f.write(f'{" " * indent}<{name}>{escape(str(val))}</{name}>\n')
+ f.write('{}<{}>{}</{}>\n'.format(' ' * indent, name, escape(str(val)), name))
+
def merge_json():
lst = []