lsst.pex.config  18.0.0+1
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())

Definition at line 610 of file config.py.

Constructor & Destructor Documentation

◆ __init__()

def lsst.pex.config.config.RecordingImporter.__init__ (   self)

Definition at line 627 of file config.py.

Member Function Documentation

◆ __enter__()

def lsst.pex.config.config.RecordingImporter.__enter__ (   self)

Definition at line 630 of file config.py.

◆ __exit__()

def lsst.pex.config.config.RecordingImporter.__exit__ (   self,
  args 
)

Definition at line 635 of file config.py.

◆ find_module()

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

Definition at line 644 of file config.py.

◆ 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.

Definition at line 651 of file config.py.

◆ uninstall()

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

Definition at line 639 of file config.py.

Member Data Documentation

◆ origMetaPath

lsst.pex.config.config.RecordingImporter.origMetaPath

Definition at line 631 of file config.py.


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