示例#1
0
def main(destdir, patternfile):
    os.chdir(destdir)
    node = load_root_node()
    download_list = DownloadList()

    for line in open(patternfile):
        search = line.strip().split("/")
        match(download_list, node, search)
示例#2
0
def process_one_dir(destdir, patternfile):
    os.chdir(destdir)
    node = load_root_node()
    download_list = DownloadList()

    for line in open(patternfile):
        search = line.strip().split("/")
        match(download_list, node, search)
示例#3
0
def main():
    node = load_root_node()

    while True:
        options = []
        will_download = True
        for n in node.get_children():
            options.append((n.title, n))
            if not n.can_download:
                will_download = False
        options = natural_sort(options, key=lambda x: x[0])
        result = choose(options, allow_multi=will_download)
        if result is None:
            if node.parent is not None:
                node = node.parent
            else:
                break
        elif will_download:
            for n in result:
                if not n.download():
                    raw_input("Press return to continue...\n")
        else:
            node = result