Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ffb99d6515 | |||
| c8407ff57b |
23
README.rst
23
README.rst
@@ -6,7 +6,8 @@ Those are Midnight Commander extfs plugins for handling several archive types.
|
|||||||
|
|
||||||
Installation
|
Installation
|
||||||
============
|
============
|
||||||
See individual installation plugins below. Basically it come down to:
|
|
||||||
|
See individual installation plugins below. Basically it comes down to:
|
||||||
|
|
||||||
* copying ``extfslib.py`` and plugin files to ``~/.local/share/mc/extfs/``
|
* copying ``extfslib.py`` and plugin files to ``~/.local/share/mc/extfs/``
|
||||||
* installing binary handlers (lha, unlzx, xdms and unadf)
|
* installing binary handlers (lha, unlzx, xdms and unadf)
|
||||||
@@ -18,16 +19,19 @@ See individual installation plugins below. Basically it come down to:
|
|||||||
|
|
||||||
ULha
|
ULha
|
||||||
====
|
====
|
||||||
|
|
||||||
ULha is an extfs plugin which can be used with lha/lzh/lharc archives.
|
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
|
Personally, I've use it almost exclusively for archives created long time ago
|
||||||
on my Amiga. Both reading and writing into archive was implemented.
|
on my Amiga. Both reading from and writing into archive was implemented.
|
||||||
|
|
||||||
Requirements
|
Requirements
|
||||||
------------
|
------------
|
||||||
|
|
||||||
ULha requires `free lha <http://lha.sourceforge.jp>`_ implementation to work.
|
ULha requires `free lha <http://lha.sourceforge.jp>`_ implementation to work.
|
||||||
|
|
||||||
Installation
|
Installation
|
||||||
------------
|
------------
|
||||||
|
|
||||||
* copy ``extfslib.py`` and ``ulha`` to ``~/.local/share/mc/extfs/``
|
* copy ``extfslib.py`` and ``ulha`` to ``~/.local/share/mc/extfs/``
|
||||||
* add or change entry for files handle in ``~/.config/mc/mc.ext``::
|
* add or change entry for files handle in ``~/.config/mc/mc.ext``::
|
||||||
|
|
||||||
@@ -38,24 +42,27 @@ Installation
|
|||||||
|
|
||||||
ULzx
|
ULzx
|
||||||
====
|
====
|
||||||
|
|
||||||
ULzx is an extfs plugin which can be used to browse and extract lzx archives,
|
ULzx is an extfs plugin which can be used to browse and extract lzx archives,
|
||||||
which are known almost exclusively from Amiga.
|
which are known almost exclusively from Amiga.
|
||||||
|
|
||||||
Due to limitations of
|
Due to limitations of
|
||||||
`unlzx <ftp://us.aminet.net/pub/aminet/misc/unix/unlzx.c.gz.readme>`_ tools,
|
`unlzx <ftp://us.aminet.net/pub/aminet/misc/unix/unlzx.c.gz.readme>`_ tools,
|
||||||
only reading is supported. Also be aware, that
|
only reading is supported. Also be aware, that
|
||||||
`unlzx <ftp://us.aminet.net/pub/aminet/misc/unix/unlzx.c.gz.readme>`_ tool
|
`unlzx <ftp://us.aminet.net/pub/aminet/misc/unix/unlzx.c.gz.readme>`_ cannot
|
||||||
cannot extract files individually, so copying entire archive content is not
|
extract files individually, so copying entire archive content is not
|
||||||
recommended, since on every file a full archive extract would be performed,
|
recommended, since on every single file a full archive extract would be
|
||||||
which in the end would have impact on performance.
|
performed, which in the end would have impact on performance.
|
||||||
|
|
||||||
Requirements
|
Requirements
|
||||||
------------
|
------------
|
||||||
|
|
||||||
ULzx requires
|
ULzx requires
|
||||||
`unlzx <ftp://us.aminet.net/pub/aminet/misc/unix/unlzx.c.gz.readme>`_ tool.
|
`unlzx <ftp://us.aminet.net/pub/aminet/misc/unix/unlzx.c.gz.readme>`_ tool.
|
||||||
|
|
||||||
Installation
|
Installation
|
||||||
------------
|
------------
|
||||||
|
|
||||||
* copy ``extfslib.py`` and ``ulzx`` to ``~/.local/share/mc/extfs/``
|
* copy ``extfslib.py`` and ``ulzx`` to ``~/.local/share/mc/extfs/``
|
||||||
* add or change entry for files handle in ``~/.config/mc/mc.ext``::
|
* add or change entry for files handle in ``~/.config/mc/mc.ext``::
|
||||||
|
|
||||||
@@ -66,12 +73,13 @@ Installation
|
|||||||
|
|
||||||
UAdf
|
UAdf
|
||||||
====
|
====
|
||||||
|
|
||||||
UAdf is an extfs plugin suitable for reading .adf, .adz and .dms Amiga floppy
|
UAdf is an extfs plugin suitable for reading .adf, .adz and .dms Amiga floppy
|
||||||
disk images. Due to limitations of the
|
disk images. Due to limitations of the
|
||||||
`unadf <http://freecode.com/projects/unadf>`_, file access inside disk image is
|
`unadf <http://freecode.com/projects/unadf>`_, file access inside disk image is
|
||||||
read only.
|
read only.
|
||||||
|
|
||||||
Note, that in case of no-dos images, directory listing will be empty.
|
In case of corrupted or no-dos images, message will be shown.
|
||||||
|
|
||||||
Requirements
|
Requirements
|
||||||
------------
|
------------
|
||||||
@@ -112,6 +120,7 @@ needed.
|
|||||||
|
|
||||||
Installation
|
Installation
|
||||||
------------
|
------------
|
||||||
|
|
||||||
* copy ``extfslib.py`` and ``uadf`` to ``~/.local/share/mc/extfs/``
|
* copy ``extfslib.py`` and ``uadf`` to ``~/.local/share/mc/extfs/``
|
||||||
* add or change entry for files handle in ``~/.config/mc/mc.ext``::
|
* add or change entry for files handle in ``~/.config/mc/mc.ext``::
|
||||||
|
|
||||||
|
|||||||
@@ -5,11 +5,12 @@ plugins for Midnight Commander.
|
|||||||
Tested against python 2.7 and mc 4.8.7
|
Tested against python 2.7 and mc 4.8.7
|
||||||
|
|
||||||
Changelog:
|
Changelog:
|
||||||
|
1.1 Added item pattern, and common git/uid attrs
|
||||||
1.0 Initial release
|
1.0 Initial release
|
||||||
|
|
||||||
Author: Roman 'gryf' Dobosz <gryf73@gmail.com>
|
Author: Roman 'gryf' Dobosz <gryf73@gmail.com>
|
||||||
Date: 2013-05-12
|
Date: 2013-05-12
|
||||||
Version: 1.0
|
Version: 1.1
|
||||||
Licence: BSD
|
Licence: BSD
|
||||||
"""
|
"""
|
||||||
import os
|
import os
|
||||||
@@ -32,11 +33,15 @@ class Archive(object):
|
|||||||
"read": "r",
|
"read": "r",
|
||||||
"write": "w",
|
"write": "w",
|
||||||
"delete": "d"}
|
"delete": "d"}
|
||||||
|
ITEM = ("%(perms)s 1 %(uid)-8s %(gid)-8s %(size)8s %(datetime)s "
|
||||||
|
"%(display_name)s\n")
|
||||||
|
|
||||||
def __init__(self, fname):
|
def __init__(self, fname):
|
||||||
"""Prepare archive content for operations"""
|
"""Prepare archive content for operations"""
|
||||||
if not os.path.exists(fname):
|
if not os.path.exists(fname):
|
||||||
raise OSError("No such file or directory `%s'" % fname)
|
raise OSError("No such file or directory `%s'" % fname)
|
||||||
|
self._uid = os.getuid()
|
||||||
|
self._gid = os.getgid()
|
||||||
self._arch = fname
|
self._arch = fname
|
||||||
self._contents = self._get_dir()
|
self._contents = self._get_dir()
|
||||||
|
|
||||||
|
|||||||
17
uadf
17
uadf
@@ -18,12 +18,13 @@ if comment or filename already contains any comma.
|
|||||||
It also requires xdms utility, for optional dms support.
|
It also requires xdms utility, for optional dms support.
|
||||||
|
|
||||||
Changelog:
|
Changelog:
|
||||||
|
1.2 Added failsafe for filenames in archive with spaces and nodos message.
|
||||||
1.1 Moved common code into extfslib library
|
1.1 Moved common code into extfslib library
|
||||||
1.0 Initial release
|
1.0 Initial release
|
||||||
|
|
||||||
Author: Roman 'gryf' Dobosz <gryf73@gmail.com>
|
Author: Roman 'gryf' Dobosz <gryf73@gmail.com>
|
||||||
Date: 2013-05-12
|
Date: 2013-05-16
|
||||||
Version: 1.1
|
Version: 1.2
|
||||||
Licence: BSD
|
Licence: BSD
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@@ -53,8 +54,6 @@ class UAdf(Archive):
|
|||||||
"write": "w",
|
"write": "w",
|
||||||
"delete": "d"}
|
"delete": "d"}
|
||||||
DATETIME = "%s-%s-%s %02d:%s"
|
DATETIME = "%s-%s-%s %02d:%s"
|
||||||
ITEM = ("%(perms)s 1 %(uid)-8s %(gid)-8s %(size)8s %(datetime)s "
|
|
||||||
"%(display_name)s\n")
|
|
||||||
|
|
||||||
def __init__(self, fname):
|
def __init__(self, fname):
|
||||||
"""Prepare archive content for operations"""
|
"""Prepare archive content for operations"""
|
||||||
@@ -141,6 +140,10 @@ class UAdf(Archive):
|
|||||||
Convert filenames to be Unix filesystem friendly
|
Convert filenames to be Unix filesystem friendly
|
||||||
Add suffix to show user what kind of file do he dealing with.
|
Add suffix to show user what kind of file do he dealing with.
|
||||||
"""
|
"""
|
||||||
|
if not self._contents:
|
||||||
|
sys.stderr.write("Nodos or archive error\n")
|
||||||
|
return 1
|
||||||
|
|
||||||
for entry in self._contents:
|
for entry in self._contents:
|
||||||
sys.stdout.write(self.ITEM % entry)
|
sys.stdout.write(self.ITEM % entry)
|
||||||
return 0
|
return 0
|
||||||
@@ -151,6 +154,12 @@ class UAdf(Archive):
|
|||||||
if not real_src:
|
if not real_src:
|
||||||
raise IOError("No such file or directory")
|
raise IOError("No such file or directory")
|
||||||
|
|
||||||
|
if " " in real_src:
|
||||||
|
sys.stderr.write("unadf is unable to operate on filepath with "
|
||||||
|
"space inside.\nUse affs to mount image and than"
|
||||||
|
" extract desired files.\n")
|
||||||
|
return 1
|
||||||
|
|
||||||
extract_dir = mkdtemp()
|
extract_dir = mkdtemp()
|
||||||
cmd = ["unadf", self._arch, real_src, "-d", extract_dir]
|
cmd = ["unadf", self._arch, real_src, "-d", extract_dir]
|
||||||
if check_call(cmd, stdout=open(os.devnull, 'wb'),
|
if check_call(cmd, stdout=open(os.devnull, 'wb'),
|
||||||
|
|||||||
9
ulha
9
ulha
@@ -7,12 +7,13 @@ Tested against python 2.7, lha[1] 1.14 and mc 4.8.7
|
|||||||
[1] http://lha.sourceforge.jp
|
[1] http://lha.sourceforge.jp
|
||||||
|
|
||||||
Changelog:
|
Changelog:
|
||||||
|
1.2 Moved item pattern to extfslib module
|
||||||
1.1 Moved common code into extfslib library
|
1.1 Moved common code into extfslib library
|
||||||
1.0 Initial release
|
1.0 Initial release
|
||||||
|
|
||||||
Author: Roman 'gryf' Dobosz <gryf73@gmail.com>
|
Author: Roman 'gryf' Dobosz <gryf73@gmail.com>
|
||||||
Date: 2013-05-12
|
Date: 2013-05-16
|
||||||
Version: 1.1
|
Version: 1.2
|
||||||
Licence: BSD
|
Licence: BSD
|
||||||
"""
|
"""
|
||||||
import os
|
import os
|
||||||
@@ -43,8 +44,7 @@ class ULha(Archive):
|
|||||||
"read": "pq",
|
"read": "pq",
|
||||||
"write": "aq",
|
"write": "aq",
|
||||||
"delete": "dq"}
|
"delete": "dq"}
|
||||||
ITEM = ("%(perms)s 1 %(uid)-8s %(gid)-8s %(size)8s %(month)s %(day)s "
|
DATETIME = "%(month)s %(day)s %(yh)s"
|
||||||
"%(yh)s %(display_name)s\n")
|
|
||||||
|
|
||||||
def _get_dir(self):
|
def _get_dir(self):
|
||||||
"""Prepare archive file listing"""
|
"""Prepare archive file listing"""
|
||||||
@@ -72,6 +72,7 @@ class ULha(Archive):
|
|||||||
# really care about real user/group
|
# really care about real user/group
|
||||||
entry['uid'] = self._uid
|
entry['uid'] = self._uid
|
||||||
entry['gid'] = self._gid
|
entry['gid'] = self._gid
|
||||||
|
entry['datetime'] = self.DATETIME % entry
|
||||||
|
|
||||||
if not entry['perms']:
|
if not entry['perms']:
|
||||||
entry['perms'] = perms
|
entry['perms'] = perms
|
||||||
|
|||||||
Reference in New Issue
Block a user