Changeset 12283


Ignore:
Timestamp:
21 Dec 2014, 11:26:41 (10 years ago)
Author:
Henrik Bettermann
Message:

Make selection of processors and exporters customizable.

Location:
main/waeup.ikoba/trunk/src/waeup/ikoba
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.ikoba/trunk/src/waeup/ikoba/browser/pages.py

    r12229 r12283  
    964964    def getImporters(self):
    965965        importers = getAllUtilitiesRegisteredFor(IBatchProcessor)
     966        ikoba_utils = getUtility(IIkobaUtils)
    966967        importer_props = []
    967968        for x in importers:
     969            if not x.util_name in ikoba_utils.BATCH_PROCESSOR_NAMES:
     970                continue
    968971            iface_fields = schema.getFields(x.iface)
    969972            available_fields = []
     
    10851088    def getImporters(self):
    10861089        importers = getAllUtilitiesRegisteredFor(IBatchProcessor)
     1090        ikoba_utils = getUtility(IIkobaUtils)
    10871091        importers = sorted(
    1088             [dict(title=x.name, name=x.util_name) for x in importers])
     1092            [dict(title=x.name, name=x.util_name) for x in importers
     1093            if x.util_name in ikoba_utils.BATCH_PROCESSOR_NAMES])
    10891094        return importers
    10901095
     
    14391444
    14401445    def getExporters(self):
    1441         utils = getUtilitiesFor(ICSVExporter)
     1446        exporter_utils = getUtilitiesFor(ICSVExporter)
     1447        ikoba_utils = getUtility(IIkobaUtils)
    14421448        title_name_tuples = [
    1443             (util.title, name) for name, util in utils]
     1449            (util.title, name) for name, util in exporter_utils
     1450            if name in ikoba_utils.EXPORTER_NAMES]
    14441451        return sorted(title_name_tuples)
    14451452
  • main/waeup.ikoba/trunk/src/waeup/ikoba/customers/batching.py

    r12281 r12283  
    560560    grok.name(util_name)
    561561
    562     name = _('Sample Contract Processor')
     562    name = _('Customer Sample Contract Processor')
    563563    iface = ISampleContract
    564564    factory_name = 'waeup.SampleContract'
  • main/waeup.ikoba/trunk/src/waeup/ikoba/customers/export.py

    r12280 r12283  
    247247    iface = ISampleContract
    248248    class_name = 'SampleContract'
    249     title = _(u'Sample Contracts')
     249    title = _(u'Customer Sample Contracts')
  • main/waeup.ikoba/trunk/src/waeup/ikoba/customers/tests/test_batching.py

    r12281 r12283  
    502502            if len(i) > 10][0]
    503503        self.assertTrue(
    504             'INFO - system - Sample Contract Processor - sample_contract_data - '
     504            'INFO - system - Customer Sample Contract Processor - sample_contract_data - '
    505505            'X666666 - %s - updated: title=My 4th contract, '
    506506            'product_object=SAM, document_object=DOC1' % conid
  • main/waeup.ikoba/trunk/src/waeup/ikoba/utils/utils.py

    r12192 r12283  
    2929from waeup.ikoba.smtp import send_mail as send_mail_internally
    3030from waeup.ikoba.utils.helpers import get_sorted_preferred
     31from waeup.ikoba.customers.export import EXPORTER_NAMES as CUSTOMER_EXPORTER_NAMES
    3132
    3233
     
    137138        'cpu-load': 100.0,
    138139        }
     140
     141    EXPORTER_NAMES = CUSTOMER_EXPORTER_NAMES + (
     142        'pdfdocuments',
     143        'htmldocuments',
     144        'users',
     145        'products')
     146
     147    BATCH_PROCESSOR_NAMES = (
     148        'customerprocessor',
     149        'customersampledocumentprocessor',
     150        'samplecontractprocessor',
     151        'productprocessor',
     152        'pdfdocumentprocessor',
     153        'htmldocumentprocessor',
     154        'userprocessor')
    139155
    140156    def sendContactForm(self, from_name, from_addr, rcpt_name, rcpt_addr,
Note: See TracChangeset for help on using the changeset viewer.