|
|
@ -15,8 +15,6 @@ import html5lib |
|
|
|
from etherpump.commands.common import * |
|
|
|
from etherpump.commands.html5tidy import html5tidy |
|
|
|
|
|
|
|
# debugging |
|
|
|
# import ElementTree as ET |
|
|
|
|
|
|
|
""" |
|
|
|
pull(meta): |
|
|
@ -199,10 +197,10 @@ def main(args): |
|
|
|
continue |
|
|
|
progressbar(i, numpads, padid) |
|
|
|
|
|
|
|
data['padID'] = padid.encode("utf-8") |
|
|
|
data['padID'] = padid |
|
|
|
p = padpath(padid, args.pub, args.group, args.fix_names) |
|
|
|
if args.folder: |
|
|
|
p = os.path.join(p, padid.encode("utf-8")) |
|
|
|
p = os.path.join(p, padid) |
|
|
|
|
|
|
|
metapath = p + ".meta.json" |
|
|
|
revisions = None |
|
|
@ -210,8 +208,7 @@ def main(args): |
|
|
|
skip = False |
|
|
|
padurlbase = re.sub(r"api/1.2.9/$", "p/", info["apiurl"]) |
|
|
|
meta = {} |
|
|
|
# if type(padurlbase) == unicode: |
|
|
|
# padurlbase = padurlbase.encode("utf-8") |
|
|
|
|
|
|
|
while True: |
|
|
|
try: |
|
|
|
if os.path.exists(metapath): |
|
|
@ -226,7 +223,7 @@ def main(args): |
|
|
|
skip = True |
|
|
|
break |
|
|
|
|
|
|
|
meta['padid'] = padid # .encode("utf-8") |
|
|
|
meta['padid'] = padid |
|
|
|
versions = meta["versions"] = [] |
|
|
|
versions.append( |
|
|
|
{ |
|
|
@ -421,7 +418,6 @@ def main(args): |
|
|
|
links=links, |
|
|
|
) |
|
|
|
with open(ver["path"], "w") as f: |
|
|
|
# f.write(html.encode("utf-8")) |
|
|
|
print( |
|
|
|
ET.tostring(doc, method="html", encoding="unicode"), |
|
|
|
file=f, |
|
|
@ -453,7 +449,6 @@ def main(args): |
|
|
|
links=links, |
|
|
|
) |
|
|
|
with open(ver["path"], "w") as f: |
|
|
|
# f.write(html.encode("utf-8")) |
|
|
|
print( |
|
|
|
ET.tostring(doc, method="html", encoding="unicode"), |
|
|
|
file=f, |
|
|
|