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