29 |
|
|
30 |
import os.path |
import os.path |
31 |
|
|
32 |
from navidoc.utils.path import _slashify, _listdir |
from navidoc.utils.path import * |
33 |
|
|
34 |
def postprocess(path): |
def postprocess(path): |
35 |
""" |
""" |
37 |
target filename. |
target filename. |
38 |
""" |
""" |
39 |
|
|
40 |
dirlist = _listdir(path, "html", dirs=1) |
dirlist = listdir(path, "html", dirs=1) |
41 |
dirlist.sort() |
dirlist.sort() |
42 |
location = 0 |
location = 0 |
43 |
|
|
44 |
for entry in dirlist: |
for entry in dirlist: |
45 |
if os.path.isdir(_slashify(path)+entry) \ |
if os.path.isdir(slashify(path)+entry) \ |
46 |
and not os.path.islink(_slashify(path)+entry): |
and not os.path.islink(slashify(path)+entry): |
47 |
postprocess(_slashify(path)+entry) |
postprocess(slashify(path)+entry) |
48 |
|
|
49 |
if os.path.isfile(_slashify(path)+entry): |
if os.path.isfile(slashify(path)+entry): |
50 |
html = open(_slashify(path)+entry).read() |
html = open(slashify(path)+entry).read() |
51 |
|
|
52 |
insert = html.lower().find("</head>") |
insert = html.lower().find("</head>") |
53 |
out = open(_slashify(path)+entry, "w") |
out = open(slashify(path)+entry, "w") |
54 |
out.write(html[0:insert]) |
out.write(html[0:insert]) |
55 |
|
|
56 |
#out.write('<meta name="robots" content="noarchive, noindex, nofollow" />'+"\n") |
#out.write('<meta name="robots" content="noarchive, noindex, nofollow" />'+"\n") |