Esempio n. 1
0
 def register_notifications(self, hosts):
     """Asks Growl clients to register Trac application. A bit suboptimal, 
     but that's the only way to register without an explicit user 
     registration"""
     grp = GrowlRegistrationPacket()
     for n in self.avail_sources:
         grp.addNotification(n, n in self.sources)
     gs = GrowlSender(self.env)
     gs.notify(hosts, grp)
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)