Coverage for control/cust/factory_details.py : 100%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
1"""Factory to make derived Details classes."""
3from config import Names as N
4from control.utils import factory as baseFactory
6from control.details import Details
7from control.cust.assessment_details import AssessmentD
8from control.cust.contrib_details import ContribD
9from control.cust.criteriaentry_details import CriteriaEntryD
10from control.cust.review_details import ReviewD
13DERIVEDS = (
14 (N.assessment, AssessmentD),
15 (N.contrib, ContribD),
16 (N.criteriaEntry, CriteriaEntryD),
17 (N.review, ReviewD),
18)
19"""Search space for classes derived from `control.details.Details`."""
22def factory(name):
23 """Look up a derived class by registered name.
25 See `DERIVEDS`.
27 Parameters
28 ----------
29 name: string
30 The name under which the derived class is registered.
32 Returns
33 -------
34 class
35 The derived class if it can be found, otherwise the base class.
36 """
38 return baseFactory(name, Details, DERIVEDS)