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

Modulewatcher: ability to blacklist modules #7

Open
philipstarkey opened this issue Oct 5, 2014 · 1 comment
Open

Modulewatcher: ability to blacklist modules #7

philipstarkey opened this issue Oct 5, 2014 · 1 comment
Labels
enhancement New feature or request minor

Comments

@philipstarkey
Copy link
Member

Original report (archived issue) by Chris Billington (Bitbucket: cbillington, GitHub: chrisjbillington).


the ModuleWatcher class should have a method called 'blacklist', which takes a fully qualified module name as an argument.

A blacklisted module will be added, unsurprisingly, to a blacklist. Any modules that import this module will also be blacklisted. This will be achieved using an import tracer (repurposed from labscript_utils.impprof) that is set up when a ModuleWatcher is instantiated.

Blacklisted modules shouldn't be deleted from sys.modules immediately, that wouldn't make sense. They will be deleted on a method call 'clear_blacklisted' or similar.

This functionality is so that calling code can blacklist a module that it knows has import side effects and thus needs to be re-imported in code that runs repeatedly in the same interpreter, like lyse routines and labscript compilation.

So that far away code can blacklist itself, ModuleWatcher should provide access to an existing instance.

@philipstarkey
Copy link
Member Author

Original comment by Chris Billington (Bitbucket: cbillington, GitHub: chrisjbillington).


  • Edited issue description

@philipstarkey philipstarkey added minor enhancement New feature or request labels Apr 5, 2020
Loki27182 pushed a commit to Loki27182/labscript-utils that referenced this issue Oct 9, 2023
…suite#7)

setup_logging use program name instead of __main__ location for log file location

Approved-by: Philip Starkey <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request minor
Projects
None yet
Development

No branches or pull requests

1 participant