Changeset 8010 for main/waeup.kofa/trunk


Ignore:
Timestamp:
30 Mar 2012, 10:32:27 (13 years ago)
Author:
Henrik Bettermann
Message:

Remove ApplicantContainerProviderSource? too.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/applicants/interfaces.py

    r8008 r8010  
    135135#            apppins_dict[value][1],self.apppins_dict[value][0])
    136136
    137 class ApplicantContainerProviderSource(BasicSourceFactory):
    138     """A source offering all available applicants container types.
    139 
    140     The values returned by this source are names of utilities that can
    141     create :class:`ApplicantContainer` instances. So, if you get a
    142     name like ``'myactype'`` from this source, then you can do:
    143 
    144       >>> from zope.component import getUtility
    145       >>> p = getUtility(IApplicantsContainerProvider, name=myactype)
    146       >>> my_applicants_container = p.factory()
    147 
    148     Or you can access class-attributes like
    149 
    150       >>> my_applicants_container.container_title
    151       'Pretty'
    152 
    153     """
    154     def getValues(self):
    155         """Returns a list of ``(<name>, <provider>)`` tuples.
    156 
    157         Here ``<name>`` is the name under which an
    158         :class:``ApplicantContainerProvider`` was registered as a
    159         utility and ``<provider>`` is the utility itself.
    160         """
    161         return getUtilitiesFor(IApplicantsContainerProvider)
    162 
    163     def getToken(self, value):
    164         """Return the name of the ``(<name>, <provider>)`` tuple.
    165         """
    166         return value[0]
    167 
    168     def getTitle(self, value):
    169         """Get a 'title - description' string for a container type.
    170         """
    171         factory = value[1].factory
    172         return "%s - %s" % (
    173             factory.container_title, factory.container_description)
    174137
    175138class IApplicantsUtils(Interface):
Note: See TracChangeset for help on using the changeset viewer.