- Timestamp:
- 18 Nov 2012, 00:16:15 (12 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/browser/reports.py
r9672 r9674 19 19 """ 20 20 import grok 21 from zope.component import getUtility 21 from zope.component import getUtility, queryUtility 22 22 from zope.location.location import located 23 from waeup.kofa.interfaces import IJobManager 23 from waeup.kofa.interfaces import IJobManager, IKofaUtils 24 24 from waeup.kofa.interfaces import MessageFactory as _ 25 25 from waeup.kofa.browser.layout import KofaPage 26 from waeup.kofa.reports import IReportsContainer 26 from waeup.kofa.reports import IReportsContainer, IReportGenerator 27 27 from waeup.kofa.reports import get_generators 28 28 … … 49 49 self.flash('Report discarded: %s' % job_id) 50 50 self.entries = self._generate_entries(user_id=None) 51 #self.entries = self.context.get_report_jobs_description()52 51 if job_id and DOWNLOAD: 53 52 self.redirect(self._report_url(job_id)) … … 60 59 job_id, gen_name, user = entry 61 60 job = getUtility(IJobManager).get(job_id) 62 descr = '%r, %r' % (job.args, job.kwargs) 63 new_entry = (job_id, descr, job.status, job.finished, job.finished and not job.failed, not job.finished, job.begin_after, user) 61 generator = queryUtility(IReportGenerator, name=gen_name) 62 gen_title = getattr(generator, 'title', 'Unknown') 63 args = ', '.join([str(x) for x in job.kwargs['kw'].values()]) 64 descr = '%s (%s)' % (gen_title, args) 65 status = job.finished and 'ready' or 'running' 66 status = job.failed and 'FAILED' or status 67 starttime = getattr(job, 'begin_after', None) 68 if starttime: 69 starttime = starttime.astimezone( 70 getUtility( 71 IKofaUtils).tzinfo).strftime("%Y-%m-%d %H:%M:%S %Z") 72 new_entry = (job_id, descr, status, job.finished, job.finished and not job.failed, not job.finished, starttime, user) 64 73 entries.append(new_entry) 65 74 return entries -
main/waeup.kofa/trunk/src/waeup/kofa/reports.py
r9673 r9674 171 171 172 172 title = _("Unnamed Report") 173 173 174 def generate(self, site, args=[], kw={}): 174 175 result = Report()
Note: See TracChangeset for help on using the changeset viewer.