def read_start(): global test try: test = 0 something = inputimeout(prompt='Enter msg: ', timeout=5) while True: user_input = something send_msg(session, user_input) readmsg(session) except TimeoutOccurred: test = 1 readmsg(session)
def publish_msg(status): config.read("/home/pi/event-listener/phonenumber.cfg") global process pro_name = config.get("process", "command").split(',') num = len(pro_name) while (num > 0): num -= 1 if process == pro_name[num]: phonenumber = config.get("phonenumber", pro_name[num]) sendmsg.send_msg(phonenumber, '进程:%s' % process, "state", str(status)) # if process == 'while123': # phonenumber=config.get("phonenumber","while123") # sendmsg.send_msg(phonenumber,'pro:%s'%process,"state",str(status)) return
def pitch(self, ball, smtp_ip, smtp_port): self.logger.debug("pitching") timing = sendmsg.send_msg(smtp_ip, smtp_port, False, None, None, ball["msg"]) self.logger.debug("pitch away") return timing
def pitch(self, ball, smtp_ip, smtp_port): timing = sendmsg.send_msg(smtp_ip, smtp_port, False, None, None, ball["msg"]) return timing