scripts: Dropped --padding from ascii art scripts

No one is realistically ever going to use this.

Ascii art is just too low resolution, trying to pad anything just wastes
terminal space. So we might as well not support --padding and save on
the additional corner cases.

Worst case, in the future we can always find this commit and revert
things.
This commit is contained in:
Christopher Haster
2025-04-11 03:17:46 -05:00
parent 9008e8c82c
commit eb4c4c612e
4 changed files with 8 additions and 96 deletions

View File

@@ -912,7 +912,6 @@ def main_(ring, paths, *,
to_ratio=1/1, to_ratio=1/1,
tiny=False, tiny=False,
title=None, title=None,
padding=0,
label=False, label=False,
no_label=False, no_label=False,
**args): **args):
@@ -1220,32 +1219,10 @@ def main_(ring, paths, *,
# our general purpose partition function # our general purpose partition function
def partition(tile, **args): def partition(tile, **args):
if tile.depth == 0: x__ = tile.x
# apply top padding y__ = tile.y
tile.x += padding width__ = tile.width
tile.y += padding height__ = tile.height
tile.width -= min(padding, tile.width)
tile.height -= min(padding, tile.height)
# apply bottom padding
if not tile.children:
tile.width -= min(padding, tile.width)
tile.height -= min(padding, tile.height)
x__ = tile.x
y__ = tile.y
width__ = tile.width
height__ = tile.height
else:
# apply bottom padding
if not tile.children:
tile.width -= min(padding, tile.width)
tile.height -= min(padding, tile.height)
x__ = tile.x
y__ = tile.y
width__ = tile.width
height__ = tile.height
# partition via requested scheme # partition via requested scheme
if tile.children: if tile.children:
@@ -1622,10 +1599,6 @@ if __name__ == "__main__":
parser.add_argument( parser.add_argument(
'--title', '--title',
help="Add a title. Accepts %% modifiers.") help="Add a title. Accepts %% modifiers.")
parser.add_argument(
'--padding',
type=float,
help="Padding to add to each level of the treemap. Defaults to 0.")
parser.add_argument( parser.add_argument(
'-l', '--label', '-l', '--label',
action='store_true', action='store_true',

View File

@@ -4354,7 +4354,6 @@ def main_(ring, disk, mroots=None, *,
title=None, title=None,
title_littlefs=False, title_littlefs=False,
title_usage=False, title_usage=False,
padding=0,
**args): **args):
# give ring an writeln function # give ring an writeln function
def writeln(s=''): def writeln(s=''):
@@ -4677,17 +4676,6 @@ def main_(ring, disk, mroots=None, *,
b.width = block_width_ b.width = block_width_
b.height = block_height_ b.height = block_height_
# apply top padding
if x == 0:
b.x += padding
b.width -= min(padding, b.width)
if y == 0:
b.y += padding
b.height -= min(padding, b.height)
# apply bottom padding
b.width -= min(padding, b.width)
b.height -= min(padding, b.height)
# align to pixel boundaries # align to pixel boundaries
b.align() b.align()
@@ -5075,11 +5063,6 @@ if __name__ == "__main__":
action='store_true', action='store_true',
help="Use the mdir/btree/data usage as the title. This is the " help="Use the mdir/btree/data usage as the title. This is the "
"default.") "default.")
# TODO drop padding in ascii scripts, no one is ever going to use this
parser.add_argument(
'--padding',
type=float,
help="Padding to add to each block. Defaults to 0.")
parser.add_argument( parser.add_argument(
'-e', '--error-on-corrupt', '-e', '--error-on-corrupt',
action='store_true', action='store_true',

View File

@@ -941,7 +941,6 @@ def main(path='-', *,
to_ratio=1/1, to_ratio=1/1,
tiny=False, tiny=False,
title=None, title=None,
padding=0,
lines=None, lines=None,
head=False, head=False,
cat=False, cat=False,
@@ -1356,17 +1355,6 @@ def main(path='-', *,
b.width = block_width_ b.width = block_width_
b.height = block_height_ b.height = block_height_
# apply top padding
if x == 0:
b.x += padding
b.width -= min(padding, b.width)
if y == 0:
b.y += padding
b.height -= min(padding, b.height)
# apply bottom padding
b.width -= min(padding, b.width)
b.height -= min(padding, b.height)
# align to pixel boundaries # align to pixel boundaries
b.align() b.align()
@@ -1816,11 +1804,6 @@ if __name__ == "__main__":
parser.add_argument( parser.add_argument(
'--title', '--title',
help="Add a title. Accepts %% modifiers.") help="Add a title. Accepts %% modifiers.")
# TODO drop padding in ascii scripts, no one is ever going to use this
parser.add_argument(
'--padding',
type=float,
help="Padding to add to each block. Defaults to 0.")
parser.add_argument( parser.add_argument(
'-n', '--lines', '-n', '--lines',
nargs='?', nargs='?',

View File

@@ -926,7 +926,6 @@ def main_(ring, csv_paths, *,
to_ratio=1/1, to_ratio=1/1,
tiny=False, tiny=False,
title=None, title=None,
padding=0,
label=False, label=False,
no_label=False, no_label=False,
**args): **args):
@@ -1102,32 +1101,10 @@ def main_(ring, csv_paths, *,
tile.width = canvas.width tile.width = canvas.width
tile.height = canvas.height tile.height = canvas.height
def partition(tile): def partition(tile):
if tile.depth == 0: x__ = tile.x
# apply top padding y__ = tile.y
tile.x += padding width__ = tile.width
tile.y += padding height__ = tile.height
tile.width -= min(padding, tile.width)
tile.height -= min(padding, tile.height)
# apply bottom padding
if not tile.children:
tile.width -= min(padding, tile.width)
tile.height -= min(padding, tile.height)
x__ = tile.x
y__ = tile.y
width__ = tile.width
height__ = tile.height
else:
# apply bottom padding
if not tile.children:
tile.width -= min(padding, tile.width)
tile.height -= min(padding, tile.height)
x__ = tile.x
y__ = tile.y
width__ = tile.width
height__ = tile.height
# partition via requested scheme # partition via requested scheme
if tile.children: if tile.children:
@@ -1481,10 +1458,6 @@ if __name__ == "__main__":
parser.add_argument( parser.add_argument(
'--title', '--title',
help="Add a title. Accepts %% modifiers.") help="Add a title. Accepts %% modifiers.")
parser.add_argument(
'--padding',
type=float,
help="Padding to add to each level of the treemap. Defaults to 0.")
parser.add_argument( parser.add_argument(
'-l', '--label', '-l', '--label',
action='store_true', action='store_true',