From 57f80ecd90c1be3a5e3b6627f7fb6a2614c311ba Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Sun, 9 Jan 2022 21:49:47 -0800 Subject: [PATCH] Use pathclass.walk instead of spinal.walk. --- sole_subdir_lift.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sole_subdir_lift.py b/sole_subdir_lift.py index 142daa8..5c0c608 100644 --- a/sole_subdir_lift.py +++ b/sole_subdir_lift.py @@ -6,7 +6,6 @@ import sys from voussoirkit import passwordy from voussoirkit import pathclass -from voussoirkit import spinal from voussoirkit import vlogging log = vlogging.getLogger(__name__, 'sole_subdir_lift') @@ -14,7 +13,7 @@ log = vlogging.getLogger(__name__, 'sole_subdir_lift') def sole_lift_argparse(args): starting = pathclass.Path(args.starting) queue = collections.deque() - queue.extend(spinal.walk(starting, yield_files=False, yield_directories=True)) + queue.extend(starting.walk_directories()) while len(queue) > 0: directory = queue.popleft() @@ -48,7 +47,7 @@ def sole_lift_argparse(args): shutil.move(grandchild, directory) if temp_dir.listdir(): - raise Exception() + raise Exception('The temp dir is supposed to be empty by this point.') os.rmdir(temp_dir) queue.append(directory.parent)