scripts: Renamed Attr -> CsvAttr

Mainly to avoid confusion with littlefs's attrs, uattrs, rattrs, etc.

This risked things getting _really_ confusing as the scripts evolve.
This commit is contained in:
Christopher Haster
2025-05-15 18:48:46 -05:00
parent aebe5b1d1b
commit 651c3e1eb4
9 changed files with 70 additions and 70 deletions
+9 -9
View File
@@ -251,7 +251,7 @@ class RingIO:
sys.stdout.flush()
# a representation of optionally key-mapped attrs
class Attr:
class CsvAttr:
def __init__(self, attrs, defaults=None):
if attrs is None:
attrs = []
@@ -275,20 +275,20 @@ class Attr:
self.keyed[attr[0]].append(attr[1])
# create attrs object for defaults
if isinstance(defaults, Attr):
if isinstance(defaults, CsvAttr):
self.defaults = defaults
elif defaults is not None:
self.defaults = Attr(defaults)
self.defaults = CsvAttr(defaults)
else:
self.defaults = None
def __repr__(self):
if self.defaults is None:
return 'Attr(%r)' % (
return 'CsvAttr(%r)' % (
[(','.join(attr[0]), attr[1])
for attr in self.attrs])
else:
return 'Attr(%r, %r)' % (
return 'CsvAttr(%r, %r)' % (
[(','.join(attr[0]), attr[1])
for attr in self.attrs],
[(','.join(attr[0]), attr[1])
@@ -1017,7 +1017,7 @@ def main(path='-', *,
chars_.extend((char[0], c) for c in psplit(char[1]))
else:
chars_.extend(psplit(char))
chars_ = Attr(chars_,
chars_ = CsvAttr(chars_,
defaults=[True] if braille or dots else CHARS)
wear_chars_ = []
@@ -1026,12 +1026,12 @@ def main(path='-', *,
wear_chars_.extend((char[0], c) for c in psplit(char[1]))
else:
wear_chars_.extend(psplit(char))
wear_chars_ = Attr(wear_chars_,
wear_chars_ = CsvAttr(wear_chars_,
defaults=[True] if braille or dots else WEAR_CHARS)
colors_ = Attr(colors, defaults=COLORS)
colors_ = CsvAttr(colors, defaults=COLORS)
wear_colors_ = Attr(wear_colors, defaults=WEAR_COLORS)
wear_colors_ = CsvAttr(wear_colors, defaults=WEAR_COLORS)
# is bd geometry specified?
if isinstance(block_size, tuple):