File: offpunk-features.patch

package info (click to toggle)
offpunk 3.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 2,012 kB
  • sloc: python: 6,263; sh: 117; makefile: 2
file content (81 lines) | stat: -rw-r--r-- 3,160 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
Description: offpunk.py: fix --features argument.
 Running offpunk --features results in the following crash:
 .
 	$ offpunk --features
 	To render images inline, you need either chafa >= 1.10 or timg > 1.3.2
 	Traceback (most recent call last):
 	  File "/usr/bin/offpunk", line 8, in <module>
 	    sys.exit(main())
 	             ~~~~^^
 	  File "/usr/lib/python3/dist-packages/offpunk.py", line 2501, in main
 	    GeminiClient.do_version(None, None)
 	    ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^
 	  File "/usr/lib/python3/dist-packages/offpunk.py", line 1315, in do_version
 	    output += _("ftr_site_config     : ") + str(self.options["ftr_site_config"]) + "\n"
 	                                                ^^^^^^^^^^^^
 	AttributeError: 'NoneType' object has no attribute 'options'
 .
 Interestingly, running the `version` command from the prompt (which
 achieves mostly the same thing as --features) works as intended:
 .
 	$ offpunk
 	To render images inline, you need either chafa >= 1.10 or timg > 1.3.2
 	Welcome to Offpunk!
 	Type `help` to get the list of available command.
 	ON> version
 	Offpunk 3.0
 	===========
 	System: linux
 	Python: 3.13.12 (main, Feb  4 2026, 15:06:39) [GCC 15.2.0]
 	Language: C
 .
 	Highly recommended:
 	 - xdg-open            : 	Not Installed
 .
 	Web browsing:
 	 - python-requests     : 	Not Installed
 	 - python-feedparser   : 	Not Installed
 	 - python-bs4          : 	Not Installed
 	 - python-readability  : 	Not Installed
 	 - timg 1.3.2+         : 	Not Installed
 	 - chafa 1.10+         : 	Not Installed
 .
 	Nice to have:
 	 - python-setproctitle             : 	Not Installed
 	 - python-cryptography             : 	Not Installed
 	 - X11 clipboard (xsel or xclip)   : 	Not Installed
 	 - Wayland clipboard (wl-clipboard): 	Not Installed
 .
 	Features :
 	 - Render images (chafa or timg)              : 	Not Installed
 	 - Render HTML (bs4, readability)             : 	Not Installed
 	 - Render Atom/RSS feeds (feedparser)         : 	Not Installed
 	 - Connect to http/https (requests)           : 	Not Installed
 	 - Detect text encoding (python-chardet)      : 	Not Installed
 	 - restore last position (less 572+)          : 	Installed
 .
 	ftr_site_config     : None
 	Config directory    : /home/emollier/.config/offpunk/
 	User Data directory : /home/emollier/.local/share/offpunk/
 	Cache directory      : /home/emollier/.cache/offpunk/
 .
 Instantiating a GeminiClient to give a context to the "options"
 attribute works around the issue with --features, hence the present
 patch proposal, but there may exist cleaner approaches.
Author: Étienne Mollier <emollier@debian.org>
Forwarded: https://lists.sr.ht/~lioploum/offpunk-devel/patches/67592
Last-Update: 2026-02-11
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- offpunk.orig/offpunk.py
+++ offpunk/offpunk.py
@@ -2498,7 +2498,8 @@
         print("Offpunk " + __version__)
         sys.exit()
     elif args.features:
-        GeminiClient.do_version(None, None)
+        gc = GeminiClient(None)
+        gc.do_version(None, None)
         sys.exit()
     else:
         for f in [xdg("config"), xdg("data")]: