def clearQueue(self): """Clear the queue, but doesn't cancel the currently running commmand.""" for cmd in self.queued: cmd.deferred.errback(failure.Failure(error.QueueCleared())) self.queued = [] return defer.succeed(True)
def clearQueue(self): """Clear the queue.""" for cmd in self.queued: cmd.deferred.errback(failure.Failure(error.QueueCleared())) self.queued = [] return defer.succeed(True)