Ignore:
Timestamp:
25 Jan 2011, 13:21:00 (14 years ago)
Author:
Henrik Bettermann
Message:

Rename applications to applicants.

Location:
main/waeup.sirp/trunk/src/waeup/sirp/applicants
Files:
1 edited
1 moved

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/trunk/src/waeup/sirp/applicants/root.py

    r5670 r5676  
    2121##
    2222"""
    23 The root for applications.
     23The root for applicants.
    2424"""
    2525import grok
    2626from waeup.sirp.interfaces import IWAeUPSIRPPluggable
    27 from waeup.sirp.applications.interfaces import IApplicationsRoot
     27from waeup.sirp.applicants.interfaces import IApplicantsRoot
    2828
    29 class ApplicationsRoot(grok.Container):
    30     """The root of student applications-related components.
     29class ApplicantsRoot(grok.Container):
     30    """The root of applicants-related components. It contains primarily
     31    containers for applicants.
    3132    """
    32     grok.implements(IApplicationsRoot)
     33    grok.implements(IApplicantsRoot)
    3334
    34     def addApplicationContainer(self, container, name=None):
    35         """Add an application container.
     35    def addApplicantsContainer(self, container, name=None):
     36        """Add an applicants container.
    3637
    37         Adds an application container that implements `interface`
     38        Adds an applicants container that implements `interface`
    3839        under the name `name`.
    3940
    4041        `container`
    4142          the container instance to be added. Should
    42           implement :class:`IApplicationContainer`.
     43          implement :class:`IApplicantsContainer`.
    4344
    4445        `name`
    4546          the name under which the container will be accessible. We
    4647          usually use names like ``pume_2011`` to indicate, that the
    47           new container will contain student applications for a
     48          new container will contain student applicants for a
    4849          certain screening type (``pume``) and of the year 2011.
    4950
     
    5253        return
    5354
    54 class ApplicationsPlugin(grok.GlobalUtility):
    55     """A WAeUPSIRPPlugin that creates an applications root in portal.
     55class ApplicantsPlugin(grok.GlobalUtility):
     56    """A WAeUPSIRPPlugin that creates an applicants root in portal.
    5657
    5758    This plugin should be called by a typical
     
    6263    Implements :class:`waeup.sirp.interfaces.IWAeUPSIRPPluggable`
    6364    """
    64     grok.name('applications')
     65    grok.name('applicants')
    6566    grok.implements(IWAeUPSIRPPluggable)
    66     log_prefix = 'ApplicationsPlugin'
     67    log_prefix = 'ApplicantsPlugin'
    6768
    6869    def setup(self, site, name, logger):
    69         """Create a new :class:`ApplicationsRoot` instance in `site`.
     70        """Create a new :class:`ApplicantsRoot` instance in `site`.
    7071        """
    71         site['applications'] = ApplicationsRoot()
     72        site['applicants'] = ApplicantsRoot()
    7273        logger.info(
    73             '%s: Installed applications root.' % (self.log_prefix,)
     74            '%s: Installed applicants root.' % (self.log_prefix,)
    7475            )
    7576        return
    7677
    7778    def update(self, site, name, logger):
    78         """Update site wide ``applications`` root.
     79        """Update site wide ``applicants`` root.
    7980
    80         If the site already contains a suitable ``applications`` root,
     81        If the site already contains a suitable ``applicants`` root,
    8182        leave it that way. If not create one and delete the old one if
    8283        appropriate.
    8384        """
    84         app_folder = site.get('applications', None)
     85        app_folder = site.get('applicants', None)
    8586        site_name = getattr(site, '__name__', 'Unnamed Site?')
    86         if IApplicationsRoot.providedBy(app_folder):
    87             # Applications up to date. Return.
     87        if IApplicantsRoot.providedBy(app_folder):
     88            # Applicants up to date. Return.
    8889            logger.info(
    8990                '%s: Updating site at %s: Nothing to do.' % (
     
    9293            return
    9394        elif app_folder is not None:
    94             # Applications need update. Remove old instance.
     95            # Applicants need update. Remove old instance.
    9596            logger.warn(
    96                 '%s: Outdated applications folder detected at site %s.'
     97                '%s: Outdated applicants folder detected at site %s.'
    9798                'Removing it.' % (self.log_prefix, site_name)
    9899                    )
    99             del site['applications']
    100         # Add new applications.
     100            del site['applicants']
     101        # Add new applicants.
    101102        logger.info(
    102103            '%s: Updating site at %s. Installing '
    103             'applications.' % (self.log_prefix, site_name,)
     104            'applicants.' % (self.log_prefix, site_name,)
    104105            )
    105106        self.setup(site, name, logger)
Note: See TracChangeset for help on using the changeset viewer.