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

Add history command to searchor cli #125

Merged
merged 8 commits into from
Oct 21, 2022

Conversation

fr4nkln11
Copy link
Collaborator

Improvement to Searchor CLI

I have added a new feature to the CLI/CLT, which is the history command.
The history command will allow users to view all previous URLs generated from the CLI,
the command will still be improved later on, but its currently capable of the most basic functionality, which is showing searchor URL history.

To make this work I created the history.py file, to be used as a module in main.py with functions for updating, clearing and viewing history data.

The history data will be stored in JSON format, and the data file will be located in the user's HOME directory as .searchor_history.json.

I chose JSON because I thought it would be an easy way to store all the important aspects of URL creation that might influence how history data will be viewed, without the need for extra string processing like if it was a .txt file.

To further explain, using the JSON format, I can store the URL, engine, query, time, and date of creation for each URL generated. This would actually be useful for when I'm trying to extend the functionality of the history command, Like arranging URLs according to date created, or engine used.

What will this Pull Request Affect?

changes were made to main.py, I included exception handling to take care of AttributeErrors, and functions from the history module were imported to be used in their respective commands.
In setup.py I added click as a dependency.

feel free to test out the new features and make improvements.

@ArjunSharda ArjunSharda changed the base branch from main to 2.4.0 October 21, 2022 15:11
@ArjunSharda ArjunSharda changed the title Searchor cli Add history command to searchor cli Oct 21, 2022
@ArjunSharda ArjunSharda merged commit a559ffb into ArjunSharda:2.4.0 Oct 21, 2022
@ArjunSharda ArjunSharda mentioned this pull request Oct 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants