mirror of
https://github.com/gryf/uc1541.git
synced 2025-12-18 20:10:31 +01:00
Removed tilda mapping, it's handled by c1541 now
This commit is contained in:
@@ -35,11 +35,10 @@ are seen on a listing.
|
|||||||
|
|
||||||
While copying from filesystem to disk image, filename conversion will be done:
|
While copying from filesystem to disk image, filename conversion will be done:
|
||||||
|
|
||||||
1. Every ``$`` and ``*`` characters will be replaced by question mark (``?``)
|
1. Every ``$`` and ``*`` characters will be replaced by question mark (``?``).
|
||||||
2. Every pipe (``|``) and backslash (``\``) characters will be replaced by
|
2. Every pipe (``|``) and backslash (``\\``) characters will be replaced by
|
||||||
slash (``/``)
|
slash (``/``).
|
||||||
3. Every tilde (``~``) will be replaced by a space
|
3. ``prg`` extension will be truncated.
|
||||||
4. ``prg`` extension will be truncated
|
|
||||||
|
|
||||||
Representation of a directory can be sometimes confusing - in case when one
|
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
|
copied file without extension it stays there in such form, till next access
|
||||||
|
|||||||
28
uc1541
28
uc1541
@@ -6,7 +6,7 @@ Author: Roman 'gryf' Dobosz <gryf73@gmail.com>
|
|||||||
Date: 2023-10-04
|
Date: 2023-10-04
|
||||||
Version: 3.6
|
Version: 3.6
|
||||||
Licence: BSD
|
Licence: BSD
|
||||||
source: https://bitbucket.org/gryf/uc1541
|
source: https://gihub.com/gryf/uc1541
|
||||||
mirror: https://github.com/gryf/uc1541
|
mirror: https://github.com/gryf/uc1541
|
||||||
"""
|
"""
|
||||||
import argparse
|
import argparse
|
||||||
@@ -435,9 +435,9 @@ class Uc1541(object):
|
|||||||
program seem to have issues with it while writing, so it will also be
|
program seem to have issues with it while writing, so it will also be
|
||||||
replaced.
|
replaced.
|
||||||
"""
|
"""
|
||||||
|
# TODO: revisit those shitty mappings, when are which done.
|
||||||
char_map = {'|': "/",
|
char_map = {'|': "/",
|
||||||
"\\": "/",
|
"\\": "/",
|
||||||
"~": " ",
|
|
||||||
"$": "?",
|
"$": "?",
|
||||||
"*": "?"}
|
"*": "?"}
|
||||||
|
|
||||||
@@ -495,13 +495,9 @@ class Uc1541(object):
|
|||||||
if '/' in display_name:
|
if '/' in display_name:
|
||||||
display_name = display_name.replace('/', '|')
|
display_name = display_name.replace('/', '|')
|
||||||
|
|
||||||
# workaround for space and dash at the beggining of the
|
# workaround for space at the beggining of the filename
|
||||||
# filename
|
if display_name.startswith(' '):
|
||||||
char_map = {' ': '~',
|
display_name = '_' + display_name[1:]
|
||||||
'-': '_'}
|
|
||||||
display_name = "".join([char_map.get(display_name[0],
|
|
||||||
display_name[0]),
|
|
||||||
display_name[1:]])
|
|
||||||
|
|
||||||
if ext == 'del':
|
if ext == 'del':
|
||||||
perms = "----------"
|
perms = "----------"
|
||||||
@@ -548,11 +544,15 @@ class Uc1541(object):
|
|||||||
universal_newlines = True
|
universal_newlines = True
|
||||||
if cmd in ['delete', 'write']:
|
if cmd in ['delete', 'write']:
|
||||||
universal_newlines = False
|
universal_newlines = False
|
||||||
(self.out,
|
#(self.out,
|
||||||
self.err) = subprocess.Popen(command,
|
# self.err) = subprocess.Popen(command,
|
||||||
universal_newlines=universal_newlines,
|
# universal_newlines=universal_newlines,
|
||||||
stdout=subprocess.PIPE,
|
# stdout=subprocess.PIPE,
|
||||||
stderr=subprocess.PIPE).communicate()
|
# 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:
|
if self.err:
|
||||||
LOG.debug('an err: %s', self.err)
|
LOG.debug('an err: %s', self.err)
|
||||||
|
|||||||
Reference in New Issue
Block a user