Change Job.is_removed to be a property instead of a method

This commit is contained in:
Noam Meltzer 2016-12-20 00:14:03 +02:00
parent ed1785981d
commit 423251f66c

View file

@ -279,7 +279,7 @@ class JobQueue(object):
self._set_next_peek(t) self._set_next_peek(t)
break break
if job.is_removed(): if job.is_removed:
self.logger.debug('Removing job %s', job.name) self.logger.debug('Removing job %s', job.name)
continue continue
@ -296,7 +296,7 @@ class JobQueue(object):
else: else:
self.logger.debug('Skipping disabled job %s', job.name) self.logger.debug('Skipping disabled job %s', job.name)
if job.repeat and not job.is_removed(): if job.repeat and not job.is_removed:
self._put(job, last_t=t) self._put(job, last_t=t)
else: else:
self.logger.debug('Dropping non-repeating or removed job %s', job.name) self.logger.debug('Dropping non-repeating or removed job %s', job.name)
@ -427,6 +427,7 @@ class Job(object):
""" """
self._remove.set() self._remove.set()
@property
def is_removed(self): def is_removed(self):
return self._remove.is_set() return self._remove.is_set()