|
lsst.pex.config
19.0.0+1
|
Public Member Functions | |
| def | __init__ (self) |
| def | __enter__ (self) |
| def | __exit__ (self, args) |
| def | uninstall (self) |
| def | find_module (self, fullname, path=None) |
| def | getModules (self) |
Public Attributes | |
| origMetaPath | |
Importer (for `sys.meta_path`) that records which modules are being
imported.
*This class does not do any importing itself.*
Examples
--------
Use this class as a context manager to ensure it is properly uninstalled
when done:
>>> with RecordingImporter() as importer:
... # import stuff
... import numpy as np
... print("Imported: " + importer.getModules())
| def pex.config.config.RecordingImporter.find_module | ( | self, | |
| fullname, | |||
path = None |
|||
| ) |
Called as part of the ``import`` chain of events.
| def pex.config.config.RecordingImporter.getModules | ( | self | ) |
Get the set of modules that were imported.
Returns
-------
modules : `set` of `str`
Set of imported module names.
| def pex.config.config.RecordingImporter.uninstall | ( | self | ) |
Uninstall the importer.
1.8.13