if options.clean:
        shutil.rmtree(options.pydoc_output, ignore_errors=True)
    generate_pydoc(options.pydoc_output)
if options.clean:
    shutil.rmtree(options.mirror, ignore_errors=True)
    shutil.rmtree(options.output, ignore_errors=True)
try:
    os.mkdir(options.mirror)
except Exception:
    pass
try:
    os.mkdir(options.mirror + "/images")
except Exception:
    pass
images = set()
pages = getAllPages(args)
for name in pages:
    if name.endswith(".css"):
        print("Skipping css-file %s" % name)
        continue
    print("Fetching %s" % name)
    c = readParsePage(name)
    if name.find("/") > 0:
        try:
            os.makedirs(os.path.join(options.mirror, name[:name.rfind("/")]))
        except Exception:
            pass
    if True:  # name.find(".")<0:
        c, pi, level = patchLinks(c, name)
        for i in pi:
            images.add(i)
Exemplo n.º 2
0
    if options.clean:
        shutil.rmtree(options.pydoc_output, ignore_errors=True)
    generate_pydoc(options.pydoc_output)
if options.clean:
    shutil.rmtree(options.mirror, ignore_errors=True)
    shutil.rmtree(options.output, ignore_errors=True)
try:
    os.mkdir(options.mirror)
except Exception:
    pass
try:
    os.mkdir(options.mirror + "/images")
except Exception:
    pass
images = set()
pages = getAllPages(args)
for name in pages:
    if name.endswith(".css"):
        print("Skipping css-file %s" % name)
        continue
    print("Fetching %s" % name)
    c = readParsePage(name)
    if name.find("/") > 0:
        try:
            os.makedirs(os.path.join(options.mirror, name[:name.rfind("/")]))
        except Exception:
            pass
    if True:  # name.find(".")<0:
        c, pi, level = patchLinks(c, name)
        for i in pi:
            images.add(i)