lsst.pex.config  14.0-2-g319577b+8
Public Member Functions | Public Attributes | List of all members
lsst.pex.config.config.RecordingImporter Class Reference
Inheritance diagram for lsst.pex.config.config.RecordingImporter:

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

An Importer (for sys.meta_path) that records which modules are being imported.

Objects also act as Context Managers, so you can:
    with RecordingImporter() as importer:
        import stuff
    print("Imported: " + importer.getModules())
This ensures it is properly uninstalled when done.

This class makes no effort to do any importing itself.

Definition at line 378 of file config.py.

Constructor & Destructor Documentation

◆ __init__()

def lsst.pex.config.config.RecordingImporter.__init__ (   self)
Create and install the Importer

Definition at line 389 of file config.py.

Member Function Documentation

◆ __enter__()

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

Definition at line 393 of file config.py.

◆ __exit__()

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

Definition at line 399 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.

We return None because we don't do any importing.

Definition at line 407 of file config.py.

◆ getModules()

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

Definition at line 415 of file config.py.

◆ uninstall()

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

Definition at line 403 of file config.py.

Member Data Documentation

◆ origMetaPath

lsst.pex.config.config.RecordingImporter.origMetaPath

Definition at line 395 of file config.py.


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