2020-02-06 19:51:30 +00:00
|
|
|
import collections
|
|
|
|
|
|
|
|
from voussoirkit import spinal
|
|
|
|
|
|
|
|
counts = collections.Counter()
|
|
|
|
extensions = {}
|
2021-05-18 00:00:51 +00:00
|
|
|
walker = spinal.walk()
|
2020-02-06 19:51:30 +00:00
|
|
|
for file in walker:
|
|
|
|
extensions.setdefault(file.extension, []).append(file)
|
|
|
|
counts[file.extension] += 1
|
|
|
|
|
|
|
|
for (extension, count) in counts.most_common():
|
|
|
|
files = extensions[extension]
|
|
|
|
print(f'{extension.with_dot}: {len(files)}')
|
|
|
|
if len(files) < 5:
|
|
|
|
for file in files:
|
|
|
|
print(f' {file.absolute_path}')
|