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
[Proposal]: Please only print banner if I call/use vidgear, not at import #338
Comments
Thanks for opening this issue, a maintainer will get back to you shortly! In the meantime:
|
@hughperkins I think this issue is very thought upon when creating this banner, it was necessary because some user never mention vidgear version when filing for issue here.
Yes this is bad way to tackle it. I'll think other way to display it only once the Class/API is called. I'll notify you here when it is done. |
Thank you! |
…lled, not at import (Fixes #338) - ✨ Added `logcurr_vidgear_ver` helper function to facilitate logging current vidgear version, when called within a API. - 🔇 Implemented `ver_is_logged` global variable to log version only once, modifiable only with `logcurr_vidgear_ver`, and finally made it available in all APIs. - 🧑💻 Followed recommendation given in official python docs: https://docs.python.org/3/faq/programming.html#how-do-i-share-global-variables-across-modules - ⚡️ Current vidgear version can only be logged by APIs with its logging enabled. - 🔥 Removed unnecessary imports.
@hughperkins With PR #348, you can now completely turn off logging and moreover APIs with logging turned on ( # clone the repository and get inside
git clone https://github.com/abhiTronix/vidgear.git && cd vidgear
# checkout the latest testing branch
git checkout development
# Install latest stable release with all Core dependencies
pip install .[core] Then test if problem still presists. Goodluck! |
Super! thank you :) |
…lled, not at import. (Fixes #338) [#348] - ✨ Added `logcurr_vidgear_ver` helper function to facilitate logging current vidgear version, when called within a API. - 🔇 Implemented `ver_is_logged` global variable to log version only once, modifiable only with `logcurr_vidgear_ver`, and finally made it available in all APIs. - 🧑💻 Followed recommendation given in official python docs: https://docs.python.org/3/faq/programming.html#how-do-i-share-global-variables-across-modules - ⚡️ Current vidgear version can only be logged by APIs with its logging enabled. - 🔥 Removed unnecessary imports. 🚑️ CI: Fixed missing v4l2loopback apt dependency on Linux envs. 🚑️ WriteGear: Fixed gstpipeline_mode not activating when wrongly assuming `output` value as valid path. - 👷 Added v4l2loopback support for testing `/dev/video0` device on Linux machines. - ☂️ Increased coverage.
Issue guidelines
Issue Checklist
Describe your Idea
Please only print banner if I call/use vidgear, not at import.
Currently I've moved the import to below an if guard
... but lots of linters don't like this kind of construction.
I'm happy to have a banner showing, but would prefer it only to show when I'm actually using/calling the library, not simply at import, please.
Note that I have not read the issue guidelines, nor searched open and closed issues etc. I just ticked the boxes because it was mandated by this form. Please feel free to close this issue on that basis.
Use Cases
Means I don't need to add a guard around the vidgear import, in order not to get a banner when I'm not using it.
Any other Relevant Information?
No response
The text was updated successfully, but these errors were encountered: