- Timestamp:
- 16 Nov 2012, 08:30:20 (12 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/browser/templates/reportscontainerpage.pt
r9643 r9644 5 5 <th i18n:translate="">Report Number</th> 6 6 <th i18n:translate="">Description</th> 7 <th i18n:translate="">Creation Date</th> 7 8 <th i18n:translate="">Status</th> 8 9 <th> </th> … … 17 18 <span tal:replace="python: entry[1]">REPORT DESCRIPTION</span> 18 19 </td> 20 <td nowrap> 21 <span tal:replace="python: entry[5]">DATETIME</span> 22 </td> 19 23 <td> 20 24 <span tal:replace="python: entry[2]">STATUS</span> 21 25 </td> 22 <td >26 <td nowrap> 23 27 <form method="POST"> 24 28 <input type="hidden" name="job_id" -
main/waeup.kofa/trunk/src/waeup/kofa/reports.py
r9642 r9644 22 22 from persistent.list import PersistentList 23 23 from zope import schema 24 from zope.component import getUtility, getUtilitiesFor, queryUtility 24 from zope.component import ( 25 getUtility, getUtilitiesFor, queryUtility, ComponentLookupError) 25 26 from zope.component.hooks import setSite 26 27 from zope.interface import implementer … … 28 29 from waeup.kofa.async import AsyncJob 29 30 from waeup.kofa.interfaces import ( 30 IJobManager, JOB_STATUS_MAP, IKofaPluggable, IKofaObject )31 IJobManager, JOB_STATUS_MAP, IKofaPluggable, IKofaObject, IKofaUtils) 31 32 from waeup.kofa.interfaces import MessageFactory as _ 32 33 from waeup.kofa.utils.helpers import now … … 104 105 ) 105 106 107 starttime = schema.TextLine( 108 title = u'Human readable start datetime') 109 106 110 def __init__(site, generator_name): 107 111 """Create a report job via generator.""" … … 177 181 downloaded. This is only true if the job finished and 178 182 didn't raised exceptions. 183 184 ``<starttime>`` 185 Datetime string indicating when the job was started. 179 186 180 187 If ``user_id`` is ``None``, all jobs are returned. … … 291 298 def __init__(self, site, generator_name, args=[], kw={}): 292 299 self._generator_name = generator_name 300 try: 301 tz = getUtility(IKofaUtils).tzinfo 302 self.starttime = now(tz).strftime("%Y-%m-%d %H:%M:%S %Z") 303 except ComponentLookupError: 304 self.starttime = None 293 305 super(AsyncReportJob, self).__init__( 294 306 report_job, site, generator_name, args=args, kw=kw) … … 461 473 didn't raised exceptions. 462 474 475 ``<starttime>`` 476 Datetime object indicating when the job was started. 477 463 478 If ``user_id`` is ``None``, all jobs are returned. 464 479 """ … … 471 486 discardable = job.finished 472 487 downloadable = job.finished and not job.failed 488 starttime = job.starttime 473 489 if not hasattr(job, 'description'): 474 490 continue 475 491 result.append((job_id, job.description, status, 476 discardable, downloadable ),)492 discardable, downloadable, starttime),) 477 493 return result 478 494 -
main/waeup.kofa/trunk/src/waeup/kofa/tests/test_reports.py
r9639 r9644 395 395 self.assertEqual( 396 396 result, 397 [('2', 'Report 1 ()', u'running', False, False ),]397 [('2', 'Report 1 ()', u'running', False, False, None),] 398 398 ) 399 399 return
Note: See TracChangeset for help on using the changeset viewer.