Merge remote branch 'original/master'

main
Devi 12 years ago
commit dd34f1ffd9

@ -74,17 +74,18 @@ class Queue(object):
return None
return job
def get_job_ids(self, start=0, limit=-1):
def get_job_ids(self, offset=0, length=-1):
"""Returns a slice of job IDs in the queue."""
if limit >= 0:
end = start + limit
start = offset
if length >= 0:
end = offset + (length - 1)
else:
end = limit
end = length
return self.connection.lrange(self.key, start, end)
def get_jobs(self, start=0, limit=-1):
def get_jobs(self, offset=0, length=-1):
"""Returns a slice of jobs in the queue."""
job_ids = self.get_job_ids(start, limit)
job_ids = self.get_job_ids(offset, length)
return compact([self.safe_fetch_job(job_id) for job_id in job_ids])
@property

@ -69,8 +69,11 @@ class _Colorizer(object):
self.codes["darkyellow"] = self.codes["brown"]
self.codes["fuscia"] = self.codes["fuchsia"]
self.codes["white"] = self.codes["bold"]
self.notty = not sys.stdout.isatty()
if hasattr(sys.stdout, "isatty"):
self.notty = not sys.stdout.isatty()
else:
self.notty = True
def reset_color(self):
return self.codes["reset"]

Loading…
Cancel
Save