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:
6 edited
1 moved

Legend:

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

    r5637 r5676  
    1 """This package contains everything regarding student applications.
     1"""This package contains everything regarding university applicants.
    22"""
    33# Make this a package.
  • main/waeup.sirp/trunk/src/waeup/sirp/applicants/container.py

    r5650 r5676  
    2121##
    2222"""
    23 Containers for student applications.
     23Containers for university applicants.
    2424"""
    2525import grok
    26 from waeup.sirp.applications.interfaces import IApplicationContainer
     26from waeup.sirp.applicants.interfaces import IApplicantsContainer
    2727
    28 class ApplicationContainer(grok.Container):
    29     """An application container contains student applications.
     28class ApplicantsContainer(grok.Container):
     29    """An applicants container contains university applicants.
    3030    """
    31     grok.implements(IApplicationContainer)
     31    grok.implements(IApplicantsContainer)
    3232
    3333    id = None
     
    3939
    4040    def archive(self, app_ids=None):
    41         """Create on-dist archive of applications stored in this term.
     41        """Create on-dist archive of applicants stored in this term.
    4242
    43         If app_ids is `None`, all applications are archived.
     43        If app_ids is `None`, all applicants are archived.
    4444
    4545        If app_ids contains a single id string, only the respective
    46         applications are archived.
     46        applicants are archived.
    4747
    4848        If app_ids contains a list of id strings all of the respective
    49         application types are saved to disk.
     49        applicants types are saved to disk.
    5050        """
    5151        raise NotImplemented()
    5252
    5353    def clear(self, app_ids=None, archive=True):
    54         """Remove applications of type given by 'id'.
     54        """Remove applicants of type given by 'id'.
    5555
    56         Optionally archive the applications.
     56        Optionally archive the applicants.
    5757       
    58         If id is `None`, all applications are archived.
     58        If id is `None`, all applicants are archived.
    5959
    6060        If id contains a single id string, only the respective
    61         applications are archived.
     61        applicants are archived.
    6262
    6363        If id contains a list of id strings all of the respective
    64         application types are saved to disk.
     64        applicant types are saved to disk.
    6565
    6666        If `archive` is ``False`` none of the archive-handling is done
    67         and respective applications are simply removed from the
     67        and respective applicants are simply removed from the
    6868        database.
    6969        """
  • main/waeup.sirp/trunk/src/waeup/sirp/applicants/interfaces.py

    r5645 r5676  
    2020## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
    2121##
    22 """Interfaces regarding student applications and related components.
     22"""Interfaces regarding student applicants and related components.
    2323"""
    2424from zope import schema
    2525from waeup.sirp.interfaces import IWAeUPObject
    2626
    27 class IApplicationsRoot(IWAeUPObject):
    28     """A container for student application containers.
     27class IApplicantsRoot(IWAeUPObject):
     28    """A container for university applicants containers.
    2929    """
    30     def addApplicationContainer(container, name=None):
    31         """Add an application container.
     30    def addApplicantsContainer(container, name=None):
     31        """Add an applicants container.
    3232
    33         Adds an application container that implements `interface`
     33        Adds an applicants container that implements `interface`
    3434        under the name `name`.
    3535
    3636        `container` the container instance to be added. Should
    37           implement :class:`IApplicationContainer`.
     37          implement :class:`IApplicantsContainer`.
    3838
    3939        `name`
    4040          the name under which the container will be accessible. We
    4141          usually use names like ``pume_2011`` to indicate, that the
    42           new container will contain student applications for a
     42          new container will contain university applicants for a
    4343          certain screening type (``pume``) and of the year 2011.
    4444        """
    4545
    46 class IApplicationContainer(IWAeUPObject):
    47     """An application container contains student applications.
     46class IApplicantsContainer(IWAeUPObject):
     47    """An applicants container contains university applicants.
    4848
    4949    """
     
    5454
    5555    title = schema.TextLine(
    56         title = u'Short description of the type of applications stored here.',
     56        title = u'Short description of the type of applicants stored here.',
    5757        required = True,
    5858        default = u'Untitled',
     
    8484
    8585    def archive(id=None):
    86         """Create on-dist archive of applications stored in this term.
     86        """Create on-dist archive of applicants stored in this term.
    8787
    88         If id is `None`, all applications are archived.
     88        If id is `None`, all applicants are archived.
    8989
    9090        If id contains a single id string, only the respective
    91         applications are archived.
     91        applicants are archived.
    9292
    9393        If id contains a list of id strings all of the respective
    94         application types are saved to disk.
     94        applicants types are saved to disk.
    9595        """
    9696
    9797    def clear(id=None, archive=True):
    98         """Remove applications of type given by 'id'.
     98        """Remove applicants of type given by 'id'.
    9999
    100         Optionally archive the applications.
     100        Optionally archive the applicants.
    101101       
    102         If id is `None`, all applications are archived.
     102        If id is `None`, all applicants are archived.
    103103
    104104        If id contains a single id string, only the respective
    105         applications are archived.
     105        applicants are archived.
    106106
    107107        If id contains a list of id strings all of the respective
    108         application types are saved to disk.
     108        applicant types are saved to disk.
    109109
    110110        If `archive` is ``False`` none of the archive-handling is done
    111         and respective applications are simply removed from the
     111        and respective applicants are simply removed from the
    112112        database.
    113113        """
  • 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)
  • main/waeup.sirp/trunk/src/waeup/sirp/applicants/tests/test_container.py

    r5647 r5676  
    2121##
    2222"""
    23 Tests for application containers.
     23Tests for applicants containers.
    2424"""
    2525import unittest
    2626from zope.interface.verify import verifyClass, verifyObject
    27 from waeup.sirp.applications import interfaces
    28 from waeup.sirp.applications.container import ApplicationContainer
     27from waeup.sirp.applicants import interfaces
     28from waeup.sirp.applicants.container import ApplicantsContainer
    2929
    30 class ApplicationContainerTestCase(unittest.TestCase):
     30class ApplicantsContainerTestCase(unittest.TestCase):
    3131
    3232    def test_interfaces(self):
     
    3434        self.assertTrue(
    3535            verifyClass(
    36                 interfaces.IApplicationContainer, ApplicationContainer)
     36                interfaces.IApplicantsContainer, ApplicantsContainer)
    3737            )
    3838        self.assertTrue(
    3939            verifyObject(
    40                 interfaces.IApplicationContainer, ApplicationContainer())
     40                interfaces.IApplicantsContainer, ApplicantsContainer())
    4141            )
    4242        return
     
    4646    suite.addTests(
    4747        unittest.TestLoader().loadTestsFromTestCase(
    48             ApplicationContainerTestCase,
     48            ApplicantsContainerTestCase,
    4949            )
    5050        )
  • main/waeup.sirp/trunk/src/waeup/sirp/applicants/tests/test_root.py

    r5659 r5676  
    2121##
    2222"""
    23 Test applications root.
     23Test applicants root.
    2424"""
    2525import logging
     
    2727from StringIO import StringIO
    2828from zope.interface.verify import verifyClass, verifyObject
    29 from waeup.sirp.applications import interfaces
    30 from waeup.sirp.applications.root import (
    31     ApplicationsRoot, ApplicationsPlugin,
     29from waeup.sirp.applicants import interfaces
     30from waeup.sirp.applicants.root import (
     31    ApplicantsRoot, ApplicantsPlugin,
    3232    )
    3333
     
    3535    pass
    3636
    37 class ApplicationsRootTestCase(unittest.TestCase):
     37class ApplicantsRootTestCase(unittest.TestCase):
    3838
    3939    def test_interfaces(self):
     
    4141        self.assertTrue(
    4242            verifyClass(
    43                 interfaces.IApplicationsRoot, ApplicationsRoot)
     43                interfaces.IApplicantsRoot, ApplicantsRoot)
    4444            )
    4545        self.assertTrue(
    4646            verifyObject(
    47                 interfaces.IApplicationsRoot, ApplicationsRoot())
     47                interfaces.IApplicantsRoot, ApplicantsRoot())
    4848            )
    4949        return
    5050
    51 class ApplicationsRootPluginTestCase(unittest.TestCase):
     51class ApplicantsRootPluginTestCase(unittest.TestCase):
    5252    def create_logger(self):
    5353        # create a logger suitable for local tests.
    54         test_logger = logging.getLogger('waeup.sirp.applications.testlogger')
     54        test_logger = logging.getLogger('waeup.sirp.applicants.testlogger')
    5555        log = StringIO()
    5656        handler = logging.StreamHandler(log)
     
    8383    # Real tests start here...
    8484    def test_pluginsetup(self):
    85         # Make sure we can add ApplicationsRoot to sites.
     85        # Make sure we can add ApplicantsRoot to sites.
    8686        site = FakeSite()
    87         plugin = ApplicationsPlugin()
     87        plugin = ApplicantsPlugin()
    8888        plugin.setup(site, 'blah', self.logger)
    89         self.assertTrue('applications' in site.keys())
     89        self.assertTrue('applicants' in site.keys())
    9090        log = self.get_log()
    91         self.assertTrue('Installed applications root.' in log)
     91        self.assertTrue('Installed applicants root.' in log)
    9292        return
    9393
    9494    def test_update_new(self):
    95         # Run update on a site without applications root.
     95        # Run update on a site without applicants root.
    9696        site = FakeSite()
    97         plugin = ApplicationsPlugin()
     97        plugin = ApplicantsPlugin()
    9898        plugin.update(site, 'blah', self.logger)
    99         self.assertTrue('applications' in site.keys())
     99        self.assertTrue('applicants' in site.keys())
    100100        log = self.get_log()
    101101        self.assertTrue('Updating site at Unnamed Site' in log)
    102         self.assertTrue('Installed applications root.' in log)
     102        self.assertTrue('Installed applicants root.' in log)
    103103        return
    104104
    105105    def test_update_outdated(self):
    106         # Run update on a site with outdated applications root.
     106        # Run update on a site with outdated applicants root.
    107107        site = FakeSite()
    108         root = object() # # This is not a proper applications root
    109         site['applications'] = root
    110         plugin = ApplicationsPlugin()
     108        root = object() # # This is not a proper applicants root
     109        site['applicants'] = root
     110        plugin = ApplicantsPlugin()
    111111        plugin.update(site, 'blah', self.logger)
    112         self.assertTrue(site['applications'] is not root)
    113         self.assertTrue(isinstance(site['applications'], ApplicationsRoot))
     112        self.assertTrue(site['applicants'] is not root)
     113        self.assertTrue(isinstance(site['applicants'], ApplicantsRoot))
    114114        log = self.get_log()
    115         self.assertTrue('Outdated applications folder detected' in log)
     115        self.assertTrue('Outdated applicants folder detected' in log)
    116116        self.assertTrue('Updating site at Unnamed Site' in log)
    117         self.assertTrue('Installed applications root.' in log)
     117        self.assertTrue('Installed applicants root.' in log)
    118118        return
    119119
    120120    def test_update_uptodate(self):
    121         # Run update on a site with proper applications root.
     121        # Run update on a site with proper applicants root.
    122122        site = FakeSite()
    123         root = ApplicationsRoot()
    124         site['applications'] = root
    125         plugin = ApplicationsPlugin()
     123        root = ApplicantsRoot()
     124        site['applicants'] = root
     125        plugin = ApplicantsPlugin()
    126126        plugin.update(site, 'blah', self.logger)
    127         self.assertTrue(site['applications'] is root)
     127        self.assertTrue(site['applicants'] is root)
    128128        log = self.get_log()
    129129        self.assertTrue('Updating site at Unnamed Site' in log)
     
    135135        site = FakeSite()
    136136        site.__name__ = 'my_site'
    137         plugin = ApplicationsPlugin()
     137        plugin = ApplicantsPlugin()
    138138        plugin.update(site, 'blah', self.logger)
    139139        log = self.get_log()
     
    144144    suite = unittest.TestSuite()
    145145    for testcase in [
    146             ApplicationsRootTestCase,
    147             ApplicationsRootPluginTestCase,
     146            ApplicantsRootTestCase,
     147            ApplicantsRootPluginTestCase,
    148148            ]:
    149149        suite.addTests(unittest.TestLoader().loadTestsFromTestCase(testcase))
Note: See TracChangeset for help on using the changeset viewer.