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.

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

Legend:

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

    r9671 r9718  
    11641164    """A component that contains (maybe virtually) export jobs.
    11651165    """
    1166     def start_export_job(exporter_name, user_id):
     1166    def start_export_job(exporter_name, user_id, *args, **kwargs):
    11671167        """Start asynchronous export job.
    11681168
     
    11701170
    11711171        `user_id` is the ID of the user that triggers the export.
     1172
     1173        `args` positional arguments passed to the export job created.
     1174
     1175        `kwargs` keyword arguments passed to the export job.
    11721176
    11731177        The job_id is stored along with exporter name and user id in a
  • 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.