Beispiel #1
0
 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
Beispiel #2
0
 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
Beispiel #3
0
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>'
Beispiel #4
0
    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
Beispiel #5
0
    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