Add duplicate_dirs.py.
This commit is contained in:
parent
80e55383f2
commit
fd29170f76
1 changed files with 14 additions and 0 deletions
14
duplicate_dirs.py
Normal file
14
duplicate_dirs.py
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
from voussoirkit import spinal
|
||||||
|
|
||||||
|
basenames = {}
|
||||||
|
|
||||||
|
walker = spinal.walk_generator('.', yield_directories=True, yield_files=False)
|
||||||
|
for directory in walker:
|
||||||
|
basenames.setdefault(directory.basename, []).append(directory)
|
||||||
|
|
||||||
|
for (basename, dupes) in basenames.items():
|
||||||
|
if len(dupes) == 1:
|
||||||
|
continue
|
||||||
|
for dupe in dupes:
|
||||||
|
print(dupe.absolute_path)
|
||||||
|
print()
|
Loading…
Reference in a new issue