'Updates service information from a DNS record'

def updateRecord(self, zeroconf, now, record):

    if ((record is None) or record.isExpired(now)):
        return
    if ((record.type in (_TYPE_A, _TYPE_AAAA)) and (record.name == self.server)):
        self.address = record.address
    elif ((record.type == _TYPE_SRV) and (record.name == self.name)):
        self.server = record.server
        self.port = record.port
        self.weight = record.weight
        self.priority = record.priority
        self.updateRecord(zeroconf, now, zeroconf.cache.getByDetails(self.server, _TYPE_A, _CLASS_IN))
    elif ((record.type == _TYPE_TXT) and (record.name == self.name)):
        self.setText(record.text)
