Browse Source

Publish new 0.1.18 version

main
manetta 4 years ago
parent
commit
ecc26c971d
  1. 2
      etherpump/__init__.py
  2. 13
      etherpump/commands/pull.py
  3. 2
      pyproject.toml

2
etherpump/__init__.py

@ -4,7 +4,7 @@ import sys
DATAPATH = os.path.join(os.path.dirname(os.path.realpath(__file__)), "data")
__VERSION__ = "0.0.17"
__VERSION__ = "0.0.18"
def subcommands():

13
etherpump/commands/pull.py

@ -447,12 +447,19 @@ async def handle_pad(args, padid, data, info, session):
# Process text, html, dhtml, all options
if args.all or args.html:
url = info["localapiurl"] + "getHTML?" + urlencode(data)
# mb: line causing the error of not writing the correct HTML content to the correct HTML file:
# url = info["localapiurl"] + "getHTML?" + urlencode(data)
# mb: warning, HACK! Catching the error by writing the API request url manually ...
url = info["localapiurl"] + "getHTML?" + "padID=" + padid + "&" + 'apikey=' + data["apikey"] + '&startRev=0'
# print(url)
html = await agetjson(session, url)
ver = {"type": "html"}
versions.append(ver)
# mb: warning, HACK! Added a Try and Except here, as it sometimes bumped into an error, stopping the pull.
try:
ver["code"] = html["_code"]
if html["_code"] == 200:
try:
html = html["data"]["html"]
ver["path"] = p + ".raw.html"
ver["url"] = quote(ver["path"])
@ -465,6 +472,10 @@ async def handle_pad(args, padid, data, info, session):
async with await trio.open_file(ver["path"], "w") as f:
output = ET.tostring(doc, method="html", encoding="unicode")
await f.write(output)
except TypeError:
ver["message"] = html["message"]
except Exception as exception:
print("PANIC: {}".format(exception))
# output meta
if args.all or args.meta:

2
pyproject.toml

@ -4,7 +4,7 @@ build-backend = "poetry.masonry.api"
[tool.poetry]
name = "etherpump"
version = "0.0.17"
version = "0.0.18"
description = "Pumping text from etherpads into publications"
authors = ["Varia, Center for Everyday Technology"]
maintainers = ["Varia, Center for Everyday Technology <info@varia.zone>"]

Loading…
Cancel
Save