Add scripts to run tools locally

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 commit is contained in:
Austreelis 2023-09-08 16:01:03 +02:00 committed by Lionel Dricot
parent bc43e3150b
commit 370e7e4dc5
4 changed files with 12 additions and 0 deletions

3
ansicat.py Executable file
View File

@ -0,0 +1,3 @@
#!/usr/bin/env python3
from offpunk.ansicat import main
main()

3
netcache.py Executable file
View File

@ -0,0 +1,3 @@
#!/usr/bin/env python3
from offpunk.netcache import main
main()

3
offpunk/__main__.py Normal file
View File

@ -0,0 +1,3 @@
from . import main
main()

3
opnk.py Executable file
View File

@ -0,0 +1,3 @@
#!/usr/bin/env python3
from offpunk.opnk import main
main()