mirror of
https://github.com/python/cpython.git
synced 2025-12-10 11:00:14 +00:00
Nits.
Use TARGET=rlog instead of _blank for rlog output. Add missing mailto: to author's email address in Last changed link. Forget about the domainname in the cookie; the default is just fine.
This commit is contained in:
parent
1dcc24404b
commit
1d57981015
1 changed files with 7 additions and 8 deletions
|
|
@ -522,13 +522,12 @@ class FAQServer:
|
||||||
value = "%s;%s" % (author, email)
|
value = "%s;%s" % (author, email)
|
||||||
import urllib
|
import urllib
|
||||||
value = urllib.quote(value)
|
value = urllib.quote(value)
|
||||||
try:
|
|
||||||
hostname = os.environ['HTTP_HOST']
|
|
||||||
except KeyError:
|
|
||||||
hostname = os.environ['SERVER_NAME']
|
|
||||||
print "Set-Cookie: %s=%s; path=/cgi-bin/;" % (name, value),
|
print "Set-Cookie: %s=%s; path=/cgi-bin/;" % (name, value),
|
||||||
print "domain=%s;" % hostname,
|
import time
|
||||||
print "expires=Sat, 01-Jan-2000 00:00:00 GMT"
|
now = time.time()
|
||||||
|
then = now + 28 * 24 * 3600
|
||||||
|
gmt = time.gmtime(then)
|
||||||
|
print time.strftime("expires=%a, %d-%b-%x %X GMT", gmt)
|
||||||
|
|
||||||
def get_cookie(self):
|
def get_cookie(self):
|
||||||
if not os.environ.has_key('HTTP_COOKIE'):
|
if not os.environ.has_key('HTTP_COOKIE'):
|
||||||
|
|
@ -654,7 +653,7 @@ class FAQServer:
|
||||||
if edit:
|
if edit:
|
||||||
print """
|
print """
|
||||||
<A HREF="faq.py?req=edit&name=%s">Edit this entry</A> /
|
<A HREF="faq.py?req=edit&name=%s">Edit this entry</A> /
|
||||||
<A HREF="faq.py?req=info&name=%s" TARGET=_blank>Log info</A>
|
<A HREF="faq.py?req=info&name=%s" TARGET=rlog>Log info</A>
|
||||||
""" % (name, name)
|
""" % (name, name)
|
||||||
if self.headers:
|
if self.headers:
|
||||||
try:
|
try:
|
||||||
|
|
@ -664,7 +663,7 @@ class FAQServer:
|
||||||
except KeyError:
|
except KeyError:
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
s = '/ Last changed on %s by <A HREF="%s">%s</A>'
|
s = '/ Last changed on %s by <A HREF="mailto:%s">%s</A>'
|
||||||
print s % (date, email, author)
|
print s % (date, email, author)
|
||||||
print '<P>'
|
print '<P>'
|
||||||
print "<HR>"
|
print "<HR>"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue