This adds a script for each executable, and a __main__.py for offpunk
itself. This intends to "fix" (albeit unperfectly, see below) how
46f61bf forbade locally running executables without first installing
offpunk in your site packages (or hacking on PYTHONPATH).
Of those, most are "glue script", files in the top-level directory
and outside offpunk's module, which are purely there to allow running
the `netcache`, `ansicat` and `opnk` without any other setup than a
working python and a `git clone`. Notably, they will not be included in
the source distribution (sdist) archive built by flit.
Sadly the `offpunk` executable doesn't get the same treatment, because
having both an `offpunk.py` script and an `offpunk` python package
is ambiguous, and flit disallows that, avoiding to package anything.
So instead it now has a pretty bare __main__.py, which really works the
same way as the "glue scripts", except this one does get packaged.
This means everything but `offpunk` may be run like `./netcache.py`,
making this setup a bit inconsistent (which may or may not be an issue).
Running `python -m <tool>` works for everything though, so there *is* a
consistent way to run them all, and in the darkness, bind them.
This moves around and renames a bunch of code, as an effort toward
fixing the flit build process. Simply put, all source code has been
moved in an `offpunk` directory, and renamed in ways that (hopefully)
make sense. The `pyproject.toml` file has been updated, too.
This changes how to import code from offpunk modules: old top-level
modules are now under `offpunk` (`import netcache` ->
`from offpunk import netcache`), and "off" prefixes have been stripped
(`from offutils import run` -> `from offpunk.utils import run`).
Note file mode x (execute) was removed on all touched files (if it was
set before), meaning they cannot be executed exactly like before this
change. Running scripts directly (`./offpunk/netcache.py`) is broken
because python doesn't populate parent modules of top-level modules.
Running `python -m offpunk.netcache` is broken because running inner
python modules as top-level this way *does* populate parent modules
(assuming my understanding is correct, but it may very well not be), but
it can somehow trigger undefined behavior (!?). Running
`python -m offpunk` still works though.
Signed-off-by: Austreelis <dev@austreelis.net>
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)
Before the change, ansicat, netcache and opnk assume that the
interpreter location is always /bin/python. While some distributions
do provide python at this location, even as a python3 interpreter,
some others such as Debian do not provide a plain python interpreter
anymore, at least not by default. There exist packages to provide the
version 2 or the version 3 of the interpreter at that location, but
the three possible configurations (v2, v3 or none) are left at the
discretion of the administrator, so in practice can't really be
predicted in advance.
This change applies the same shebang as offpunk.py and the cache
migration script. Use of /usr/bin/env has also the side effect of
easing use of python3 interpreters installed at weird locations.
Signed-off-by: Étienne Mollier <emollier@debian.org>
This patch add stubs of documentation for ansicat(1), netcache(1),
migrate-offpunk-cache(1) and opnk(1) in prevision of offpunk 2.0
release. The migration script manual notably resolves issue #15.
Signed-off-by: Étienne Mollier <emollier@debian.org>
Lot of html pages are now recognized as application/javascript. We now
force the HtmlRenderer for application/javascript.
Contact address has also be changed to offpunk2 everywhere