Commit Graph

856 Commits

Author SHA1 Message Date
Ploum e7831338de don’t crash ansicat if run without arguments 2023-11-09 12:46:47 +01:00
Ploum 5bf84c91fa documentation for ansicat/netcache/opnk 2023-11-09 12:36:32 +01:00
Ploum 24fe364f51 returns the good version number 2023-11-08 18:18:33 +01:00
Ploum 818257bcef renaming cache_migration to netcache_migration: fixes #25 2023-11-08 16:45:27 +01:00
Ploum ac78e85d04 Fixes bug #26
- make python-requests optional again
- reimplement --disable-http which had no effect
2023-11-08 16:37:13 +01:00
Ploum 8d082cb2df migration to hatchling and 2.0-beta2 release 2023-11-08 11:37:29 +01:00
Jean Abou Samra e1e25b9456 Simple packaging fix
--=-6tQG7FEKAZyWWN9kR8o8
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Hi Ploum,

I'm the author of the "d=C3=A9p=C3=AAche" you commented on here:

https://linuxfr.org/news/l-installation-et-la-distribution-de-paquets-pytho=
n-1-4#comment-1940663

I skimmed at your problem. I admit I have not read all packaging-related
threads on this mailing list. If I understand correctly, you want
to keep using the (relatively non-standard) current setup of
Offpunk, namely a bunch of scripts at the root of the source tree.

You can't do that with Flit, because it's an opinionated tool
which insists that you do it the more standard way. So here's
a simple patch that does it with hatchling instead.

You might also want to review the dependency list in pyproject.toml.
I see "timg>=3D1.3.2", but the latest version of timg on PyPI
is 1.1.6.

Best,
Jean

From 90b3b2ab3700c57f76d3ae5760a4f49048bca70d Mon Sep 17 00:00:00 2001
From: Jean Abou Samra <jean@abou-samra.fr>
Date: Tue, 7 Nov 2023 23:16:43 +0100
Subject: [PATCH] Basic fix for packaging

Flit is not suitable for this project because it insists on packaging a
single package, while Ploum insists on keeping top-level scripts that
aren't inside a package. Use hatchling instead.

To test:

$ python -m venv temp-test-venv # may require "apt install python3-venv" or such
$ source temp-test-venv/bin/activate
$ pip install .[http]
$ offpunk
$ deactivate

To check the build artifacts:

$ python -m build # may require "apt install python3-build" or such
$ cd dist
$ tar -xvf offpunk-2.0b1.tar.gz # check files, this should contain everything
$ unzip offpunk-2.0b1-py3-none-any.whl # check files, this should contain only Python modules (plus a dist-info directory)
2023-11-08 11:34:03 +01:00
Ploum 51dc856161 small debug for netcache 2023-11-08 10:25:39 +01:00
Ploum 856b89ff45 fixes a crash when parsing invalid RSS dates 2023-11-03 23:01:46 +01:00
Ploum bf17b21b30 fixes hang/crash when meeting ; itemtype in gopher 2023-11-01 23:45:47 +01:00
Ploum 29c447cd8e Revert completely previous fix.
Instead, if we do not support an inline image format, we don’t display
it at all instead of displaying a fake URL
2023-10-20 00:06:59 +02:00
Ploum 979b80c5bd fixes a crash with data:image/svg+xml links 2023-10-20 00:02:35 +02:00
Ploum f05adf1b59 solve a crash with tour when argument and no url 2023-10-19 13:34:26 +02:00
Ploum 924eed3775 fixes a crash with some invalid URLs 2023-10-14 17:22:47 +02:00
Ploum 010288a6fb fixes input in Gemini 2023-10-12 15:23:59 +02:00
Ploum 2b234cdc43 initial tentative to support podcast RSS/atom feeds 2023-10-09 13:26:12 +02:00
Ploum deaa199303 gemtext renderer should be the default, not plaintextrenderer 2023-10-08 00:23:08 +02:00
Ploum 1baf311f2c new html parsing for titles 2023-10-07 23:54:58 +02:00
Ploum d50bc5a8e2 force closing html title elements 2023-10-07 23:45:01 +02:00
Ploum f6cb7723e1 experimental: new plaintext renderer. Also used to view source 2023-10-07 23:30:09 +02:00
Ploum c19576bc43 shame on me: never commit without having launching the thing 2023-10-05 18:22:10 +02:00
Ploum d50925ce03 should fix ~lioploum/offpunk#24 2023-10-05 18:17:01 +02:00
Ploum 5dd2238ef2 don’t crash if there’s no XMLParsedAsHTMLWarning in BS4 (as we are trying to avoid them anyway 2023-10-05 14:27:58 +02:00
Ploum 4892b9e450 fixes a crash reported by Xavier Maillard for RSS feeds without link elemnet 2023-10-01 14:04:17 +02:00
Lionel Dricot eeae7e3ad7 put blocked URLs in its own file to make contributions easier 2023-09-26 22:21:19 +02:00
Lionel Dricot 7ffbd1b288 adding a comment to understand what I did 2023-09-25 11:05:55 +02:00
Austreelis 39c5f17a39 Fix None prompt until manually changed
The GeminiClient's constructor expected set_prompt to return the prompt,
while the function directly mutated it without returning anything.

This manifested as having "None" as prompt instead of the default "ON>", until
entering the offline command.

This patch both fixes the constructor by not setting self.prompt to the
result of GeminiClient.set_prompt, *and* make that function return the
prompt as well. Each of those is a separated hunk, feel free to only
apply whichever feels best (though applying both should warrant any
future mistake of the sort).

Signed-off-by: Austreelis <dev@austreelis.net>
2023-09-23 11:00:35 +02:00
Lionel Dricot f8d185eac9 ignoring encoding errors in ansicat 2023-09-23 10:42:45 +02:00
Lionel Dricot 8c752d7b44 fixed an an/or logical confusion that would cause non-displayable documents to be marked as to be refetched even when not necessary 2023-09-19 14:24:18 +02:00
Lionel Dricot f33a4cb1e9 use chafa by default if version >= 1.10 2023-09-15 21:54:51 +02:00
Lionel Dricot a2678bfdf5 prompt color is now part of the theme too 2023-09-14 21:35:23 +02:00
Lionel Dricot ea82e81d75 Improve handling of base64 images
Also makes images links absolute in the rendering
2023-09-13 21:49:52 +02:00
Lionel Dricot 7a606b71cf some ugly code to filter XMLparsedAsHTMLWarning from BS4 2023-09-12 18:06:42 +02:00
Lionel Dricot 0666aaaa7a fixes opening mailto links 2023-09-11 17:26:57 +02:00
Lionel Dricot dc238309dd fixes gophermap being badly rendered as gemtext 2023-09-11 10:47:38 +02:00
Austreelis 5f3d8d69be Update license classifier in pyproject.toml
The previous one wasn't listed on
[pypy's list](https://pypi.org/pypi?%3Aaction=list_classifiers), which
made flit 3.9.0 refuse to build offpunk (I didn't investigate this
much).
2023-09-08 15:29:58 +02:00
Lionel Dricot 47317ca113 --sync now taking list names as arguments 2023-09-07 16:38:48 +02:00
Lionel Dricot 4c47f28f3f Releasing 2.0-beta1 - September 05th 2023
This is an an experimental release. Bug reports and feedbacks are welcome on the offpunk-devel list.
- WARNING: pyproject.toml has not been updated and is currently non-functional. Help needed!
- IMPORTANT: Licence has been changed to AGPL for ideological reasons
- IMPORTANT: Contact adress has been changed to offpunk2 on the same domain (because of spam)
- IMPORTANT: code has been splitted into 7 differents files. Installation/packaging should be adapted.
Major features:
- New command-line tool: "netcache"
- New command-line tool: "ansicat"
- New command-line tool: "opnk"
- "theme" command allows customization of the colours
- "--config-file" allows to start offpunk with custom config (#16)
Improvments:
- Reading position is saved for the whole session
- Rendering is cached for the session, allowing faster browsing of a page already visited
- "redirect" supports domains starting with "*" to also block all subdomins
- "--images-mode" allow to choose at startup which images should be dowloaded (none,readable,full)
- Support for multi-format rendering (such as RSS feeds with html elements)
- The cache is now automatically upgraded if needed (see .version in your cache)
Other changes from 1.X:
- Images of html files are now downloaded with the html (slower sync but better reading experience)
- URL do not default anymore to "gemini://" if not protocol are indicated. (ongoing discussion in #21)
- "accept_bad_ssl_certificates" now more agressive for http and really accepts them all
- Gopher-only: we don’t support naming a page after the name of the incoming link
- Gemini-only: support for client generated certificates has been removed
- "file" is now marked as a dependency (thank Guillaume Loret)
2023-09-05 14:03:15 +02:00
Lionel Dricot 53b310507f allows offpunk to run with older cryptography package 2023-09-05 11:52:30 +02:00
Lionel Dricot be71ba8c75 - version was crashing since the refactoring
- History is now created if it doesn’t exist
2023-09-04 20:59:32 +02:00
Lionel Dricot b1effe57b6 not trying to display absent images 2023-09-04 10:29:14 +02:00
Lionel Dricot e14009f2a4 ansicat working again alone 2023-09-03 23:20:54 +02:00
Lionel Dricot 1a2cff83af themes are now applied instantly 2023-09-02 12:41:55 +02:00
Lionel Dricot 2fa2fbc718 support blocking subdomains with * 2023-08-31 21:35:08 +02:00
Lionel Dricot 28d22c4d11 do not try to open files if they dont exist 2023-08-31 20:45:52 +02:00
Lionel Dricot 446c940820 error proofing fetch-later 2023-08-31 20:39:13 +02:00
Lionel Dricot 4c328e32aa don’t add history to itself 2023-08-31 15:49:20 +02:00
Lionel Dricot b001ade107 correctly close background ansi codes 2023-08-31 14:59:18 +02:00
Lionel Dricot 514e853b6b create cache dir if it doesn’t exists. Thanks mart-e for reporting the bug. 2023-08-31 11:01:52 +02:00
Lionel Dricot 0c2b24dd89 Themes and reload
- added background colours to theme
- theme for blockquote and preformatted in gemtext (untested)
- cleanup cache on reload
2023-08-31 10:53:24 +02:00