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:
@@ -3688,7 +3688,7 @@ class Lfs:
|
||||
|
||||
|
||||
# a representation of optionally key-mapped attrs
|
||||
class Attr:
|
||||
class CsvAttr:
|
||||
def __init__(self, attrs, defaults=None):
|
||||
if attrs is None:
|
||||
attrs = []
|
||||
@@ -3712,20 +3712,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])
|
||||
@@ -4175,9 +4175,9 @@ def main(disk, output, mroots=None, *,
|
||||
mode_redund = True
|
||||
|
||||
# what colors/labels to use?
|
||||
colors_ = Attr(colors, defaults=COLORS_DARK if dark else COLORS)
|
||||
colors_ = CsvAttr(colors, defaults=COLORS_DARK if dark else COLORS)
|
||||
|
||||
labels_ = Attr(labels)
|
||||
labels_ = CsvAttr(labels)
|
||||
|
||||
if background is not None:
|
||||
background_ = background
|
||||
|
||||
Reference in New Issue
Block a user