-
Notifications
You must be signed in to change notification settings - Fork 77
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 a bash-completion script (#22) #222
Conversation
@jayrajput thank you for the updated patch! In general it looks fine but before I would like to get started with the review I want to know why exactly you dropped the optcomplete package. What is the overhead you are mentioning on issue #22? I checked some example code from that project, and it looks kinda easy to get implemented. |
The only overhead I saw was adding dependency on the optcomplete. And the functionality which we needed was done in four lines I added to the scrapper.py. Module optcomplete provide more fancier completion which we do not need (for e.g. file completion, director completion, known host completion). Also their bash completion code was complex. Now as you are hinting towards usage of optocomplete, I can also think of advantages of optcomplet. |
Ok, so I checked the package on PyPI and it's not that large. So I don't think it would harm us adding this dependency. Lets get it added, so we do not re-invent the wheel, and can make use of the fancy other features you are referring to automatically. Thanks. |
@jayrajput do you have an update for us? Have you had the time to do the changes? |
This went on a delay path. Let me work on this on weekend and send you an |
Thanks for the update Jay! If you have problems let me know. |
@whimboo Couple of issues which I need to discuss:
Here are the logs, show delay in the import of requests. I am using print time.localtime to log timestamp
|
Hi folks! Spring cleaning ;) What is the status of this PR? Can it be closed or will we work on it in the future? |
The idea of using tab complete is not feasible with the optcomplete as the optcomplete module calls the mozdownload to find the completion and mozdownload takes 2-3 seconds to import all the needed modules. The slowest module to load is requests. Please see my previous comments for details. Loading the modules conditionally is one possibility, but that will start getting tricky. |
Sorry for totally forgetting about this PR! And thanks to @Nebelhom to bring it back to my attention. I can now see the problems we would have here. That's really unfortunate. I wonder if we shouldn't import the requests module globally but only when we really need it. That would drastically help. I would suggest we investigate that in a new issue first. It can block issue #22. Given that you have removed your fork you won't be able to push to this PR anymore. So lets close it. |
I have made changes to the setup.py to include the auto completion script in the python package. I am not sure if I need to do that. Also if the version for the mozdownloand in the setup.py needs to be updated.