Corrected couple of typos and missaligements
This commit is contained in:
@@ -11,7 +11,7 @@ Midnight Commander extfslib helper library for writing extfs archive plugins.
|
|||||||
Description
|
Description
|
||||||
===========
|
===========
|
||||||
|
|
||||||
Extfslib help with building Midnight Commander extf plugins, especially for
|
Extfslib help with building Midnight Commander extfs plugins, especially for
|
||||||
those which operates on different kind of archives.
|
those which operates on different kind of archives.
|
||||||
|
|
||||||
Simplest plugin built on top of this lib would be:
|
Simplest plugin built on top of this lib would be:
|
||||||
@@ -37,8 +37,8 @@ Simplest plugin built on top of this lib would be:
|
|||||||
arch.list()
|
arch.list()
|
||||||
|
|
||||||
|
|
||||||
In this example class instance should be able to be called with ``list`` method.
|
In this example class instance should be able to be called with ``list``
|
||||||
All methods:
|
method. All methods:
|
||||||
|
|
||||||
- ``list``
|
- ``list``
|
||||||
- ``copyin``
|
- ``copyin``
|
||||||
|
|||||||
20
extfslib.py
20
extfslib.py
@@ -23,13 +23,13 @@ from subprocess import check_output, CalledProcessError
|
|||||||
|
|
||||||
class Archive(object):
|
class Archive(object):
|
||||||
"""Archive handle. Provides interface to MC's extfs subsystem"""
|
"""Archive handle. Provides interface to MC's extfs subsystem"""
|
||||||
LINE_PAT = re.compile(b"^(?P<size>)\s"
|
LINE_PAT = re.compile(br"^(?P<size>)\s"
|
||||||
b"(?P<perms>)\s"
|
br"(?P<perms>)\s"
|
||||||
b"(?P<uid>)\s"
|
br"(?P<uid>)\s"
|
||||||
b"(?P<gid>)\s"
|
br"(?P<gid>)\s"
|
||||||
b"(?P<date>)\s+"
|
br"(?P<date>)\s+"
|
||||||
b"(?P<time>)\s"
|
br"(?P<time>)\s"
|
||||||
b"(?P<fpath>)")
|
br"(?P<fpath>)")
|
||||||
ARCHIVER = b"archiver_name"
|
ARCHIVER = b"archiver_name"
|
||||||
CMDS = {"list": b"l",
|
CMDS = {"list": b"l",
|
||||||
"read": b"r",
|
"read": b"r",
|
||||||
@@ -145,7 +145,7 @@ class Archive(object):
|
|||||||
|
|
||||||
def usage():
|
def usage():
|
||||||
"""Print out usage information"""
|
"""Print out usage information"""
|
||||||
print ("Usage: %(prg)s {copyin,copyout} ARCHNAME SOURCE DESTINATION\n"
|
print("Usage: %(prg)s {copyin,copyout} ARCHNAME SOURCE DESTINATION\n"
|
||||||
"or: %(prg)s list ARCHNAME\n"
|
"or: %(prg)s list ARCHNAME\n"
|
||||||
"or: %(prg)s {mkdir,rm,rmdir,run} ARCHNAME TARGET" %
|
"or: %(prg)s {mkdir,rm,rmdir,run} ARCHNAME TARGET" %
|
||||||
{"prg": sys.argv[0]})
|
{"prg": sys.argv[0]})
|
||||||
@@ -183,13 +183,13 @@ def _parse_args(arch_class):
|
|||||||
"written into archive)")
|
"written into archive)")
|
||||||
parser_copyin.set_defaults(func=CALL_MAP['copyin'])
|
parser_copyin.set_defaults(func=CALL_MAP['copyin'])
|
||||||
|
|
||||||
parser_copyout.add_argument('arch', help="D64 Image filename")
|
parser_copyout.add_argument('arch', help="archive or image filename")
|
||||||
parser_copyout.add_argument('src', help="Source filename (to be read from"
|
parser_copyout.add_argument('src', help="Source filename (to be read from"
|
||||||
" archive")
|
" archive")
|
||||||
parser_copyout.add_argument('dst', help="Destination filename")
|
parser_copyout.add_argument('dst', help="Destination filename")
|
||||||
parser_copyout.set_defaults(func=CALL_MAP['copyout'])
|
parser_copyout.set_defaults(func=CALL_MAP['copyout'])
|
||||||
|
|
||||||
parser_rm.add_argument('arch', help="D64 Image filename")
|
parser_rm.add_argument('arch', help="archive or image filename")
|
||||||
parser_rm.add_argument('dst', help="File inside archive to be deleted")
|
parser_rm.add_argument('dst', help="File inside archive to be deleted")
|
||||||
parser_rm.set_defaults(func=CALL_MAP['rm'])
|
parser_rm.set_defaults(func=CALL_MAP['rm'])
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user