예제 #1
0
 def send_growl_notification(self):
     growl_ips = self.growl_ips
     
     reg = GrowlRegistrationPacket(password=self.password)
     reg.addNotification()
 
     notify = GrowlNotificationPacket(title=self.title,
                 description=self.description,
                 sticky=True, password=self.password)
     for ip in growl_ips:
         addr = (ip, GROWL_UDP_PORT)
         s = socket(AF_INET, SOCK_DGRAM)
         s.sendto(reg.payload(), addr)
         s.sendto(notify.payload(), addr)
예제 #2
0
파일: doorbell.py 프로젝트: zmezm/doorbell
    def send_growl_notification(self):
        growl_ips = self.growl_ips

        reg = GrowlRegistrationPacket(password=self.password)
        reg.addNotification()

        notify = GrowlNotificationPacket(title=self.title,
                                         description=self.description,
                                         sticky=True,
                                         password=self.password)
        for ip in growl_ips:
            addr = (ip, GROWL_UDP_PORT)
            s = socket(AF_INET, SOCK_DGRAM)
            s.sendto(reg.payload(), addr)
            s.sendto(notify.payload(), addr)
예제 #3
0
 def send(self, msg):
     p = GrowlNotificationPacket(application='foobox',
         notification='Message',
         title=msg['src'],
         description=msg['text'])
     self.sock.sendto(p.payload(), (self.data['target'], GROWL_UDP_PORT))