|
|
@ -218,6 +218,7 @@ def main (args): |
|
|
|
versions.append(ver) |
|
|
|
ver["code"] = html["_code"] |
|
|
|
if html["_code"] == 200: |
|
|
|
try: |
|
|
|
html = html['data']['html'] |
|
|
|
ver["path"] = p+".diff.html" |
|
|
|
ver["url"] = quote(ver["path"]) |
|
|
@ -227,6 +228,11 @@ def main (args): |
|
|
|
with open(ver["path"], "w") as f: |
|
|
|
# f.write(html.encode("utf-8")) |
|
|
|
print(ET.tostring(doc, method="html", encoding="unicode"), file=f) |
|
|
|
except TypeError: |
|
|
|
# Malformed / incomplete response, record the message (such as "internal error") in the metadata and write NO file! |
|
|
|
ver["message"] = html["message"] |
|
|
|
# with open(ver["path"], "w") as f: |
|
|
|
# print ("""<pre>{0}</pre>""".format(json.dumps(html, indent=2)), file=f) |
|
|
|
|
|
|
|
# Process text, html, dhtml, all options |
|
|
|
if args.all or args.html: |
|
|
|