Ignore:
Timestamp:
21 Dec 2012, 13:20:38 (12 years ago)
Author:
Henrik Bettermann
Message:

Adjust job description.

File:
1 edited

Legend:

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

    r9816 r9817  
    26682668        for job_id, exporter_name, user_id in job_entries:
    26692669            job = job_manager.get(job_id)
    2670 
    2671             # XXX: Descr. should be improved
    2672             descr = '%r, %r' % (job.args[1:], job.kwargs)
     2670            exporter = getUtility(ICSVExporter, name=exporter_name)
     2671            exporter_title = getattr(exporter, 'title', 'Unknown')
     2672            args = ', '.join([str(x) for x in job.kwargs.values()])
     2673            descr = '%s (%s)' % (exporter_title, args)
    26732674            status = job.finished and 'ready' or 'running'
    26742675            status = job.failed and 'FAILED' or status
    2675             show_download_button = job.finished and not job.failed
    2676             show_discard_button = job.finished
    2677             show_refresh_button = not job.finished
    26782676            start_time = getattr(job, 'begin_after', None)
    26792677            if start_time:
     
    26902688                start_time=start_time,
    26912689                download_url=download_url,
    2692                 show_download_button = show_download_button,
    2693                 show_refresh_button = show_refresh_button,
    2694                 show_discard_button = show_discard_button,)
     2690                show_download_button = (job.finished and not job.failed),
     2691                show_refresh_button = not job.finished,
     2692                show_discard_button = job.finished,)
    26952693            entries.append(new_entry)
    26962694        self.entries = entries
Note: See TracChangeset for help on using the changeset viewer.