27"""This module defines the ButlerFactory class."""
33 """ButlerFactory creates data Butlers containing data mappers. Use of it
34 is deprecated
in favor of the direct Butler constructor.
36 The ButlerFactory
class takes a
mapper for a data collection.
37 It can then create Butlers
with these mappers.
39 A data identifier
is a dictionary. The keys match those understood by a
40 mapper; the values select particular data sets
or collections of data
41 sets. For example, one key might be
"visit". Specifying a value of
42 "695934" for this key might select a collection of images.
44 The mappers perform four functions:
45 1. Determine what keys are valid
for dataset ids.
46 2. Obtain a collection of potential dataset ids matching a
48 3. Map a dataset id to the location of the dataset, including its
50 4. Manipulate a retrieved dataset object so that it conforms to a
61 """Construct a ButlerFactory.
63 @param mapper mapper object.
71 @returns a new Butler.
74 if hasattr(self.
mappermapper,
'root'):
75 root = self.
mappermapper.root
def __init__(self, mapper)