Esempio n. 1
0
    def __init__(self, server=None):
        FooApp.__init__(self, server)
        self.data = FileStore('/tmp/apps/growl')

        self.sock = socket(AF_INET, SOCK_DGRAM)
        p = GrowlRegistrationPacket(application='foobox', password='')
        p.addNotification('Message', enabled=True)
        self.sock.sendto(p.payload(), (self.data['target'], GROWL_UDP_PORT))
Esempio n. 2
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)
Esempio n. 3
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)