Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions beangulp/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,13 +254,17 @@ def _identify(ctx: "Ingest", src: str, failfast: bool, verbose: bool):
log = utils.logger(verbose)
errors = exceptions.ExceptionsTrap(log)

any_importer_found = False

for filename in _walk(src, log):
with errors:
importer = identify.identify(ctx.importers, filename)
if not importer:
log("") # Newline.
continue

any_importer_found = True

# Signal processing of this document.
log(" ...", nl=False)

Expand All @@ -277,6 +281,9 @@ def _identify(ctx: "Ingest", src: str, failfast: bool, verbose: bool):
if errors:
sys.exit(1)

if not any_importer_found:
sys.exit(100)


def _importer(importer):
"""Check that the passed instance implements the Importer interface.
Expand Down
2 changes: 1 addition & 1 deletion beangulp/tests/identify.rst
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ Test with an empty downloads directory:

>>> r = run('identify', downloads)
>>> r.exit_code
0
100
>>> print(r.output)

Add some documents:
Expand Down