From c75ae9bc7c0db79f6434a04f9a5b0bc90666784e Mon Sep 17 00:00:00 2001 From: Michael Murtaugh Date: Wed, 21 Feb 2018 15:17:58 +0100 Subject: [PATCH] Only all requested versions in links --- etherdump/commands/pull.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/etherdump/commands/pull.py b/etherdump/commands/pull.py index b506656..9245a39 100644 --- a/etherdump/commands/pull.py +++ b/etherdump/commands/pull.py @@ -200,11 +200,16 @@ def main (args): # todo, make this process reflect which files actually were made versionbaseurl = quote(padid) links.append({"href":versions[0]["url"], "rel":"alternate", "type":"text/html", "title":"Etherpad"}) - links.append({"href":versionbaseurl+raw_ext, "rel":"alternate", "type":"text/plain", "title":"Plain text"}) - links.append({"href":versionbaseurl+".raw.html", "rel":"alternate", "type":"text/html", "title":"HTML"}) - links.append({"href":versionbaseurl+".diff.html", "rel":"alternate", "type":"text/html", "title":"HTML with author colors"}) - links.append({"href":versionbaseurl+".meta.json", "rel":"alternate", "type":"application/json", "title":"Meta data"}) - links.append({"href":"/", "rel":"search", "type":"text/html", "title":"Index"}) + if args.all or args.text: + links.append({"href":versionbaseurl+raw_ext, "rel":"alternate", "type":"text/plain", "title":"Plain text"}) + if args.all or args.html: + links.append({"href":versionbaseurl+".raw.html", "rel":"alternate", "type":"text/html", "title":"HTML"}) + if args.all or args.dhtml: + links.append({"href":versionbaseurl+".diff.html", "rel":"alternate", "type":"text/html", "title":"HTML with author colors"}) + if args.all or args.meta: + links.append({"href":versionbaseurl+".meta.json", "rel":"alternate", "type":"application/json", "title":"Meta data"}) + + # links.append({"href":"/", "rel":"search", "type":"text/html", "title":"Index"}) if args.all or args.dhtml: data['startRev'] = "0"