From eb4c4c612ede596eaff7df27417d9f0ec815310d Mon Sep 17 00:00:00 2001 From: Christopher Haster Date: Fri, 11 Apr 2025 03:17:46 -0500 Subject: [PATCH] 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. --- scripts/codemap.py | 35 ++++------------------------------- scripts/dbgbmap.py | 17 ----------------- scripts/dbgtrace.py | 17 ----------------- scripts/treemap.py | 35 ++++------------------------------- 4 files changed, 8 insertions(+), 96 deletions(-) diff --git a/scripts/codemap.py b/scripts/codemap.py index 0f66d431..c7d787e9 100755 --- a/scripts/codemap.py +++ b/scripts/codemap.py @@ -912,7 +912,6 @@ def main_(ring, paths, *, to_ratio=1/1, tiny=False, title=None, - padding=0, label=False, no_label=False, **args): @@ -1220,32 +1219,10 @@ def main_(ring, paths, *, # our general purpose partition function def partition(tile, **args): - if tile.depth == 0: - # apply top padding - tile.x += padding - tile.y += padding - 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 + x__ = tile.x + y__ = tile.y + width__ = tile.width + height__ = tile.height # partition via requested scheme if tile.children: @@ -1622,10 +1599,6 @@ if __name__ == "__main__": parser.add_argument( '--title', 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( '-l', '--label', action='store_true', diff --git a/scripts/dbgbmap.py b/scripts/dbgbmap.py index 9eba7864..56d1847a 100755 --- a/scripts/dbgbmap.py +++ b/scripts/dbgbmap.py @@ -4354,7 +4354,6 @@ def main_(ring, disk, mroots=None, *, title=None, title_littlefs=False, title_usage=False, - padding=0, **args): # give ring an writeln function def writeln(s=''): @@ -4677,17 +4676,6 @@ def main_(ring, disk, mroots=None, *, b.width = block_width_ 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 b.align() @@ -5075,11 +5063,6 @@ if __name__ == "__main__": action='store_true', help="Use the mdir/btree/data usage as the title. This is the " "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( '-e', '--error-on-corrupt', action='store_true', diff --git a/scripts/dbgtrace.py b/scripts/dbgtrace.py index 5a273507..5d7872da 100755 --- a/scripts/dbgtrace.py +++ b/scripts/dbgtrace.py @@ -941,7 +941,6 @@ def main(path='-', *, to_ratio=1/1, tiny=False, title=None, - padding=0, lines=None, head=False, cat=False, @@ -1356,17 +1355,6 @@ def main(path='-', *, b.width = block_width_ 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 b.align() @@ -1816,11 +1804,6 @@ if __name__ == "__main__": parser.add_argument( '--title', 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( '-n', '--lines', nargs='?', diff --git a/scripts/treemap.py b/scripts/treemap.py index 439355aa..247727e8 100755 --- a/scripts/treemap.py +++ b/scripts/treemap.py @@ -926,7 +926,6 @@ def main_(ring, csv_paths, *, to_ratio=1/1, tiny=False, title=None, - padding=0, label=False, no_label=False, **args): @@ -1102,32 +1101,10 @@ def main_(ring, csv_paths, *, tile.width = canvas.width tile.height = canvas.height def partition(tile): - if tile.depth == 0: - # apply top padding - tile.x += padding - tile.y += padding - 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 + x__ = tile.x + y__ = tile.y + width__ = tile.width + height__ = tile.height # partition via requested scheme if tile.children: @@ -1481,10 +1458,6 @@ if __name__ == "__main__": parser.add_argument( '--title', 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( '-l', '--label', action='store_true',