Show More
@@ -5,7 +5,7 b'' | |||
|
5 | 5 | # This software may be used and distributed according to the terms of the |
|
6 | 6 | # GNU General Public License version 2 or any later version. |
|
7 | 7 | |
|
8 | from __future__ import absolute_import | |
|
8 | from __future__ import absolute_import, print_function | |
|
9 | 9 | from mercurial.peer import ( |
|
10 | 10 | localbatch, |
|
11 | 11 | batchable, |
@@ -38,11 +38,11 b' class localthing(thing):' | |||
|
38 | 38 | def use(it): |
|
39 | 39 | |
|
40 | 40 | # Direct call to base method shared between client and server. |
|
41 |
print |
|
|
41 | print(it.hello()) | |
|
42 | 42 | |
|
43 | 43 | # Direct calls to proxied methods. They cause individual roundtrips. |
|
44 |
print |
|
|
45 |
print |
|
|
44 | print(it.foo("Un", two="Deux")) | |
|
45 | print(it.bar("Eins", "Zwei")) | |
|
46 | 46 | |
|
47 | 47 | # Batched call to a couple of (possibly proxied) methods. |
|
48 | 48 | batch = it.batch() |
@@ -60,17 +60,17 b' def use(it):' | |||
|
60 | 60 | # as possible. |
|
61 | 61 | batch.submit() |
|
62 | 62 | # After the call to submit, the futures actually contain values. |
|
63 |
print |
|
|
64 |
print |
|
|
65 |
print |
|
|
66 |
print |
|
|
67 |
print |
|
|
68 |
print |
|
|
63 | print(foo.value) | |
|
64 | print(foo2.value) | |
|
65 | print(bar.value) | |
|
66 | print(greet.value) | |
|
67 | print(hello.value) | |
|
68 | print(bar2.value) | |
|
69 | 69 | |
|
70 | 70 | # local usage |
|
71 | 71 | mylocal = localthing() |
|
72 | ||
|
73 |
print |
|
|
72 | print() | |
|
73 | print("== Local") | |
|
74 | 74 | use(mylocal) |
|
75 | 75 | |
|
76 | 76 | # demo remoting; mimicks what wireproto and HTTP/SSH do |
@@ -100,12 +100,12 b' class server(object):' | |||
|
100 | 100 | args = dict(arg.split('=', 1) for arg in args) |
|
101 | 101 | return getattr(self, name)(**args) |
|
102 | 102 | def perform(self, req): |
|
103 |
print |
|
|
103 | print("REQ:", req) | |
|
104 | 104 | name, args = req.split('?', 1) |
|
105 | 105 | args = args.split('&') |
|
106 | 106 | vals = dict(arg.split('=', 1) for arg in args) |
|
107 | 107 | res = getattr(self, name)(**vals) |
|
108 |
print |
|
|
108 | print(" ->", res) | |
|
109 | 109 | return res |
|
110 | 110 | def batch(self, cmds): |
|
111 | 111 | res = [] |
@@ -178,6 +178,6 b' class remotething(thing):' | |||
|
178 | 178 | # demo remote usage |
|
179 | 179 | |
|
180 | 180 | myproxy = remotething(myserver) |
|
181 | ||
|
182 |
print |
|
|
181 | print() | |
|
182 | print("== Remote") | |
|
183 | 183 | use(myproxy) |
@@ -53,7 +53,6 b'' | |||
|
53 | 53 | tests/svn-safe-append.py not using absolute_import |
|
54 | 54 | tests/svnxml.py not using absolute_import |
|
55 | 55 | tests/test-atomictempfile.py not using absolute_import |
|
56 | tests/test-batching.py requires print_function | |
|
57 | 56 | tests/test-bdiff.py not using absolute_import |
|
58 | 57 | tests/test-bdiff.py requires print_function |
|
59 | 58 | tests/test-context.py not using absolute_import |
@@ -252,7 +251,6 b'' | |||
|
252 | 251 | mercurial/windows.py: error importing module: <ImportError> No module named '_winreg' (line *) (glob) |
|
253 | 252 | mercurial/wireproto.py: error importing module: <SyntaxError> invalid syntax (bundle*.py, line *) (line *) (glob) |
|
254 | 253 | tests/readlink.py: invalid syntax: invalid syntax (<unknown>, line *) (glob) |
|
255 | tests/test-batching.py: invalid syntax: invalid syntax (<unknown>, line *) (glob) | |
|
256 | 254 | tests/test-bdiff.py: invalid syntax: invalid syntax (<unknown>, line *) (glob) |
|
257 | 255 | tests/test-context.py: invalid syntax: invalid syntax (<unknown>, line *) (glob) |
|
258 | 256 | tests/test-demandimport.py: invalid syntax: invalid syntax (<unknown>, line *) (glob) |
General Comments 0
You need to be logged in to leave comments.
Login now