Add extension_summary.py.
This commit is contained in:
parent
220eff266f
commit
80e55383f2
1 changed files with 17 additions and 0 deletions
17
extension_summary.py
Normal file
17
extension_summary.py
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
import collections
|
||||||
|
|
||||||
|
from voussoirkit import spinal
|
||||||
|
|
||||||
|
counts = collections.Counter()
|
||||||
|
extensions = {}
|
||||||
|
walker = spinal.walk_generator()
|
||||||
|
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}')
|
Loading…
Reference in a new issue