Ignore:
Timestamp:
24 Nov 2012, 17:19:04 (12 years ago)
Author:
uli
Message:

Support additional args for export jobs. These changes do not break existing instances.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/utils/batching.py

    r9706 r9718  
    560560    grok.implements(IExportJob)
    561561
    562     def __init__(self, site, exporter_name):
     562    def __init__(self, site, exporter_name, *args, **kwargs):
    563563        super(AsyncExportJob, self).__init__(
    564             export_job, site, exporter_name)
     564            export_job, site, exporter_name, *args, **kwargs)
    565565
    566566class ExportJobContainer(object):
     
    570570    running_exports = PersistentList()
    571571
    572     def start_export_job(self, exporter_name, user_id):
     572    def start_export_job(self, exporter_name, user_id, *args, **kwargs):
    573573        """Start asynchronous export job.
    574574
     
    580580        persistent list.
    581581
     582        The method supports additional positional and keyword
     583        arguments, which are passed as-is to the respective
     584        :class:`AsyncExportJob`.
     585
    582586        Returns the job ID of the job started.
    583587        """
    584588        site = grok.getSite()
    585589        manager = getUtility(IJobManager)
    586         job = AsyncExportJob(site, exporter_name)
     590        job = AsyncExportJob(site, exporter_name, *args, **kwargs)
    587591        job_id = manager.put(job)
    588592        # Make sure that the persisted list is stored in ZODB
Note: See TracChangeset for help on using the changeset viewer.