Fix processing files

This commit is contained in:
Antonio J. Delgado 2023-10-02 20:41:44 +03:00
parent 1a62499167
commit e06f7bb03a
3 changed files with 8 additions and 8 deletions

View file

@ -81,14 +81,14 @@ class image_classifier:
entries = list() entries = list()
count = 0 count = 0
for entry in os.scandir(directory): for entry in os.scandir(directory):
count += 1 if not entry.name.startswith('.') and entry.is_file():
if count > limit: count += 1
break if count > limit:
entries.append(entry) break
entries.append(entry)
self._log.info(f"Processing {len(entries)} files...") self._log.info(f"Processing {len(entries)} files...")
for entry in entries: for entry in entries:
if not entry.name.startswith('.') and entry.is_file(): self.process_file(entry.path)
self.process_file(entry.path)
def count(self, iterable): def count(self, iterable):
''' Return the length of an iterable that can't be count with len()''' ''' Return the length of an iterable that can't be count with len()'''

View file

@ -1,6 +1,6 @@
[metadata] [metadata]
name = image_classifier name = image_classifier
version = 0.0.14 version = 0.0.15
[options] [options]
packages = image_classifier packages = image_classifier

View file

@ -9,7 +9,7 @@ if os.access(requirements_file, os.R_OK):
setuptools.setup( setuptools.setup(
scripts=['image_classifier/image_classifier.py'], scripts=['image_classifier/image_classifier.py'],
author="Antonio J. Delgado", author="Antonio J. Delgado",
version='0.0.14', version='0.0.15',
name='image_classifier', name='image_classifier',
author_email="antoniodelgado@susurrando.com", author_email="antoniodelgado@susurrando.com",
url="", url="",