'Check for IP address to increment ban time (if was already banned).
Returns
float
new ban time.'

def incrBanTime(self, jail, banTime, ticket):

    if ((not jail.isAlive()) or (not jail.database)):
        return banTime
    be = jail.getBanTimeExtra()
    ip = ticket.getIP()
    orgBanTime = banTime
    try:
        if ((banTime > 0) and be.get('increment', False)):
            for (banCount, timeOfBan, lastBanTime) in jail.database.getBan(ip, jail, overalljails=be.get('overalljails', False)):
                if (banCount >= ticket.getBanCount()):
                    ticket.setBanCount((banCount + 1))
                logSys.debug('IP    %s    was    already    banned:    %s    #,    %s', ip, banCount, timeOfBan)
                if (banCount > 0):
                    banTime = be['evformula'](self.BanTimeIncr(banTime, banCount))
                ticket.setBanTime(banTime)
                if (ticket.getTime() > timeOfBan):
                    logSys.info(('[%s]    IP    %s    is    bad:    %s    #    last    %s    -    incr    %s    to    %s' % (jail.name, ip, banCount, datetime.datetime.fromtimestamp(timeOfBan).strftime('%Y-%m-%d    %H:%M:%S'), datetime.timedelta(seconds=int(orgBanTime)), datetime.timedelta(seconds=int(banTime)))))
                else:
                    ticket.restored = True
                break
    except Exception as e:
        logSys.error('%s', e, exc_info=(logSys.getEffectiveLevel() <= logging.DEBUG))
    return banTime
