updated pull to deal with errors in diffhtml output that was halting the dump process
This commit is contained in:
parent
4f7092010c
commit
63910192b9
@ -274,9 +274,11 @@ def main (args):
|
|||||||
versions_by_type[t] = v
|
versions_by_type[t] = v
|
||||||
|
|
||||||
if "text" in versions_by_type:
|
if "text" in versions_by_type:
|
||||||
|
try:
|
||||||
with open (versions_by_type["text"]["path"]) as f:
|
with open (versions_by_type["text"]["path"]) as f:
|
||||||
p["text"] = f.read()
|
p["text"] = f.read()
|
||||||
|
except FileNotFoundError:
|
||||||
|
p['text'] = ''
|
||||||
# ADD IN LINK TO PAD AS "link"
|
# ADD IN LINK TO PAD AS "link"
|
||||||
for v in linkversions:
|
for v in linkversions:
|
||||||
if v in versions_by_type:
|
if v in versions_by_type:
|
||||||
|
@ -218,6 +218,7 @@ def main (args):
|
|||||||
versions.append(ver)
|
versions.append(ver)
|
||||||
ver["code"] = html["_code"]
|
ver["code"] = html["_code"]
|
||||||
if html["_code"] == 200:
|
if html["_code"] == 200:
|
||||||
|
try:
|
||||||
html = html['data']['html']
|
html = html['data']['html']
|
||||||
ver["path"] = p+".diff.html"
|
ver["path"] = p+".diff.html"
|
||||||
ver["url"] = quote(ver["path"])
|
ver["url"] = quote(ver["path"])
|
||||||
@ -227,6 +228,11 @@ def main (args):
|
|||||||
with open(ver["path"], "w") as f:
|
with open(ver["path"], "w") as f:
|
||||||
# f.write(html.encode("utf-8"))
|
# f.write(html.encode("utf-8"))
|
||||||
print(ET.tostring(doc, method="html", encoding="unicode"), file=f)
|
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
|
# Process text, html, dhtml, all options
|
||||||
if args.all or args.html:
|
if args.all or args.html:
|
||||||
|
Loading…
Reference in New Issue
Block a user