lsst.obs.base  21.0.0-13-ge9a044d+c2b517099a
Public Member Functions | Public Attributes | List of all members
lsst.obs.base.gen2to3.repoWalker.scanner.DirectoryScanner Class Reference

Public Member Functions

def __init__ (self, Optional[Log] log=None)
 
def add (self, PathElementHandler handler)
 
Iterator[PathElementHandler__iter__ (self)
 
def scan (self, str path, Mapping[DatasetType, Mapping[Optional[str], List[FileDataset]]] datasets, *Callable[[DataCoordinate], bool] predicate)
 

Public Attributes

 log
 

Detailed Description

An object that uses `PathElementHandler` instances to process the files
and subdirectories in a directory tree.

Parameters
----------
log : `Log`, optional
    Log to use to report warnings and debug information.

Definition at line 162 of file scanner.py.

Constructor & Destructor Documentation

◆ __init__()

def lsst.obs.base.gen2to3.repoWalker.scanner.DirectoryScanner.__init__ (   self,
Optional[Log]   log = None 
)

Definition at line 171 of file scanner.py.

Member Function Documentation

◆ __iter__()

Iterator[PathElementHandler] lsst.obs.base.gen2to3.repoWalker.scanner.DirectoryScanner.__iter__ (   self)
Iterate over all handlers.

Definition at line 194 of file scanner.py.

◆ add()

def lsst.obs.base.gen2to3.repoWalker.scanner.DirectoryScanner.add (   self,
PathElementHandler  handler 
)
Add a new handler to the scanner.

Parameters
----------
handler : `PathElementHandler`
    The handler to be added.

Definition at line 180 of file scanner.py.

◆ scan()

def lsst.obs.base.gen2to3.repoWalker.scanner.DirectoryScanner.scan (   self,
str  path,
Mapping[DatasetType, Mapping[Optional[str], List[FileDataset]]]  datasets,
*Callable[[DataCoordinate], bool]  predicate 
)
Process a directory.

Parameters
----------
path : `str`
    Full path to the directory to be processed.
datasets : `dict` [`DatasetType`, `list` ]
    Dictionary that found datasets should be added to.  Nested lists
    elements are tuples of `FileDataset` and an optional "CALIBDATE"
    `str` value (for calibration datasets only).
predicate : `~collections.abc.Callable`
    A callable taking a single `DataCoordinate` argument and returning
    `bool`, indicating whether that (Gen3) data ID represents one
    that should be included in the scan.

Definition at line 200 of file scanner.py.

Member Data Documentation

◆ log

lsst.obs.base.gen2to3.repoWalker.scanner.DirectoryScanner.log

Definition at line 176 of file scanner.py.


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