Show More
@@ -117,7 +117,6 b'' | |||
|
117 | 117 | tests/test-url.py requires print_function |
|
118 | 118 | tests/test-walkrepo.py requires print_function |
|
119 | 119 | tests/test-wireproto.py requires print_function |
|
120 | tests/tinyproxy.py requires print_function | |
|
121 | 120 | |
|
122 | 121 | #if py3exe |
|
123 | 122 | $ hg files 'set:(**.py)' | sed 's|\\|/|g' | xargs $PYTHON3 contrib/check-py3-compat.py |
@@ -303,6 +302,5 b'' | |||
|
303 | 302 | tests/test-ui-verbosity.py: invalid syntax: Missing parentheses in call to 'print' (<unknown>, line *) (glob) |
|
304 | 303 | tests/test-walkrepo.py: invalid syntax: invalid syntax (<unknown>, line *) (glob) |
|
305 | 304 | tests/test-wireproto.py: invalid syntax: invalid syntax (<unknown>, line *) (glob) |
|
306 | tests/tinyproxy.py: invalid syntax: Missing parentheses in call to 'print' (<unknown>, line *) (glob) | |
|
307 | 305 | |
|
308 | 306 | #endif |
@@ -1,6 +1,6 b'' | |||
|
1 | 1 | #!/usr/bin/env python |
|
2 | 2 | |
|
3 | from __future__ import absolute_import | |
|
3 | from __future__ import absolute_import, print_function | |
|
4 | 4 | |
|
5 | 5 | __doc__ = """Tiny HTTP Proxy. |
|
6 | 6 | |
@@ -50,7 +50,7 b' class ProxyHandler (BaseHTTPServer.BaseH' | |||
|
50 | 50 | host_port = netloc[:i], int(netloc[i + 1:]) |
|
51 | 51 | else: |
|
52 | 52 | host_port = netloc, 80 |
|
53 |
print |
|
|
53 | print("\t" "connect to %s:%d" % host_port) | |
|
54 | 54 | try: soc.connect(host_port) |
|
55 | 55 | except socket.error as arg: |
|
56 | 56 | try: msg = arg[1] |
@@ -70,7 +70,7 b' class ProxyHandler (BaseHTTPServer.BaseH' | |||
|
70 | 70 | self.wfile.write("\r\n") |
|
71 | 71 | self._read_write(soc, 300) |
|
72 | 72 | finally: |
|
73 |
print |
|
|
73 | print("\t" "bye") | |
|
74 | 74 | soc.close() |
|
75 | 75 | self.connection.close() |
|
76 | 76 | |
@@ -95,7 +95,7 b' class ProxyHandler (BaseHTTPServer.BaseH' | |||
|
95 | 95 | soc.send("\r\n") |
|
96 | 96 | self._read_write(soc) |
|
97 | 97 | finally: |
|
98 |
print |
|
|
98 | print("\t" "bye") | |
|
99 | 99 | soc.close() |
|
100 | 100 | self.connection.close() |
|
101 | 101 | |
@@ -122,7 +122,7 b' class ProxyHandler (BaseHTTPServer.BaseH' | |||
|
122 | 122 | out.send(data) |
|
123 | 123 | count = 0 |
|
124 | 124 | else: |
|
125 |
print |
|
|
125 | print("\t" "idle", count) | |
|
126 | 126 | if count == max_idling: |
|
127 | 127 | break |
|
128 | 128 | |
@@ -142,16 +142,16 b' class ThreadingHTTPServer (SocketServer.' | |||
|
142 | 142 | if __name__ == '__main__': |
|
143 | 143 | from sys import argv |
|
144 | 144 | if argv[1:] and argv[1] in ('-h', '--help'): |
|
145 |
print |
|
|
145 | print(argv[0], "[port [allowed_client_name ...]]") | |
|
146 | 146 | else: |
|
147 | 147 | if argv[2:]: |
|
148 | 148 | allowed = [] |
|
149 | 149 | for name in argv[2:]: |
|
150 | 150 | client = socket.gethostbyname(name) |
|
151 | 151 | allowed.append(client) |
|
152 |
print |
|
|
152 | print("Accept: %s (%s)" % (client, name)) | |
|
153 | 153 | ProxyHandler.allowed_clients = allowed |
|
154 | 154 | del argv[2:] |
|
155 | 155 | else: |
|
156 |
print |
|
|
156 | print("Any clients will be served...") | |
|
157 | 157 | BaseHTTPServer.test(ProxyHandler, ThreadingHTTPServer) |
General Comments 0
You need to be logged in to leave comments.
Login now