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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ The format mostly follows [Keep a Changelog](http://keepachangelog.com/en/1.0.0/
### Changed

- Remove EOL'd Python 3.8 (new minimum requirement is Python 3.9), add Python 3.13 testing
- Commands that reference a job by index or url (such as testing filters and modifying jobs) can now also reference by name (#846 by jamstah)

### Fixed

Expand Down
2 changes: 1 addition & 1 deletion lib/urlwatch/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def _find_job(self, query):
except IndexError:
return None
except ValueError:
return next((job for job in self.urlwatcher.jobs if job.get_location() == query), None)
return next((job for job in self.urlwatcher.jobs if query in [job.get_location(), job.name]), None)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick: Tuple instead of list for membership check:

Suggested change
return next((job for job in self.urlwatcher.jobs if query in [job.get_location(), job.name]), None)
return next((job for job in self.urlwatcher.jobs if query in (job.get_location(), job.name)), None)


def _get_job(self, id):
job = self._find_job(id)
Expand Down