mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-07-03 23:16:14 +02:00
Helper fixed
This commit is contained in:
parent
1f0812b06d
commit
df0c0d4d35
1 changed files with 2 additions and 3 deletions
|
@ -1,6 +1,7 @@
|
||||||
# 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
|
||||||
|
|
||||||
|
@ -22,9 +23,7 @@ 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
|
||||||
|
|
||||||
for path in os.scandir(directory_path):
|
count = len(fnmatch.filter(os.listdir(directory_path), "*.*"))
|
||||||
if path.is_file():
|
|
||||||
count += 1
|
|
||||||
|
|
||||||
return int(number) == count
|
return int(number) == count
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue