Advertisement
Guest User

apscheduler question

a guest
Apr 29th, 2016
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. This is the callback method that I am asking to be scheduled.
  2.  
  3. def transmitMessage(self,inp,output):
  4. print("Getting the attr")
  5. a = getattr(self.sAPI,sendMessage)
  6. print ("the attr is " + str(a))
  7. self.sAPI.sendMessage(dst=ReadMaps.audionics_output_map[output][1:-1],src=ReadMaps.audionics_input_map[inp][1:-1])
  8. print ("Calling wheatStone API\n")
  9. self.wAPI.sendMessage(target = 'DST',command='SRC',cmdtype=0,param1=ReadMaps.wheatNet_output_map[inp][1:-1],src=ReadMaps.wheatNet_input_map[output][1:-1])
  10. print ("Calling liveWire API\n")
  11. self.lAPI.sendMessage(dst=ReadMaps.liveWire_output_map[output][1:-1],src=ReadMaps.liveWire_input_map[inp][1:-1])
  12.  
  13.  
  14. This how I schedule it.
  15. job = self.sched.add_job(self.transmitMessage,'cron',second=line.seconds,minute=line.minutes,hour=line.hours,day=line.dom,month=line.month,year=line.year,day_of_week=line.dow,args=[line.input,line.output])
  16.  
  17. self.sched is defined like so: self.sched = BackgroundScheduler()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement