[Zope-CVS] CVS: Packages/JobBoardEx - JobList.py:1.18
Guido van Rossum
guido@python.org
Mon, 17 Jun 2002 10:29:56 -0400
Update of /cvs-repository/Packages/JobBoardEx
In directory cvs.zope.org:/tmp/cvs-serv22065
Modified Files:
JobList.py
Log Message:
Move comments about stringification to the right place. Add some
more.
=== Packages/JobBoardEx/JobList.py 1.17 => 1.18 ===
def __delitem__(self, jobid):
+ # accept stringified job ids, see add()
try:
jobid = int(jobid)
except ValueError:
raise KeyError, jobid
-
del self._jobs[jobid]
def query(self, state):
- # this should work returning a list of ints,
- # but it exposes a bug in PageTemplates
-
ids = [jobid
for jobid, job in self._jobs.items()
if job.state == state]
ids.sort()
+ # this should work returning a list of ints,
+ # but it exposes a bug in PageTemplates
return map(str, ids)
def __getitem__(self, jobid):
+ # accept stringified job ids, see add()
try:
jobid = int(jobid)
except ValueError:
raise KeyError, jobid
-
return self._jobs[jobid]
def getPendingIds(self):