mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-11-21 15:36:18 -05:00
Removing unused file.
This commit is contained in:
parent
c839acb270
commit
98b969fc3c
1 changed files with 0 additions and 30 deletions
|
|
@ -1,30 +0,0 @@
|
|||
#! /usr/bin/env python
|
||||
import argparse
|
||||
import os
|
||||
import pathlib
|
||||
import sys
|
||||
|
||||
|
||||
def count_files(directory: pathlib.Path) -> int:
|
||||
count = 0
|
||||
for path in directory.iterdir():
|
||||
if path.is_dir():
|
||||
count += count_files(path)
|
||||
else:
|
||||
count += 1
|
||||
return count
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
default_cwd = pathlib.Path(os.getcwd())
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('directory', nargs='?', default=default_cwd, type=pathlib.Path)
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
if not args.directory.is_dir():
|
||||
print('Directory does not exist', file=sys.stderr)
|
||||
sys.exit(1)
|
||||
|
||||
total_count = count_files(args.directory)
|
||||
print(total_count)
|
||||
Loading…
Add table
Add a link
Reference in a new issue