of @PACKAGE_NAME@
"""
-built = r"""<hr><font size=-1>
-This page was built from @PACKAGE_NAME@-@PACKAGE_VERSION@ by
-<address><br>@GCOS@ <<a href="mailto:%s">@MAIL_ADDRESS@</a>>,
-@LOCALTIME@.</address><p></font>"""
+built = r"""<hr>
+<p><font size="-1">
+This page was built from @PACKAGE_NAME@-@PACKAGE_VERSION@ by<br>
+</font>
+<address><font size="-1">@GCOS@ <<a href="mailto:%s">@MAIL_ADDRESS@</a>>,
+@LOCALTIME@.</font></address>"""
def gulp_file (f):
pw = ntpwd.getpwname(os.environ['USERNAME'])
else:
import pwd
- pw = pwd.getpwuid (os.getuid());
+ if os.environ.has_key('FAKEROOTKEY'):
+ pw = pwd.getpwnam (os.environ['LOGNAME'])
+ else:
+ pw = pwd.getpwuid (os.getuid())
f = pw[4]
f = string.split (f, ',')[0]
localtime = time.strftime ('%c %Z', time.localtime (time.time ()))
if os.path.basename (index_url) != "index.html":
- index_url = index_url + "/index.html"
+ index_url = os.path.join (index_url , "index.html")
top_url = os.path.dirname (index_url) + "/"
header = compose (default_header, header_file)
footer = compose (default_footer, footer_file) + built
-header_tag = '<! header_tag >'
-footer_tag = '<! footer_tag >'
+header_tag = '<!-- header_tag -->'
+footer_tag = '<!-- footer_tag -->'
def do_file (f):
s = gulp_file (f)
m = re.search (r'\*\*\*', changes)
if m:
changes = changes[:m.start (0)]
- s = re.sub ('top_of_ChangeLog', '<XMP>\n'+ changes + '\n</XMP>\n', s)
+ s = re.sub ('top_of_ChangeLog', '<pre>\n'+ changes + '\n</pre>\n', s)
if re.search (header_tag, s) == None:
- body = '<BODY BGCOLOR=WHITE><FONT COLOR=BLACK>'
+ body = '<BODY BGCOLOR=WHITE TEXT=BLACK>'
s = re.sub ('(?i)<body>', body, s)
if re.search ('(?i)<BODY', s):
s = re.sub ('(?i)<body[^>]*>', body + header, s, 1)
else:
s = header + s
- s = header_tag + s
+ s = header_tag + '\n' + s
+
+ if re.search ('(?i)<!DOCTYPE', s) == None:
+ doctype = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">\n'
+ s = doctype + s
if re.search (footer_tag, s) == None:
- s = s + footer_tag
+ s = s + footer_tag + '\n'
if re.search ('(?i)</body', s):
s = re.sub ('(?i)</body>', footer + '</BODY>', s, 1)
if os.path.basename (f) == "index.html":
cwd = os.getcwd ()
if os.path.basename (cwd) == "topdocs":
- index = "./index.html"
- top = "./"
+ index = "index.html"
+ top = ""
+
+ # don't cause ///////index.html entries in log files.
+ # index = "./index.html"
+ # top = "./"
s = re.sub ('@INDEX@', index, s)
s = re.sub ('@TOP@', top, s)