Move the publication site for PEPs to python.org.
This commit is contained in:
parent
6644dcee69
commit
7417257094
36
pep2html.py
36
pep2html.py
|
@ -38,6 +38,7 @@ import cgi
|
||||||
import glob
|
import glob
|
||||||
import getopt
|
import getopt
|
||||||
import errno
|
import errno
|
||||||
|
import random
|
||||||
import time
|
import time
|
||||||
|
|
||||||
PROGRAM = sys.argv[0]
|
PROGRAM = sys.argv[0]
|
||||||
|
@ -47,8 +48,8 @@ PEPCVSURL = 'http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/python/python/nondis
|
||||||
PEPDIRRUL = 'http://www.python.org/peps/'
|
PEPDIRRUL = 'http://www.python.org/peps/'
|
||||||
|
|
||||||
|
|
||||||
HOST = "shell.sourceforge.net" # host for update
|
HOST = "www.python.org" # host for update
|
||||||
HDIR = "/home/groups/p/py/python/htdocs/peps" # target host directory
|
HDIR = "/ftp/ftp.python.org/pub/www.python.org/peps" # target host directory
|
||||||
LOCALVARS = "Local Variables:"
|
LOCALVARS = "Local Variables:"
|
||||||
|
|
||||||
# The generated HTML doesn't validate -- you cannot use <hr> and <h3> inside
|
# The generated HTML doesn't validate -- you cannot use <hr> and <h3> inside
|
||||||
|
@ -140,17 +141,28 @@ def fixfile(infile, outfile):
|
||||||
title = "PEP " + pep + " -- " + title
|
title = "PEP " + pep + " -- " + title
|
||||||
if title:
|
if title:
|
||||||
print >> fo, ' <title>%s</title>' % cgi.escape(title)
|
print >> fo, ' <title>%s</title>' % cgi.escape(title)
|
||||||
print >> fo, ' <link rel="STYLESHEET" href="style.css">'
|
print >> fo, ' <style type="text/css">'
|
||||||
|
css = open(os.path.join(os.path.dirname(infile), "style.css")).read()
|
||||||
|
print >> fo, css.rstrip()
|
||||||
|
print >> fo, ' </style>'
|
||||||
print >> fo, '</head>'
|
print >> fo, '</head>'
|
||||||
# body
|
# body
|
||||||
print >> fo, '<body bgcolor="white">'
|
print >> fo, '<body bgcolor="white" marginwidth="0" marginheight="0">'
|
||||||
print >> fo, '<div class="navigation">'
|
print >> fo, '<table class="navigation" cellpadding="0" cellspacing="0"'
|
||||||
print >> fo, '[<b><a href="../">home</a></b>]'
|
print >> fo, ' width="100%" border="0">'
|
||||||
|
print >> fo, '<tr><td class="navicon" width="150" height="35">'
|
||||||
|
r = random.choice(range(64))
|
||||||
|
print >> fo, '<a href="../" title="Python Home Page">'
|
||||||
|
print >> fo, '<img src="../pics/PyBanner%03d.gif" alt="[Python]"' % r
|
||||||
|
print >> fo, ' border="0" width="150" height="35" /></a></td>'
|
||||||
|
print >> fo, '<td class="textlinks" align="left">'
|
||||||
|
print >> fo, '[<b><a href="../">Python Home</a></b>]'
|
||||||
if basename <> 'pep-0000.txt':
|
if basename <> 'pep-0000.txt':
|
||||||
print >> fo, '[<b><a href=".">index</a></b>]'
|
print >> fo, '[<b><a href=".">PEP Index</a></b>]'
|
||||||
if pep:
|
if pep:
|
||||||
print >> fo, '[<b><a href="pep-%04d.txt">PEP source</a></b>]' % int(pep)
|
print >> fo, '[<b><a href="pep-%04d.txt">PEP Source</a></b>]' \
|
||||||
print >> fo, '</div>'
|
% int(pep)
|
||||||
|
print >> fo, '</td></tr></table>'
|
||||||
print >> fo, '<div class="header">\n<table border="0">'
|
print >> fo, '<div class="header">\n<table border="0">'
|
||||||
for k, v in header:
|
for k, v in header:
|
||||||
if k.lower() in ('author', 'discussions-to'):
|
if k.lower() in ('author', 'discussions-to'):
|
||||||
|
@ -180,11 +192,12 @@ def fixfile(infile, outfile):
|
||||||
v = '<a href="%s">%s</a> ' % (url, cgi.escape(date))
|
v = '<a href="%s">%s</a> ' % (url, cgi.escape(date))
|
||||||
else:
|
else:
|
||||||
v = cgi.escape(v)
|
v = cgi.escape(v)
|
||||||
print >> fo, ' <tr><th align="right">%s:</th><td>%s</td></tr>' % (
|
print >> fo, ' <tr><th align="right">%s: </th><td>%s</td></tr>' \
|
||||||
cgi.escape(k), v)
|
% (cgi.escape(k), v)
|
||||||
print >> fo, '</table>'
|
print >> fo, '</table>'
|
||||||
print >> fo, '</div>'
|
print >> fo, '</div>'
|
||||||
print >> fo, '<hr />'
|
print >> fo, '<hr />'
|
||||||
|
print >> fo, '<div class="content">'
|
||||||
print >> fo, '<pre>'
|
print >> fo, '<pre>'
|
||||||
while 1:
|
while 1:
|
||||||
line = fi.readline()
|
line = fi.readline()
|
||||||
|
@ -221,6 +234,7 @@ def fixfile(infile, outfile):
|
||||||
line = fixpat.sub(lambda x, c=infile: fixanchor(c, x), line)
|
line = fixpat.sub(lambda x, c=infile: fixanchor(c, x), line)
|
||||||
fo.write(line)
|
fo.write(line)
|
||||||
print >> fo, '</pre>'
|
print >> fo, '</pre>'
|
||||||
|
print >> fo, '</div>'
|
||||||
print >> fo, '</body>'
|
print >> fo, '</body>'
|
||||||
print >> fo, '</html>'
|
print >> fo, '</html>'
|
||||||
fo.close()
|
fo.close()
|
||||||
|
|
20
style.css
20
style.css
|
@ -1,7 +1,15 @@
|
||||||
.navigation { background: #99ccff;
|
.navigation { width: 100%;
|
||||||
border: thin solid #ffffff;
|
background: #99ccff; }
|
||||||
width: 100%;
|
|
||||||
padding: 4pt;
|
|
||||||
}
|
|
||||||
|
|
||||||
.header th:after { content: " " }
|
.navigation .navicon { width: 150px;
|
||||||
|
height: 35; }
|
||||||
|
.navigation .textlinks { padding-left: 1em;
|
||||||
|
text-align: left; }
|
||||||
|
|
||||||
|
.header, .content { margin-left: 1em;
|
||||||
|
margin-right: 1em;
|
||||||
|
padding-left: 1em;
|
||||||
|
padding-right: 1em; }
|
||||||
|
|
||||||
|
body { margin: 0px;
|
||||||
|
padding: 0px; }
|
||||||
|
|
Loading…
Reference in New Issue