-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add search #287
base: features
Are you sure you want to change the base?
feat: add search #287
Conversation
only parse from and to dates when searching toggle between date formats when searching refactoring change date formatting for searched events raise exception when search dates not given
Thanks! I'll be very busy this week, I'll take a look this weekend :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems very good to me!
kosmorro/__main__.py
Outdated
show_graph: bool, | ||
) -> dumper.Dumper: | ||
try: | ||
if search_from is None or search_to is None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm realizing that if user doesn't provide the --from
argument, we could assert that we want to search from the current date by default? What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, that makes sense to me!
kosmorro/__main__.py
Outdated
help=_("The date to begin searching for events."), | ||
) | ||
parser.add_argument( | ||
"--to", type=str, default=None, help=_("The date to end searching for events.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we make --from
optional as proposed, then we should perhaps rename this argument to --until
?
16a9b29
to
16cbbb6
Compare
Checklist:
This PR makes use of the event searching capability added to Kosmorrolib in version 1.1. It will allow users to search for specific events in a given date range.
I don't think this is 100% complete yet, but I wanted to get your feedback on it.