lsst.pex.config g87000a63fb+c77d247713
Public Member Functions | Public Attributes | List of all members
lsst.pex.config.config.RecordingImporter Class Reference

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
 

Detailed Description

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())

Member Function Documentation

◆ find_module()

def lsst.pex.config.config.RecordingImporter.find_module (   self,
  fullname,
  path = None 
)
Called as part of the ``import`` chain of events.

◆ getModules()

def lsst.pex.config.config.RecordingImporter.getModules (   self)
Get the set of modules that were imported.

Returns
-------
modules : `set` of `str`
    Set of imported module names.

◆ uninstall()

def lsst.pex.config.config.RecordingImporter.uninstall (   self)
Uninstall the importer.

The documentation for this class was generated from the following file: