Ignore:
Timestamp:
28 Nov 2014, 08:50:17 (10 years ago)
Author:
Henrik Bettermann
Message:

Rename some exporter classes: singular not plural.

Location:
main/waeup.kofa/trunk/src/waeup/kofa
Files:
6 edited

Legend:

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

    r10654 r12079  
    6363        return self.export(containers.values(), filepath)
    6464
    65 class ApplicantsExporter(grok.GlobalUtility, ExporterBase):
     65class ApplicantExporter(grok.GlobalUtility, ExporterBase):
    6666    """Exporter for Applicants.
    6767    """
     
    8888            value = str('%s#' % value)
    8989        return super(
    90             ApplicantsExporter, self).mangle_value(
     90            ApplicantExporter, self).mangle_value(
    9191            value, name, context=context)
    9292
  • main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_export.py

    r11869 r12079  
    1111from waeup.kofa.applicants import ApplicantsContainer
    1212from waeup.kofa.applicants.export import (
    13     ApplicantsContainerExporter, ApplicantsExporter)
     13    ApplicantsContainerExporter, ApplicantExporter)
    1414from waeup.kofa.applicants.interfaces import (
    1515    AppCatSource, ApplicationTypeSource)
     
    8181        return
    8282
    83 class ApplicantsExporterTest(ApplicantImportExportSetup):
     83class ApplicantExporterTest(ApplicantImportExportSetup):
    8484
    8585    layer = FunctionalLayer
    8686
    8787    def setUp(self):
    88         super(ApplicantsExporterTest, self).setUp()
     88        super(ApplicantExporterTest, self).setUp()
    8989        self.outfile = os.path.join(self.workdir, 'myoutput.csv')
    9090        self.cat = getUtility(ICatalog, name='applicants_catalog')
     
    9494    def test_ifaces(self):
    9595        # make sure we fullfill interface contracts
    96         obj = ApplicantsExporter()
     96        obj = ApplicantExporter()
    9797        verifyObject(ICSVExporter, obj)
    98         verifyClass(ICSVExporter, ApplicantsExporter)
     98        verifyClass(ICSVExporter, ApplicantExporter)
    9999        return
    100100
     
    132132        # we can export nearly empty applicants
    133133        self.applicant.applicant_id = u'dp2011_654321'
    134         exporter = ApplicantsExporter()
     134        exporter = ApplicantExporter()
    135135        exporter.export([self.applicant], self.outfile)
    136136        result = open(self.outfile, 'rb').read()
     
    156156        # set values we can expect in export file
    157157        applicant = self.setup_applicant(self.applicant)
    158         exporter = ApplicantsExporter()
     158        exporter = ApplicantExporter()
    159159        exporter.export([applicant], self.outfile)
    160160        result = open(self.outfile, 'rb').read()
     
    183183        # set values we can expect in export file
    184184        self.applicant = self.setup_applicant(self.applicant)
    185         exporter = ApplicantsExporter()
     185        exporter = ApplicantExporter()
    186186        exporter.export_all(self.app, self.outfile)
    187187        result = open(self.outfile, 'rb').read()
     
    204204    def test_export_filtered(self):
    205205        self.applicant = self.setup_applicant(self.applicant)
    206         exporter = ApplicantsExporter()
     206        exporter = ApplicantExporter()
    207207        exporter.export_filtered(
    208208            self.app, self.outfile, container=self.container.code)
  • main/waeup.kofa/trunk/src/waeup/kofa/students/export.py

    r11757 r12079  
    226226
    227227
    228 class StudentsExporter(grok.GlobalUtility, StudentExporterBase):
     228class StudentExporter(grok.GlobalUtility, StudentExporterBase):
    229229    """Exporter for Students.
    230230    """
     
    247247            value = str('%s#' % value)
    248248        return super(
    249             StudentsExporter, self).mangle_value(
     249            StudentExporter, self).mangle_value(
    250250            value, name, context=context)
    251251
     
    438438            value, name, context=context)
    439439
    440 class StudentPaymentsOverviewExporter(StudentsExporter):
     440class StudentPaymentsOverviewExporter(StudentExporter):
    441441    """Exporter for students with payment overview.
    442442    """
     
    470470                value = ''
    471471        return super(
    472             StudentsExporter, self).mangle_value(
    473             value, name, context=context)
    474 
    475 class StudentStudyLevelsOverviewExporter(StudentsExporter):
     472            StudentExporter, self).mangle_value(
     473            value, name, context=context)
     474
     475class StudentStudyLevelsOverviewExporter(StudentExporter):
    476476    """Exporter for students with study level overview.
    477477    """
     
    502502                    break
    503503        return super(
    504             StudentsExporter, self).mangle_value(
     504            StudentExporter, self).mangle_value(
    505505            value, name, context=context)
    506506
  • main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_export.py

    r11756 r12079  
    1010from waeup.kofa.students.catalog import StudentsQuery
    1111from waeup.kofa.students.export import (
    12     StudentsExporter, StudentStudyCourseExporter, StudentStudyLevelExporter,
     12    StudentExporter, StudentStudyCourseExporter, StudentStudyLevelExporter,
    1313    CourseTicketExporter, StudentPaymentsExporter, BedTicketsExporter,
    1414    StudentPaymentsOverviewExporter, StudentStudyLevelsOverviewExporter,
     
    101101
    102102
    103 class StudentsExporterTest(StudentImportExportSetup):
     103class StudentExporterTest(StudentImportExportSetup):
    104104
    105105    layer = FunctionalLayer
     
    112112
    113113    def setUp(self):
    114         super(StudentsExporterTest, self).setUp()
     114        super(StudentExporterTest, self).setUp()
    115115        self.setup_for_export()
    116116        return
     
    118118    def test_ifaces(self):
    119119        # make sure we fullfill interface contracts
    120         obj = StudentsExporter()
     120        obj = StudentExporter()
    121121        verifyObject(ICSVStudentExporter, obj)
    122         verifyClass(ICSVStudentExporter, StudentsExporter)
     122        verifyClass(ICSVStudentExporter, StudentExporter)
    123123        return
    124124
     
    133133        # set values we can expect in export file
    134134        self.setup_student(self.student)
    135         exporter = StudentsExporter()
     135        exporter = StudentExporter()
    136136        exporter.export([self.student], self.outfile)
    137137        result = open(self.outfile, 'rb').read()
     
    155155        # set values we can expect in export file
    156156        self.setup_student(self.student)
    157         exporter = StudentsExporter()
     157        exporter = StudentExporter()
    158158        exporter.export_all(self.app, self.outfile)
    159159        result = open(self.outfile, 'rb').read()
     
    175175        # we can export a single student
    176176        self.setup_student(self.student)
    177         exporter = StudentsExporter()
     177        exporter = StudentExporter()
    178178        exporter.export_student(self.student, self.outfile)
    179179        result = open(self.outfile, 'rb').read()
     
    197197        self.app['students'].addStudent(self.student)
    198198        notify(grok.ObjectModifiedEvent(self.student))
    199         exporter = StudentsExporter()
     199        exporter = StudentExporter()
    200200
    201201        exporter.export_filtered(
     
    249249        self.app['students'].addStudent(self.student)
    250250        notify(grok.ObjectModifiedEvent(self.student))
    251         exporter = StudentsExporter()
     251        exporter = StudentExporter()
    252252        # current_session can be both a string ...
    253253        exporter.export_filtered(
     
    269269        self.app['students'].addStudent(self.student)
    270270        notify(grok.ObjectModifiedEvent(self.student))
    271         exporter = StudentsExporter()
     271        exporter = StudentExporter()
    272272
    273273        exporter.export_filtered(
  • main/waeup.kofa/trunk/src/waeup/kofa/userscontainer.py

    r10648 r12079  
    6666
    6767
    68 class UsersExporter(grok.GlobalUtility, ExporterBase):
     68class UserExporter(grok.GlobalUtility, ExporterBase):
    6969    """Exporter for user accounts.
    7070    """
     
    9898                value[role] = object_list
    9999        return super(
    100             UsersExporter, self).mangle_value(
     100            UserExporter, self).mangle_value(
    101101            value, name, context=context)
    102102
  • main/waeup.kofa/trunk/src/waeup/kofa/userscontainer.txt

    r9283 r12079  
    5050We can export user accounts:
    5151
    52     >>> from waeup.kofa.userscontainer import UsersExporter
     52    >>> from waeup.kofa.userscontainer import UserExporter
    5353    >>> import os
    5454    >>> import tempfile
    5555    >>> workdir = tempfile.mkdtemp()
    5656    >>> outfile = os.path.join(workdir, 'myoutput.csv')
    57     >>> exporter = UsersExporter()
     57    >>> exporter = UserExporter()
    5858    >>> site = {'users':myusers}
    5959    >>> exporter.export_all(site, outfile)
Note: See TracChangeset for help on using the changeset viewer.