lib/gettor/utils.py
def lookupAddress(conf, address):
    """Lookup if a given address is in the blacklist- or whitelist pool
    """
    logging.debug("Lookup address: %s" % address)
    found = False
    wlStateDir = conf.BASEDIR + "/wl"
    blStateDir = conf.BASEDIR + "/bl"
    try:
        whiteList = gettor.blacklist.BWList(wlStateDir)
        blackList = gettor.blacklist.BWList(blStateDir)
    except IOError, e:
        logging.error("White/Blacklist error: %s" % e)
        return False
    if whiteList.lookupListEntry(address, "general"):
        logging.info("Address '%s' is present in the whitelist." % address)
        found = True
    if blackList.lookupListEntry(address, "general"):
        logging.info("Address '%s' is present in the blacklist." % address)
        found = True
    if not found:
        logging.info("Address '%s' neither in black or whitelist." % address)
        found = True

    # Always True
    return found
Lookup if a given address is in the blacklist- or whitelist pool
    
Lookup if a given address is in the blacklist- or whitelist pool
Lookup if a given address is in the blacklist - or whitelist pool
def lookupAddress(conf, address):
    logging.debug("Lookup address: %s" % address)
    found = False
    wlStateDir = conf.BASEDIR + "/wl"
    blStateDir = conf.BASEDIR + "/bl"
    try:
        whiteList = gettor.blacklist.BWList(wlStateDir)
        blackList = gettor.blacklist.BWList(blStateDir)
    except IOError, e:
        logging.error("White/Blacklist error: %s" % e)
        return False
    if whiteList.lookupListEntry(address, "general"):
        logging.info("Address '%s' is present in the whitelist." % address)
        found = True
    if blackList.lookupListEntry(address, "general"):
        logging.info("Address '%s' is present in the blacklist." % address)
        found = True
    if not found:
        logging.info("Address '%s' neither in black or whitelist." % address)
        found = True
    return found
def lookupAddress ( conf , address ) : logging . debug ( "Lookup address: %s" % address ) found = False wlStateDir = conf . BASEDIR + "/wl" blStateDir = conf . BASEDIR + "/bl" try : whiteList = gettor . blacklist . BWList ( wlStateDir ) blackList = gettor . blacklist . BWList ( blStateDir ) except IOError , e : logging . error ( "White/Blacklist error: %s" % e ) return False if whiteList . lookupListEntry ( address , "general" ) : logging . info ( "Address '%s' is present in the whitelist." % address ) found = True if blackList . lookupListEntry ( address , "general" ) : logging . info ( "Address '%s' is present in the blacklist." % address ) found = True if not found : logging . info ( "Address '%s' neither in black or whitelist." % address ) found = True return found
Lookup if a given address is in the blacklist- or whitelist pool
Lookup if a given address is in the blacklist - or whitelist pool
"""Lookup if a given address is in the blacklist- or whitelist pool
    """ # Always True
conf
address