[Zope-CVS] CVS: Products/Scheduler - Scheduler.py:1.6
Tres Seaver
tseaver@zope.com
Mon, 26 Aug 2002 19:58:43 -0400
Update of /cvs-repository/Products/Scheduler
In directory cvs.zope.org:/tmp/cvs-serv14816
Modified Files:
Scheduler.py
Log Message:
- Rewrap tasks in scheculer to give them 'real' contexts (ick).
=== Products/Scheduler/Scheduler.py 1.5 => 1.6 ===
--- Products/Scheduler/Scheduler.py:1.5 Thu Aug 15 12:51:24 2002
+++ Products/Scheduler/Scheduler.py Mon Aug 26 19:58:43 2002
@@ -26,6 +26,7 @@
from Persistence import Persistent
from ExtensionClass import Base
import Acquisition
+from Acquisition import aq_base
import Globals
import os, time, sys
from types import FloatType, IntType
@@ -223,7 +224,10 @@
def getPendingTasks(self, when=None):
if when is None: when = time.time()
when = int(when)
- return self.tasks.items(None, when) #min, max
+ # XXX: We should really be storing paths and dereferencing them
+ # here; re-wrapping the task object in the schedule is icky!
+ tasks = self.tasks.items(None, when) #min, max
+ return [ ( x[0], aq_base( x[1] ).__of__( self ) ) for x in tasks ]
security.declareProtected(VIEW_SCHEDULE_PERM, 'getPendingTaskInfo')
def getPendingTaskInfo(self, when=None):