adding get-with-headers.py
adding isolatin
% hg serve
% hgweb filerevision, html
200 Script output follows
test:get-with-headers.py
get-with-headers.py
changeset 0: |
7697c52ca9b0 |
author: |
test |
date: |
Thu Jan 01 00:00:00 1970 +0000 (long ago) |
permissions: |
-rwxr-xr-x |
description: |
a |
3__doc__ = """This does HTTP get requests given a host:port and path and returns 4a subset of the headers plus the body of the result.""" 10 msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY) 11 msvcrt.setmode(sys.stderr.fileno(), os.O_BINARY) 15headers = [h.lower() for h in sys.argv[3:]] 16conn = httplib.HTTPConnection(sys.argv[1]) 17conn.request("GET", sys.argv[2]) 18response = conn.getresponse() 19print response.status, response.reason 21 if response.getheader(h, None) is not None: 22 print "%s: %s" % (h, response.getheader(h)) 24sys.stdout.write(response.read()) 26if 200 <= response.status <= 299:
% hgweb filerevision, html
200 Script output follows
test:isolatin
isolatin
changeset 0: |
7697c52ca9b0 |
author: |
test |
date: |
Thu Jan 01 00:00:00 1970 +0000 (long ago) |
permissions: |
-rw-r--r-- |
description: |
a |
% hgweb fileannotate, html
200 Script output follows
test: get-with-headers.py annotate
Annotate get-with-headers.py
changeset 0: |
7697c52ca9b0 |
author: |
test |
date: |
Thu Jan 01 00:00:00 1970 +0000 (long ago) |
permissions: |
-rwxr-xr-x |
description: |
a |
% hgweb fileannotate, raw
% hgweb filerevision, raw
% hgweb highlightcss friendly
200 Script output follows
/* pygments_style = friendly */
% errors encountered
% hg serve again
% hgweb highlightcss fruity
200 Script output follows
/* pygments_style = fruity */
% errors encountered