Migrate scripts from spinal.walk_generator to spinal.walk.

This commit is contained in:
voussoir 2021-05-17 17:00:51 -07:00
parent a2c80f8a79
commit 05d59c2149
No known key found for this signature in database
GPG key ID: 5F7554F8C26DACCB
9 changed files with 9 additions and 9 deletions

View file

@ -60,7 +60,7 @@ def unicode_normalize(s):
def brename(transformation, autoyes=False, do_naturalsort=False, recurse=False):
if recurse:
walker = spinal.walk_generator('.', yield_files=True, yield_directories=True)
walker = spinal.walk('.', yield_files=True, yield_directories=True)
olds = list(walker)
else:
olds = cwd.listdir()

View file

@ -2,7 +2,7 @@ from voussoirkit import spinal
basenames = {}
walker = spinal.walk_generator('.', yield_directories=True, yield_files=False)
walker = spinal.walk('.', yield_directories=True, yield_files=False)
for directory in walker:
basenames.setdefault(directory.basename, []).append(directory)

View file

@ -4,7 +4,7 @@ from voussoirkit import spinal
counts = collections.Counter()
extensions = {}
walker = spinal.walk_generator()
walker = spinal.walk()
for file in walker:
extensions.setdefault(file.extension, []).append(file)
counts[file.extension] += 1

View file

@ -9,7 +9,7 @@ from voussoirkit import interactive
from voussoirkit import spinal
def filepull(pull_from='.', autoyes=False):
files = list(spinal.walk_generator(pull_from))
files = list(spinal.walk(pull_from))
cwd = os.getcwd()
files = [f for f in files if os.path.split(f.absolute_path)[0] != cwd]

View file

@ -35,7 +35,7 @@ def hash_hardlink_argparse(args):
if path.is_file:
files.append(path)
elif path.is_dir:
files.extend(spinal.walk_generator(path))
files.extend(spinal.walk(path))
inodes = set()
hashes = {}

View file

@ -12,7 +12,7 @@ from voussoirkit import spinal
@pipeable.ctrlc_return1
def inputrename_argparse(args):
if args.recurse:
files = (file for file in spinal.walk_generator('.') if args.keyword in file.basename)
files = (file for file in spinal.walk('.') if args.keyword in file.basename)
else:
files = (file for file in pathclass.cwd().listdir() if args.keyword in file.basename)
prev = None

View file

@ -17,7 +17,7 @@ from voussoirkit import pathclass
def prune_dirs(starting):
starting = pathclass.Path(starting)
walker = spinal.walk_generator(starting, yield_directories=True, yield_files=False)
walker = spinal.walk(starting, yield_directories=True, yield_files=False)
double_check = set()

View file

@ -14,7 +14,7 @@ from voussoirkit import spinal
def prune_shortcuts(recurse=False, autoyes=False):
if recurse:
lnks = [file for file in spinal.walk_generator('.') if file.extension == 'lnk']
lnks = [file for file in spinal.walk('.') if file.extension == 'lnk']
else:
lnks = pathclass.cwd().glob('*.lnk')

View file

@ -165,7 +165,7 @@ def search(
terms = {k: [x.lower() for x in v] for (k, v) in terms.items()}
if text is None:
search_objects = spinal.walk_generator(
search_objects = spinal.walk(
root_path,
recurse=not local_only,
yield_directories=True,