def check_commands(self, event):
l = len(self.sched_commands)
curr_time = datetime.datetime.now()
i = 0
while(i<l and curr_time >= self.sched_commands[i][0]):
logging.info(u'exec command:,i=%s,time=%s,command[i][1]=%s' % (i, curr_time, self.sched_commands[i][1].__name__))
arg = self.sched_commands[i][2]
self.sched_commands[i][1](**arg)
i += 1
if i>0:
del self.sched_commands[0:i]
评论列表
文章目录