Midnight Commander extfslib
Midnight Commander extfslib helper library for writing extfs archive plugins.
Description
Extfslib help with building Midnight Commander extfs plugins, especially for those which operates on different kind of archives.
Simplest plugin built on top of this lib would be:
import extfslib
class MyArchive(extfslib.Archive):
ARCHIVER = "fancyarch"
def list(self):
if not self._contents:
return 1
for item in self._contents:
sys.stdout.buffer.write(self.ITEM % item)
arch = MyArchive('/path/to/file.fancyarch')
arch.list()
In this example class instance should be able to be called with list method. All methods:
list
copyin
copyout
rm
mkdir
rmdir
run
should be implemented if needed, since by default all of them are just defined, but not implemented.
Of course, real life example can be a little bit more complicated, since there would be possible need for adapting LINE_PAT which is regular expression for getting attributes for the list compatible with MC along with the ITEM which holds the output pattern and utilizes dictionary from LINE_PAT, CMD which maps between class and archiver commands. Possibly there might be needed some other adjustments.
Additionally there is an optional Config class, which might be used for reading Midnight Commander ini file (ususally located in ~/.config/mc/ini), so that for the example above:
import extfslib
class MyArchive(extfslib.Archive):
ARCHIVER = "fancyarch"
def __init__(self):
super().__init__()
self.conf = extfslib.Config(self)
if self.conf,getint('config_key'):
# do something
where the ini config file would contain:
…
[myarchive]
config_key = 300
…
So, section name [myarchive] must match class name in lower case, and name of the option is arbitrary string folowed by value. Note, the section and options must be added manually.
Installation
Install from Pypi
# pip install extfslib
or, as a user:
$ pip install extfslib --user
or use virtualenv:
$ git clone https://github.com/gryf/mc_extfslib
$ cd mc_extfslib
$ virtualenv venv
$ source venv/bin/activate
(venv) $ pip install
License
This software is licensed under 3-clause BSD license. See LICENSE file for details.
Metadata
Release files for extfslib 1.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| extfslib-1.4.tar.gz | 6.0 kB | Without provenance | Details for extfslib-1.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| extfslib-1.4-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details for extfslib-1.4-py2.py3-none-any.whl |
Total release size: 12.4 kB
Release files / extfslib-1.4.tar.gz
| Download URL | extfslib-1.4.tar.gz |
|---|---|
| Size | 6.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e0a93234aa0c8808cc0bb41cc02723b6eb9b966de27b84135a3a7842ecc2fe90
|
|
BLAKE2b-256 checksum How to use checksums |
f8197547130cf3922a9d79a8e062c22a707c4e64d71e6caaee5c3690834871cc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.5
|
Release files / extfslib-1.4-py2.py3-none-any.whl
| Download URL | extfslib-1.4-py2.py3-none-any.whl |
|---|---|
| Size | 6.4 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
ee9a8c424f2307cbb25117ac2ee682631d9ca861c97fb95cbd71421fd5e7bfd5
|
|
BLAKE2b-256 checksum How to use checksums |
373eca524e84b608a39106ad52381d36a8c934bd62c85109674027e7d098e030
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.5
|
Security for extfslib 1.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.