archiver/util.py
def find_link(folder, links):
    """for a given archive folder, find the corresponding link object in links"""
    url = parse_url(folder)
    if url:
        for link in links:
            if (link['base_url'] in url) or (url in link['url']):
                return link

    timestamp = folder.split('.')[0]
    for link in links:
        if link['timestamp'].startswith(timestamp):
            if link['domain'] in os.listdir(os.path.join(ARCHIVE_DIR, folder)):
                return link      # careful now, this isn't safe for most ppl
            if link['domain'] in parse_url(folder):
                return link
    return None
for a given archive folder, find the corresponding link object in links
for a given archive folder, find the corresponding link object in links
for a given archive folder find the corresponding link object in links
def find_link(folder, links):
    url = parse_url(folder)
    if url:
        for link in links:
            if (link['base_url'] in url) or (url in link['url']):
                return link
    timestamp = folder.split('.')[0]
    for link in links:
        if link['timestamp'].startswith(timestamp):
            if link['domain'] in os.listdir(os.path.join(ARCHIVE_DIR, folder)):
                return link      
            if link['domain'] in parse_url(folder):
                return link
    return None
def find_link ( folder , links ) : url = parse_url ( folder ) if url : for link in links : if ( link [ 'base_url' ] in url ) or ( url in link [ 'url' ] ) : return link timestamp = folder . split ( '.' ) [ 0 ] for link in links : if link [ 'timestamp' ] . startswith ( timestamp ) : if link [ 'domain' ] in os . listdir ( os . path . join ( ARCHIVE_DIR , folder ) ) : return link if link [ 'domain' ] in parse_url ( folder ) : return link return None
for a given archive folder, find the corresponding link object in links
for a given archive folder find the corresponding link object in links
"""for a given archive folder, find the corresponding link object in links""" # careful now, this isn't safe for most ppl
folder
links