Changeset 9816 for main/waeup.kofa/trunk
- Timestamp:
- 21 Dec 2012, 13:09:05 (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/interfaces.py
r9814 r9816 1185 1185 pass 1186 1186 1187 finished = schema.Bool( 1188 title = u'`True` if the job finished.`', 1189 default = False, 1190 ) 1191 1192 failed = schema.Bool( 1193 title = u"`True` iff the job finished and didn't provide a file.", 1194 default = None, 1195 ) 1196 1187 1197 class IExportJobContainer(IKofaObject): 1188 1198 """A component that contains (maybe virtually) export jobs. -
main/waeup.kofa/trunk/src/waeup/kofa/students/browser.py
r9815 r9816 2671 2671 # XXX: Descr. should be improved 2672 2672 descr = '%r, %r' % (job.args[1:], job.kwargs) 2673 2674 # XXX: status should be replaced by 'ready', 'running' or 'FAILED' 2675 # like in w.k.browser.reports ... 2676 status = job.status 2677 # ... and buttons should be displayed accordingly 2678 show_download_button = True 2679 show_discard_button = True 2680 show_refresh_button = True 2681 2682 2673 status = job.finished and 'ready' or 'running' 2674 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 2683 2678 start_time = getattr(job, 'begin_after', None) 2684 2679 if start_time: -
main/waeup.kofa/trunk/src/waeup/kofa/utils/batching.py
r9797 r9816 28 28 import tempfile 29 29 import time 30 import zc.async.interfaces 30 31 from cStringIO import StringIO 31 32 from persistent.list import PersistentList … … 571 572 export_job, site, exporter_name, *args, **kwargs) 572 573 574 @property 575 def finished(self): 576 """A job is marked `finished` if it is completed. 577 578 Please note: a finished report job does not neccessarily 579 provide an IReport result. See meth:`failed`. 580 """ 581 return self.status == zc.async.interfaces.COMPLETED 582 583 @property 584 def failed(self): 585 """A report job is marked failed iff it is finished and the 586 result is None. 587 588 While a job is unfinished, the `failed` status is ``None``. 589 590 Failed jobs normally provide a `traceback` to examine reasons. 591 """ 592 if not self.finished: 593 return None 594 if getattr(self, 'result', None) is None: 595 return True 596 return False 597 573 598 class ExportJobContainer(object): 574 599 """A mix-in that provides functionality for asynchronous export jobs.
Note: See TracChangeset for help on using the changeset viewer.