Changeset 9646 for main/waeup.kofa/trunk/src/waeup
- Timestamp:
- 16 Nov 2012, 12:27:15 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/reports.py
r9645 r9646 23 23 from zope import schema 24 24 from zope.component import ( 25 getUtility, getUtilitiesFor, queryUtility , ComponentLookupError)25 getUtility, getUtilitiesFor, queryUtility) 26 26 from zope.component.hooks import setSite 27 27 from zope.interface import implementer … … 105 105 ) 106 106 107 starttime = schema.TextLine(108 title = u'Human readable start datetime')109 110 107 def __init__(site, generator_name): 111 108 """Create a report job via generator.""" … … 181 178 downloaded. This is only true if the job finished and 182 179 didn't raised exceptions. 183 184 ``<starttime>``185 Datetime string indicating when the job was started.186 180 187 181 If ``user_id`` is ``None``, all jobs are returned. … … 298 292 def __init__(self, site, generator_name, args=[], kw={}): 299 293 self._generator_name = generator_name 300 try:301 tz = getUtility(IKofaUtils).tzinfo302 self.starttime = now(tz).strftime("%Y-%m-%d %H:%M:%S %Z")303 except ComponentLookupError:304 self.starttime = None305 294 super(AsyncReportJob, self).__init__( 306 295 report_job, site, generator_name, args=args, kw=kw) … … 486 475 discardable = job.finished 487 476 downloadable = job.finished and not job.failed 488 starttime = job.starttime 477 starttime = getattr(job, 'begin_after', None) 478 if starttime: 479 starttime = starttime.astimezone(getUtility(IKofaUtils).tzinfo) 480 starttime = starttime.strftime("%Y-%m-%d %H:%M:%S %Z") 489 481 if not hasattr(job, 'description'): 490 482 continue
Note: See TracChangeset for help on using the changeset viewer.