From e89ad77b51faf3fe0d086e78b73ecdaadeff592f Mon Sep 17 00:00:00 2001 From: gryf Date: Sun, 2 Oct 2022 10:14:46 +0200 Subject: [PATCH] Separate uadf from extfslib --- README.rst | 98 +++------------------ extfslib.py | 241 ---------------------------------------------------- ulha | 182 --------------------------------------- ulzx | 135 ----------------------------- 4 files changed, 10 insertions(+), 646 deletions(-) delete mode 100644 extfslib.py delete mode 100755 ulha delete mode 100755 ulzx diff --git a/README.rst b/README.rst index 508f4dc..fae1cc3 100644 --- a/README.rst +++ b/README.rst @@ -1,96 +1,14 @@ -======================== -Midnight Commander extfs -======================== +======================= +Midnight Commander uadf +======================= -Those are Midnight Commander extfs plugins for handling several archive types -mostly known from AmigaOS - like **lha**, **lzx** and disk images like **adf** -and **dms**. - -Installation -============ - -See individual installation plugins below. Basically it comes down to: - -* copying ``extfslib.py`` and plugin files to ``~/.local/share/mc/extfs.d/`` -* installing binary handlers (lha, unlzx, xdms and unadf) -* adding an entry in ``~/.config/mc/mc.ext``:: - - # arch - regex/\.pattern$ - Open=%cd %p/handler_filename:// - -ULha -==== - -ULha is an extfs plugin which can be used with lha/lzh/lharc archives. -Personally, I've use it almost exclusively for archives created long time ago -on my Amiga. Both reading from and writing into archive was implemented. - -Requirements ------------- - -ULha requires `free lha `_ implementation to work. - -Installation ------------- - -* copy ``extfslib.py`` and ``ulha`` to ``~/.local/share/mc/extfs.d/`` -* add or change entry for files handle in ``~/.config/mc/mc.ext``:: - - # lha - regex/\.[lL]([Hh][aA]|[Zz][hH])$ - Open=%cd %p/ulha:// - View=%view{ascii} lha l %f - -ULzx -==== - -ULzx is an extfs plugin which can be used to browse and extract lzx archives, -which are known almost exclusively from Amiga. - -Due to limitations of -`unlzx `_ tools, -only reading is supported. Also be aware, that -`unlzx `_ cannot -extract files individually, so copying entire archive content is not -recommended, since on every single file a full archive extract would be -performed, which in the end would have impact on performance. - -Requirements ------------- - -ULzx requires -`unlzx `_ tool. - -Installation ------------- - -* copy ``extfslib.py`` and ``ulzx`` to ``~/.local/share/mc/extfs.d/`` -* add or change entry for files handle in ``~/.config/mc/mc.ext``:: - - # lzx - regex/\.[lL][zZ][xX]$ - Open=%cd %p/ulzx:// - View=%view{ascii} unlzx -v %f - -UAdf -==== - -UAdf is an extfs plugin suitable for reading .adf, .adz and .dms Amiga floppy -disk images. Due to limitations of the -`unadf `_, file access inside disk image is -read only. - -In case of corrupted or no-dos images, message will be shown. +Midnight Commander extfs plugin for handling Amiga adf/dms floppy images. Requirements ------------ It requires ``unadf`` utility from `ADFlib `_ -repository, with included `that commit -`_ -in particular, which introduced separation between filename and comment -attribute on Amiga Fast File System. +repository. If it turns out that your distribution doesn't provide proper version of ADFlib, there will be a need for building it by hand. @@ -131,7 +49,8 @@ needed. Installation ------------ -* copy ``extfslib.py`` and ``uadf`` to ``~/.local/share/mc/extfs.d/`` +* install `extfslib`_ +* copy ``uadf`` to ``~/.local/share/mc/extfs.d/`` * add or change entry for files handle in ``~/.config/mc/mc.ext``:: # adf @@ -152,3 +71,6 @@ License This software is licensed under 3-clause BSD license. See LICENSE file for details. + + +.. _extfslib: https://github.com/gryf/mc_extfs diff --git a/extfslib.py b/extfslib.py deleted file mode 100644 index d828cf5..0000000 --- a/extfslib.py +++ /dev/null @@ -1,241 +0,0 @@ -""" -extfslib is a library which contains Archive class to support writing extfs -plugins for Midnight Commander. - -Tested against python 3.6 and mc 4.8.22 - -Changelog: - 1.2 Switch to python3 - 1.1 Added item pattern, and common git/uid attrs - 1.0 Initial release - -Author: Roman 'gryf' Dobosz -Date: 2019-06-30 -Version: 1.2 -Licence: BSD -""" -import argparse -import os -import sys -import re -from subprocess import check_output, CalledProcessError - - -class Archive(object): - """Archive handle. Provides interface to MC's extfs subsystem""" - LINE_PAT = re.compile(b"^(?P)\s" - b"(?P)\s" - b"(?P)\s" - b"(?P)\s" - b"(?P)\s+" - b"(?P