def remove_alarm(self, handle):
"""
Remove an alarm.
Returns True if the alarm exists, False otherwise
"""
from twisted.internet.error import AlreadyCancelled, AlreadyCalled
try:
handle.cancel()
return True
except AlreadyCancelled:
return False
except AlreadyCalled:
return False
评论列表
文章目录