From 100f69ebe7b6b447faa0d4fa200566c9c469a6e0 Mon Sep 17 00:00:00 2001 From: Lionel Dricot Date: Fri, 4 Mar 2022 23:56:57 +0100 Subject: [PATCH] releasing 0.9 --- CHANGELOG | 2 +- offpunk.py | 9 +++++---- setup.py | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index b809b12..7589600 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,6 @@ # Offpunk History -## 0.5 - Unreleased +## 0.9 - March 05th 2022 - Initial Spartan protocol support - Http links with content above 20Mo are not downloaded during sync (except when explicitely requested) - Improving subscriptions with more feedback and better detection diff --git a/offpunk.py b/offpunk.py index e044d43..f2dd078 100755 --- a/offpunk.py +++ b/offpunk.py @@ -12,7 +12,7 @@ # - Björn Wärmedal # - -_VERSION = "0.4" +_VERSION = "0.9" import argparse import cmd @@ -252,6 +252,8 @@ _MIME_HANDLERS = { # see https://github.com/python/cpython/blob/master/Lib/urllib/parse.py urllib.parse.uses_relative.append("gemini") urllib.parse.uses_netloc.append("gemini") +urllib.parse.uses_relative.append("spartan") +urllib.parse.uses_netloc.append("spartan") global TERM_WIDTH TERM_WIDTH = 80 @@ -1367,8 +1369,8 @@ def looks_like_url(word): #sometimes, urllib crashed only when requesting the port port = parsed.port mailto = word.startswith("mailto:") - start = word.startswith("gemini://") or word.startswith("http://")\ - or word.startswith("https://") + scheme = word.split("://")[0] + start = scheme in standard_ports if not start and not mailto: return looks_like_url("gemini://"+word) elif mailto: @@ -1765,7 +1767,6 @@ class GeminiClient(cmd.Cmd): parts = response.split(" ",maxsplit=1) code,meta = int(parts[0]),parts[1] if code == 2: - print("spartan file %s "%meta) body = fp.read() if meta.startswith("text"): body = body.decode("UTF-8") diff --git a/setup.py b/setup.py index 972ef16..d099049 100755 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ from setuptools import setup setup( name='offpunk', - version='0.4', + version='0.9', description="Offline Command line Gemini client forked from AV-98.", author="Ploum", author_email="offpunk@ploum.eu",