/[navidoc]/navidoc/navidoc/modules/metalink.py
ViewVC logotype

Diff of /navidoc/navidoc/modules/metalink.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.2 by humppake, Fri Mar 21 10:36:28 2003 UTC revision 1.3 by humppake, Fri Mar 28 13:08:57 2003 UTC
# Line 29  __docformat__ = 'reStructuredText' Line 29  __docformat__ = 'reStructuredText'
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      """      """
# Line 37  def postprocess(path): Line 37  def postprocess(path):
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")

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26