def _send_message(self, message, **kwargs): try: s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect((autosubliminal.GROWLHOST, int(autosubliminal.GROWLPORT))) s.send(message) gntp.parse_gntp(s.recv(1024)) s.close() log.info("%s notification sent" % self.name) return True except socket.error: log.error("%s notification failed" % self.name) return False
def _send_message(self, message, **kwargs): try: s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect( (autosubliminal.GROWLHOST, int(autosubliminal.GROWLPORT))) s.send(message) gntp.parse_gntp(s.recv(1024)) s.close() log.info("%s notification sent" % self.name) return True except socket.error: log.error("%s notification failed" % self.name) return False
def _send(host,port,data,debug=False): if debug: print '<Sending>\n',data,'\n</Sending>' s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect((host,port)) s.send(data) response = gntp.parse_gntp(s.recv(1024)) s.close() if debug: print '<Recieved>\n',response,'\n</Recieved>'
def _send(self, host, port, data, debug=False): if debug: print '<Sending>\n', data, '\n</Sending>' s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect((host, port)) s.send(data) response = gntp.parse_gntp(s.recv(1024)) s.close() if debug: print '<Recieved>\n', response, '\n</Recieved>' return response
def _send(self, host, port, data, debug=False): if debug: print "<Sending>\n", data, "\n</Sending>" s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect((host, port)) s.send(data) response = gntp.parse_gntp(s.recv(1024)) s.close() if debug: print "<Recieved>\n", response, "\n</Recieved>" return response