mirror of
https://github.com/gryf/uc1541.git
synced 2026-02-03 12:15:47 +01:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 426ac88926 | |||
| d75f87fdce | |||
| bda541dd92 |
32
README.rst
32
README.rst
@@ -35,11 +35,10 @@ are seen on a listing.
|
||||
|
||||
While copying from filesystem to disk image, filename conversion will be done:
|
||||
|
||||
1. Every ``$`` and ``*`` characters will be replaced by question mark (``?``)
|
||||
2. Every pipe (``|``) and backslash (``\``) characters will be replaced by
|
||||
slash (``/``)
|
||||
3. Every tilde (``~``) will be replaced by a space
|
||||
4. ``prg`` extension will be truncated
|
||||
1. Every ``$`` and ``*`` characters will be replaced by question mark (``?``).
|
||||
2. Every pipe (``|``) and backslash (``\\``) characters will be replaced by
|
||||
slash (``/``).
|
||||
3. ``prg`` extension will be truncated.
|
||||
|
||||
Representation of a directory can be sometimes confusing - in case when one
|
||||
copied file without extension it stays there in such form, till next access
|
||||
@@ -64,13 +63,23 @@ Installation
|
||||
============
|
||||
|
||||
* copy ``uc1541`` to ``~/.local/share/mc/extfs.d/``
|
||||
* add or change entry for files handle in ``~/.config/mc/mc.ext``::
|
||||
* add or change entry for files handle in ``~/.config/mc/mc.ext``:
|
||||
|
||||
# Disk images for Commodore computers (VIC20, C64, C128)
|
||||
regex/\.([dD]64|[dD]6[zZ]|[dD]71|[dD]7[zZ]|[dD]81|[dD]8[zZ])$
|
||||
Open=%cd %p/uc1541://
|
||||
View=%view{ascii} c1541 %f -list
|
||||
Extract=c1541 %f -extract
|
||||
.. code:: ini
|
||||
|
||||
# Disk images for Commodore computers (VIC20, C64, C128)
|
||||
[d64]
|
||||
Regex=\.(d64|d71|d81)$
|
||||
RegexIgnoreCase=true
|
||||
Open=%cd %p/uc1541://
|
||||
View=%view{ascii} c1541 %f -list
|
||||
|
||||
[d6z]
|
||||
Regex=\.(d[678]z)$
|
||||
RegexIgnoreCase=true
|
||||
Open=%cd %p/uc1541://
|
||||
View=%view{ascii} t=$(mktemp); zcat %f > ${t}; c1541 ${t} -list 2>/dev/null; rm ${t}
|
||||
|
||||
|
||||
Configuration
|
||||
=============
|
||||
@@ -87,6 +96,7 @@ script behaviour:
|
||||
Changelog
|
||||
=========
|
||||
|
||||
* **3.6** Fixed line matcher for directory entries.
|
||||
* **3.5** Drop Python2 support.
|
||||
* **3.4** Code cleanup. Removed dummy logger class and sys.args based argument
|
||||
parsing.
|
||||
|
||||
32
uc1541
32
uc1541
@@ -4,9 +4,9 @@ UC1541 Virtual filesystem
|
||||
|
||||
Author: Roman 'gryf' Dobosz <gryf73@gmail.com>
|
||||
Date: 2023-10-04
|
||||
Version: 3.5
|
||||
Version: 3.6
|
||||
Licence: BSD
|
||||
source: https://bitbucket.org/gryf/uc1541
|
||||
source: https://gihub.com/gryf/uc1541
|
||||
mirror: https://github.com/gryf/uc1541
|
||||
"""
|
||||
import argparse
|
||||
@@ -357,7 +357,7 @@ class Uc1541(object):
|
||||
"""
|
||||
Class for interact with c1541 program and MC
|
||||
"""
|
||||
PRG = re.compile(r'(\d+)\s+"([^"]*)".+?\s(del|prg|rel|seq|usr)([\s<])')
|
||||
PRG = re.compile(r'(\d+)\s+"([^"]*)".+?(del|prg|rel|seq|usr)([\s<])')
|
||||
|
||||
def __init__(self, archname):
|
||||
self.arch = archname
|
||||
@@ -435,9 +435,9 @@ class Uc1541(object):
|
||||
program seem to have issues with it while writing, so it will also be
|
||||
replaced.
|
||||
"""
|
||||
# TODO: revisit those shitty mappings, when are which done.
|
||||
char_map = {'|': "/",
|
||||
"\\": "/",
|
||||
"~": " ",
|
||||
"$": "?",
|
||||
"*": "?"}
|
||||
|
||||
@@ -495,13 +495,9 @@ class Uc1541(object):
|
||||
if '/' in display_name:
|
||||
display_name = display_name.replace('/', '|')
|
||||
|
||||
# workaround for space and dash at the beggining of the
|
||||
# filename
|
||||
char_map = {' ': '~',
|
||||
'-': '_'}
|
||||
display_name = "".join([char_map.get(display_name[0],
|
||||
display_name[0]),
|
||||
display_name[1:]])
|
||||
# workaround for space at the beggining of the filename
|
||||
if display_name.startswith(' '):
|
||||
display_name = '_' + display_name[1:]
|
||||
|
||||
if ext == 'del':
|
||||
perms = "----------"
|
||||
@@ -548,11 +544,15 @@ class Uc1541(object):
|
||||
universal_newlines = True
|
||||
if cmd in ['delete', 'write']:
|
||||
universal_newlines = False
|
||||
(self.out,
|
||||
self.err) = subprocess.Popen(command,
|
||||
universal_newlines=universal_newlines,
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE).communicate()
|
||||
#(self.out,
|
||||
# self.err) = subprocess.Popen(command,
|
||||
# universal_newlines=universal_newlines,
|
||||
# stdout=subprocess.PIPE,
|
||||
# stderr=subprocess.PIPE).communicate()
|
||||
out = subprocess.run(command, capture_output=True,
|
||||
universal_newlines=universal_newlines)
|
||||
|
||||
self.out, self.err = out.stdout, out.stderr
|
||||
|
||||
if self.err:
|
||||
LOG.debug('an err: %s', self.err)
|
||||
|
||||
Reference in New Issue
Block a user