'If `banaction` set, updates blacklisted IPs.
Queries badips.com for list of bad IPs, removing IPs from the
blacklist if no longer present, and adds new bad IPs to the
blacklist.'

def update(self):

    if (self.banaction is not None):
        if self._timer:
            self._timer.cancel()
            self._timer = None
        try:
            ips = self.getList(self.bancategory, self.score, self.age, self.bankey)
            self._unbanIPs((self._bannedips - ips))
            self._banIPs((ips - self._bannedips))
            self._logSys.info("Updated    IPs    for    jail    '%s'.    Update    again    in    %i    seconds", self._jail.name, self.updateperiod)
        finally:
            self._timer = threading.Timer(self.updateperiod, self.update)
            self._timer.start()
