OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 # A simple native client in python. | 6 # A simple native client in python. |
7 # All this client does is echo the text it receives back at the extension. | 7 # All this client does is echo the text it receives back at the extension. |
8 | 8 |
9 import sys | 9 import sys |
10 import struct | 10 import struct |
(...skipping 21 matching lines...) Expand all Loading... |
32 | 32 |
33 try: | 33 try: |
34 sys.stdout.write(struct.pack("I", len(response))) | 34 sys.stdout.write(struct.pack("I", len(response))) |
35 sys.stdout.write(response) | 35 sys.stdout.write(response) |
36 sys.stdout.flush() | 36 sys.stdout.flush() |
37 except IOError: | 37 except IOError: |
38 break | 38 break |
39 | 39 |
40 if __name__ == '__main__': | 40 if __name__ == '__main__': |
41 Main() | 41 Main() |
OLD | NEW |