From 4b39b7eac1301a131fddfd72d659710b317c0c1f Mon Sep 17 00:00:00 2001 From: Lionel Dricot Date: Fri, 11 Feb 2022 11:23:28 +0100 Subject: [PATCH] releasing 0.3 --- CHANGELOG | 3 ++- offpunk.py | 17 ++++++++++------- setup.py | 2 +- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index d9d6ad5..757ff89 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,6 @@ # Offpunk History -## 0.3 - Unreleased +## 0.3 - Feb 11th 2022 New Features: - Gopher supported natively (early version, might have many bugs) - support for RSS and Atom feed (you can subscribe to them) @@ -15,6 +15,7 @@ Other Small Improvements: - Caching more problems to avoid refetch - Offpunk has now an User-Agent when http browsing to avoid being blocked as a bot - Changed XDG logic to improve compatibility (thanks Klaus Alexander) +=> gemini://rawtext.club/~ploum/2022-02-11-offpunk03.gmi ## 0.2 - Jan 31st 2022 - config directories have been moved to follow the XDG specifications diff --git a/offpunk.py b/offpunk.py index 4739b03..2e75ea1 100755 --- a/offpunk.py +++ b/offpunk.py @@ -12,7 +12,7 @@ # - Björn Wärmedal # - -_VERSION = "0.2" +_VERSION = "0.3" import argparse import cmd @@ -605,13 +605,16 @@ class HtmlRenderer(): g = GeminiItem(abs_url) if g.is_cache_valid(): img = g.get_cache_path() - img_obj = Image.open(img) - if hasattr(img_obj,"n_frames") and img_obj.n_frames > 1: - # we remove all frames but the first one - img_obj.save(img,save_all=False) - return_code = subprocess.run("chafa --bg white -s 40 %s -w 1"%img, \ + try: + img_obj = Image.open(img) + if hasattr(img_obj,"n_frames") and img_obj.n_frames > 1: + # we remove all frames but the first one + img_obj.save(img,save_all=False) + return_code = subprocess.run("chafa --bg white -s 40 %s -w 1"%img, \ shell=True, capture_output=True) - ansi_img = return_code.stdout.decode() + ansi_img = return_code.stdout.decode() + except: + ansi_img = "***image failed***\n" alt = element.get("alt") if alt: alt = sanitize_string(alt) diff --git a/setup.py b/setup.py index 503c4fe..cf17456 100755 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ from setuptools import setup setup( name='offpunk', - version='0.2', + version='0.3', description="Offline Command line Gemini client forked from AV-98.", author="Ploum", author_email="offpunk@ploum.eu",