mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-05-17 11:38:32 +02:00
Only check for files
This commit is contained in:
parent
f780e666ff
commit
f4cdf66c28
1 changed files with 6 additions and 2 deletions
|
@ -1,7 +1,6 @@
|
||||||
# Copyright (C) 2012-2022 jrnl contributors
|
# Copyright (C) 2012-2022 jrnl contributors
|
||||||
# License: https://www.gnu.org/licenses/gpl-3.0.html
|
# License: https://www.gnu.org/licenses/gpl-3.0.html
|
||||||
|
|
||||||
import fnmatch
|
|
||||||
import functools
|
import functools
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
@ -23,7 +22,12 @@ def does_directory_contain_n_files(directory_path, number):
|
||||||
if not os.path.isdir(directory_path):
|
if not os.path.isdir(directory_path):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
count = len(fnmatch.filter(os.listdir(directory_path), "*.*"))
|
files = [
|
||||||
|
f
|
||||||
|
for f in os.listdir(directory_path)
|
||||||
|
if os.path.isfile(os.path.join(directory_path, f))
|
||||||
|
]
|
||||||
|
count = len(files)
|
||||||
|
|
||||||
return int(number) == count
|
return int(number) == count
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue