Skip to content
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

Draft
wants to merge 6 commits into
base: features
Choose a base branch
from
Draft

feat: add search #287

wants to merge 6 commits into from

Conversation

nicfb
Copy link
Contributor

@nicfb nicfb commented Oct 9, 2022

Q A
Bug fix? no
New feature? yes
Related issues Fix #237
Has BC-break yes
License GNU AGPL-v3

Checklist:

  • I have updated the manpages

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.

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
@Deuchnord
Copy link
Member

Thanks!

I'll be very busy this week, I'll take a look this weekend :)

@Deuchnord Deuchnord added the enhancement New feature or request label Oct 17, 2022
Copy link
Member

@Deuchnord Deuchnord left a 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!

show_graph: bool,
) -> dumper.Dumper:
try:
if search_from is None or search_to is None:
Copy link
Member

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?

Copy link
Contributor Author

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!

help=_("The date to begin searching for events."),
)
parser.add_argument(
"--to", type=str, default=None, help=_("The date to end searching for events.")
Copy link
Member

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?

@Deuchnord Deuchnord linked an issue Dec 21, 2023 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Search for events
2 participants