Skip to main content

Midnight Commander extfslib helper library for writing extfs archive plugins.

Project description

https://img.shields.io/pypi/v/extfslib.svg

Midnight Commander extfslib helper library for writing extfs archive plugins.

Description

Extfslib help with building Midnight Commander extf 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.

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

extfslib-1.1.tar.gz (5.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

extfslib-1.1-py2.py3-none-any.whl (5.7 kB view details)

Uploaded Python 2Python 3

File details

Details for the file extfslib-1.1.tar.gz.

File metadata

  • Download URL: extfslib-1.1.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.6

File hashes

Hashes for extfslib-1.1.tar.gz
Algorithm Hash digest
SHA256 3f1e7ccad6335af6e4573e5454bc46de3bce5f036c20f96576d07b2f52bf824e
MD5 643e2bb4dec02b4956d48cc0ee82c732
BLAKE2b-256 4eb946246495077f145c5e72619c5bed1462033f78c34a6cf37c4020119fe6d7

See more details on using hashes here.

File details

Details for the file extfslib-1.1-py2.py3-none-any.whl.

File metadata

  • Download URL: extfslib-1.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 5.7 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.6

File hashes

Hashes for extfslib-1.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 5d3f084306b9183b500182028c9839cc05f058dd74e21c07068527f794bc3e91
MD5 60b766ad1c5c3e1741affb22ca0d0470
BLAKE2b-256 0bd00fec5949a49f45f078a95f8cee5654709f6a69b350bdca40848ad56d992a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page