[Zope-CVS] CVS: Products/Scheduler - Scheduler.py:1.3
Tres Seaver
tseaver@zope.com
Tue, 13 Aug 2002 14:11:32 -0400
Update of /cvs-repository/Products/Scheduler
In directory cvs.zope.org:/tmp/cvs-serv22795
Modified Files:
Scheduler.py
Log Message:
- Scheduler:
o Add convenience UI method, 'getPendingTaskInfo', to dodge permissions
issues on schedule entries.
- manage_current_tasks:
o Rip out duplicated colorizing code, which should be done using
'tal:attributes'.
=== Products/Scheduler/Scheduler.py 1.2 => 1.3 ===
--- Products/Scheduler/Scheduler.py:1.2 Thu Aug 8 17:20:20 2002
+++ Products/Scheduler/Scheduler.py Tue Aug 13 14:11:31 2002
@@ -222,6 +222,16 @@
if when is None: when = time.time()
when = int(when)
return self.tasks.items(None, when) #min, max
+
+ security.declareProtected(VIEW_SCHEDULE_PERM, 'getPendingTaskInfo')
+ def getPendingTaskInfo(self, when=None):
+ """
+ Return a sequence of mappings for use by UI.
+ """
+ return [ ( x[0], { 'when' : x[1].getTime()
+ , 'info' : x[1].info()
+ , 'description' : x[1].description } )
+ for x in self.getPendingTasks( when ) ]
security.declareProtected(CHANGE_SCHEDULE_PERM, 'schedule')
def schedule(self, time, task):