Skip to content

Commit

Permalink
rinoh: fix --format handling (issue #284)
Browse files Browse the repository at this point in the history
The argument needs to be compared case-insensitive
  • Loading branch information
brechtm committed Mar 9, 2022
1 parent 28737c4 commit 8e093d1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 1 addition & 2 deletions src/rinoh/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,7 @@ def get_distribution_name(dist):


def get_reader_by_name(format_name):
for entry_point, _ in find_entry_points('rinoh.frontends',
format_name.lower()):
for entry_point, _ in find_entry_points('rinoh.frontends', format_name):
return entry_point.name, entry_point.load()
raise SystemExit("Unknown format '{}'. Run `{} --list-formats` to "
"find out which formats are supported."
Expand Down
3 changes: 2 additions & 1 deletion src/rinoh/resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,8 @@ def find_entry_points(group, name=None):
"""
yield from ((ep, dist) for dist in ilm.distributions()
for ep in dist.entry_points
if ep.group == group and (name is None or ep.name == name))
if ep.group == group and (name is None
or ep.name.lower() == name.lower()))


# dynamic entry point creation
Expand Down

0 comments on commit 8e093d1

Please sign in to comment.