Mercurial > vim
annotate runtime/tools/demoserver.py @ 26496:8861ece40b4b v8.2.3778
patch 8.2.3778: lambda debug test fails in some configurations
Commit: https://github.com/vim/vim/commit/9537e37b1124a0584e5f2af10756baca78bc73a1
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri Dec 10 21:05:53 2021 +0000
patch 8.2.3778: lambda debug test fails in some configurations
Problem: Lambda debug test fails in some configurations.
Solution: Check feature in a legacy function.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Fri, 10 Dec 2021 22:15:03 +0100 |
parents | c725b8e17f1f |
children | dce918af0c00 |
rev | line source |
---|---|
7788
192ae655ac91
commit https://github.com/vim/vim/commit/3b5f929b18492fec291d1ec95a91f54e5912c03b
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1 #!/usr/bin/python |
7895
bff95e0d8885
commit https://github.com/vim/vim/commit/f57969a20a4398f56e3028a6cc1102f9f9286ccf
Christian Brabandt <cb@256bit.org>
parents:
7874
diff
changeset
|
2 # |
7788
192ae655ac91
commit https://github.com/vim/vim/commit/3b5f929b18492fec291d1ec95a91f54e5912c03b
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
3 # Server that will accept connections from a Vim channel. |
192ae655ac91
commit https://github.com/vim/vim/commit/3b5f929b18492fec291d1ec95a91f54e5912c03b
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
4 # Run this server and then in Vim you can open the channel: |
8148
f5da459c5698
commit https://github.com/vim/vim/commit/e0fa3742ead676a3074a10edadbc955e1a89153d
Christian Brabandt <cb@256bit.org>
parents:
7895
diff
changeset
|
5 # :let handle = ch_open('localhost:8765') |
7788
192ae655ac91
commit https://github.com/vim/vim/commit/3b5f929b18492fec291d1ec95a91f54e5912c03b
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
6 # |
192ae655ac91
commit https://github.com/vim/vim/commit/3b5f929b18492fec291d1ec95a91f54e5912c03b
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
7 # Then Vim can send requests to the server: |
7895
bff95e0d8885
commit https://github.com/vim/vim/commit/f57969a20a4398f56e3028a6cc1102f9f9286ccf
Christian Brabandt <cb@256bit.org>
parents:
7874
diff
changeset
|
8 # :let response = ch_sendexpr(handle, 'hello!') |
7788
192ae655ac91
commit https://github.com/vim/vim/commit/3b5f929b18492fec291d1ec95a91f54e5912c03b
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
9 # |
192ae655ac91
commit https://github.com/vim/vim/commit/3b5f929b18492fec291d1ec95a91f54e5912c03b
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
10 # And you can control Vim by typing a JSON message here, e.g.: |
192ae655ac91
commit https://github.com/vim/vim/commit/3b5f929b18492fec291d1ec95a91f54e5912c03b
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
11 # ["ex","echo 'hi there'"] |
192ae655ac91
commit https://github.com/vim/vim/commit/3b5f929b18492fec291d1ec95a91f54e5912c03b
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
12 # |
7895
bff95e0d8885
commit https://github.com/vim/vim/commit/f57969a20a4398f56e3028a6cc1102f9f9286ccf
Christian Brabandt <cb@256bit.org>
parents:
7874
diff
changeset
|
13 # There is no prompt, just type a line and press Enter. |
bff95e0d8885
commit https://github.com/vim/vim/commit/f57969a20a4398f56e3028a6cc1102f9f9286ccf
Christian Brabandt <cb@256bit.org>
parents:
7874
diff
changeset
|
14 # To exit cleanly type "quit<Enter>". |
bff95e0d8885
commit https://github.com/vim/vim/commit/f57969a20a4398f56e3028a6cc1102f9f9286ccf
Christian Brabandt <cb@256bit.org>
parents:
7874
diff
changeset
|
15 # |
7788
192ae655ac91
commit https://github.com/vim/vim/commit/3b5f929b18492fec291d1ec95a91f54e5912c03b
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
16 # See ":help channel-demo" in Vim. |
7895
bff95e0d8885
commit https://github.com/vim/vim/commit/f57969a20a4398f56e3028a6cc1102f9f9286ccf
Christian Brabandt <cb@256bit.org>
parents:
7874
diff
changeset
|
17 # |
bff95e0d8885
commit https://github.com/vim/vim/commit/f57969a20a4398f56e3028a6cc1102f9f9286ccf
Christian Brabandt <cb@256bit.org>
parents:
7874
diff
changeset
|
18 # This requires Python 2.6 or later. |
7788
192ae655ac91
commit https://github.com/vim/vim/commit/3b5f929b18492fec291d1ec95a91f54e5912c03b
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
19 |
7874
2313f1a94153
commit https://github.com/vim/vim/commit/488a130ea261f02317adc2c2ca93cc6e68cf2c23
Christian Brabandt <cb@256bit.org>
parents:
7788
diff
changeset
|
20 from __future__ import print_function |
7788
192ae655ac91
commit https://github.com/vim/vim/commit/3b5f929b18492fec291d1ec95a91f54e5912c03b
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
21 import json |
192ae655ac91
commit https://github.com/vim/vim/commit/3b5f929b18492fec291d1ec95a91f54e5912c03b
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
22 import socket |
192ae655ac91
commit https://github.com/vim/vim/commit/3b5f929b18492fec291d1ec95a91f54e5912c03b
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
23 import sys |
192ae655ac91
commit https://github.com/vim/vim/commit/3b5f929b18492fec291d1ec95a91f54e5912c03b
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
24 import threading |
192ae655ac91
commit https://github.com/vim/vim/commit/3b5f929b18492fec291d1ec95a91f54e5912c03b
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
25 |
7874
2313f1a94153
commit https://github.com/vim/vim/commit/488a130ea261f02317adc2c2ca93cc6e68cf2c23
Christian Brabandt <cb@256bit.org>
parents:
7788
diff
changeset
|
26 try: |
2313f1a94153
commit https://github.com/vim/vim/commit/488a130ea261f02317adc2c2ca93cc6e68cf2c23
Christian Brabandt <cb@256bit.org>
parents:
7788
diff
changeset
|
27 # Python 3 |
2313f1a94153
commit https://github.com/vim/vim/commit/488a130ea261f02317adc2c2ca93cc6e68cf2c23
Christian Brabandt <cb@256bit.org>
parents:
7788
diff
changeset
|
28 import socketserver |
2313f1a94153
commit https://github.com/vim/vim/commit/488a130ea261f02317adc2c2ca93cc6e68cf2c23
Christian Brabandt <cb@256bit.org>
parents:
7788
diff
changeset
|
29 except ImportError: |
2313f1a94153
commit https://github.com/vim/vim/commit/488a130ea261f02317adc2c2ca93cc6e68cf2c23
Christian Brabandt <cb@256bit.org>
parents:
7788
diff
changeset
|
30 # Python 2 |
2313f1a94153
commit https://github.com/vim/vim/commit/488a130ea261f02317adc2c2ca93cc6e68cf2c23
Christian Brabandt <cb@256bit.org>
parents:
7788
diff
changeset
|
31 import SocketServer as socketserver |
2313f1a94153
commit https://github.com/vim/vim/commit/488a130ea261f02317adc2c2ca93cc6e68cf2c23
Christian Brabandt <cb@256bit.org>
parents:
7788
diff
changeset
|
32 |
7788
192ae655ac91
commit https://github.com/vim/vim/commit/3b5f929b18492fec291d1ec95a91f54e5912c03b
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
33 thesocket = None |
192ae655ac91
commit https://github.com/vim/vim/commit/3b5f929b18492fec291d1ec95a91f54e5912c03b
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
34 |
7874
2313f1a94153
commit https://github.com/vim/vim/commit/488a130ea261f02317adc2c2ca93cc6e68cf2c23
Christian Brabandt <cb@256bit.org>
parents:
7788
diff
changeset
|
35 class ThreadedTCPRequestHandler(socketserver.BaseRequestHandler): |
7788
192ae655ac91
commit https://github.com/vim/vim/commit/3b5f929b18492fec291d1ec95a91f54e5912c03b
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
36 |
192ae655ac91
commit https://github.com/vim/vim/commit/3b5f929b18492fec291d1ec95a91f54e5912c03b
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
37 def handle(self): |
7874
2313f1a94153
commit https://github.com/vim/vim/commit/488a130ea261f02317adc2c2ca93cc6e68cf2c23
Christian Brabandt <cb@256bit.org>
parents:
7788
diff
changeset
|
38 print("=== socket opened ===") |
7788
192ae655ac91
commit https://github.com/vim/vim/commit/3b5f929b18492fec291d1ec95a91f54e5912c03b
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
39 global thesocket |
192ae655ac91
commit https://github.com/vim/vim/commit/3b5f929b18492fec291d1ec95a91f54e5912c03b
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
40 thesocket = self.request |
192ae655ac91
commit https://github.com/vim/vim/commit/3b5f929b18492fec291d1ec95a91f54e5912c03b
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
41 while True: |
192ae655ac91
commit https://github.com/vim/vim/commit/3b5f929b18492fec291d1ec95a91f54e5912c03b
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
42 try: |
7874
2313f1a94153
commit https://github.com/vim/vim/commit/488a130ea261f02317adc2c2ca93cc6e68cf2c23
Christian Brabandt <cb@256bit.org>
parents:
7788
diff
changeset
|
43 data = self.request.recv(4096).decode('utf-8') |
7788
192ae655ac91
commit https://github.com/vim/vim/commit/3b5f929b18492fec291d1ec95a91f54e5912c03b
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
44 except socket.error: |
7874
2313f1a94153
commit https://github.com/vim/vim/commit/488a130ea261f02317adc2c2ca93cc6e68cf2c23
Christian Brabandt <cb@256bit.org>
parents:
7788
diff
changeset
|
45 print("=== socket error ===") |
7788
192ae655ac91
commit https://github.com/vim/vim/commit/3b5f929b18492fec291d1ec95a91f54e5912c03b
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
46 break |
192ae655ac91
commit https://github.com/vim/vim/commit/3b5f929b18492fec291d1ec95a91f54e5912c03b
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
47 except IOError: |
7874
2313f1a94153
commit https://github.com/vim/vim/commit/488a130ea261f02317adc2c2ca93cc6e68cf2c23
Christian Brabandt <cb@256bit.org>
parents:
7788
diff
changeset
|
48 print("=== socket closed ===") |
7788
192ae655ac91
commit https://github.com/vim/vim/commit/3b5f929b18492fec291d1ec95a91f54e5912c03b
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
49 break |
192ae655ac91
commit https://github.com/vim/vim/commit/3b5f929b18492fec291d1ec95a91f54e5912c03b
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
50 if data == '': |
7874
2313f1a94153
commit https://github.com/vim/vim/commit/488a130ea261f02317adc2c2ca93cc6e68cf2c23
Christian Brabandt <cb@256bit.org>
parents:
7788
diff
changeset
|
51 print("=== socket closed ===") |
7788
192ae655ac91
commit https://github.com/vim/vim/commit/3b5f929b18492fec291d1ec95a91f54e5912c03b
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
52 break |
8673
ed7251c3e2d3
commit https://github.com/vim/vim/commit/e18c0b39815c5a746887a509c2cd9f11fadaba07
Christian Brabandt <cb@256bit.org>
parents:
8148
diff
changeset
|
53 print("received: {0}".format(data)) |
7788
192ae655ac91
commit https://github.com/vim/vim/commit/3b5f929b18492fec291d1ec95a91f54e5912c03b
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
54 try: |
192ae655ac91
commit https://github.com/vim/vim/commit/3b5f929b18492fec291d1ec95a91f54e5912c03b
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
55 decoded = json.loads(data) |
192ae655ac91
commit https://github.com/vim/vim/commit/3b5f929b18492fec291d1ec95a91f54e5912c03b
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
56 except ValueError: |
7874
2313f1a94153
commit https://github.com/vim/vim/commit/488a130ea261f02317adc2c2ca93cc6e68cf2c23
Christian Brabandt <cb@256bit.org>
parents:
7788
diff
changeset
|
57 print("json decoding failed") |
2313f1a94153
commit https://github.com/vim/vim/commit/488a130ea261f02317adc2c2ca93cc6e68cf2c23
Christian Brabandt <cb@256bit.org>
parents:
7788
diff
changeset
|
58 decoded = [-1, ''] |
7788
192ae655ac91
commit https://github.com/vim/vim/commit/3b5f929b18492fec291d1ec95a91f54e5912c03b
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
59 |
7874
2313f1a94153
commit https://github.com/vim/vim/commit/488a130ea261f02317adc2c2ca93cc6e68cf2c23
Christian Brabandt <cb@256bit.org>
parents:
7788
diff
changeset
|
60 # Send a response if the sequence number is positive. |
2313f1a94153
commit https://github.com/vim/vim/commit/488a130ea261f02317adc2c2ca93cc6e68cf2c23
Christian Brabandt <cb@256bit.org>
parents:
7788
diff
changeset
|
61 # Negative numbers are used for "eval" responses. |
2313f1a94153
commit https://github.com/vim/vim/commit/488a130ea261f02317adc2c2ca93cc6e68cf2c23
Christian Brabandt <cb@256bit.org>
parents:
7788
diff
changeset
|
62 if decoded[0] >= 0: |
2313f1a94153
commit https://github.com/vim/vim/commit/488a130ea261f02317adc2c2ca93cc6e68cf2c23
Christian Brabandt <cb@256bit.org>
parents:
7788
diff
changeset
|
63 if decoded[1] == 'hello!': |
2313f1a94153
commit https://github.com/vim/vim/commit/488a130ea261f02317adc2c2ca93cc6e68cf2c23
Christian Brabandt <cb@256bit.org>
parents:
7788
diff
changeset
|
64 response = "got it" |
26438 | 65 id = decoded[0] |
66 elif decoded[1] == 'hello channel!': | |
67 response = "got that" | |
68 # response is not to a specific message callback but to the | |
69 # channel callback, need to use ID zero | |
70 id = 0 | |
7874
2313f1a94153
commit https://github.com/vim/vim/commit/488a130ea261f02317adc2c2ca93cc6e68cf2c23
Christian Brabandt <cb@256bit.org>
parents:
7788
diff
changeset
|
71 else: |
2313f1a94153
commit https://github.com/vim/vim/commit/488a130ea261f02317adc2c2ca93cc6e68cf2c23
Christian Brabandt <cb@256bit.org>
parents:
7788
diff
changeset
|
72 response = "what?" |
26438 | 73 id = decoded[0] |
74 encoded = json.dumps([id, response]) | |
8673
ed7251c3e2d3
commit https://github.com/vim/vim/commit/e18c0b39815c5a746887a509c2cd9f11fadaba07
Christian Brabandt <cb@256bit.org>
parents:
8148
diff
changeset
|
75 print("sending {0}".format(encoded)) |
7874
2313f1a94153
commit https://github.com/vim/vim/commit/488a130ea261f02317adc2c2ca93cc6e68cf2c23
Christian Brabandt <cb@256bit.org>
parents:
7788
diff
changeset
|
76 self.request.sendall(encoded.encode('utf-8')) |
7788
192ae655ac91
commit https://github.com/vim/vim/commit/3b5f929b18492fec291d1ec95a91f54e5912c03b
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
77 thesocket = None |
192ae655ac91
commit https://github.com/vim/vim/commit/3b5f929b18492fec291d1ec95a91f54e5912c03b
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
78 |
7874
2313f1a94153
commit https://github.com/vim/vim/commit/488a130ea261f02317adc2c2ca93cc6e68cf2c23
Christian Brabandt <cb@256bit.org>
parents:
7788
diff
changeset
|
79 class ThreadedTCPServer(socketserver.ThreadingMixIn, socketserver.TCPServer): |
7788
192ae655ac91
commit https://github.com/vim/vim/commit/3b5f929b18492fec291d1ec95a91f54e5912c03b
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
80 pass |
192ae655ac91
commit https://github.com/vim/vim/commit/3b5f929b18492fec291d1ec95a91f54e5912c03b
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
81 |
192ae655ac91
commit https://github.com/vim/vim/commit/3b5f929b18492fec291d1ec95a91f54e5912c03b
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
82 if __name__ == "__main__": |
192ae655ac91
commit https://github.com/vim/vim/commit/3b5f929b18492fec291d1ec95a91f54e5912c03b
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
83 HOST, PORT = "localhost", 8765 |
192ae655ac91
commit https://github.com/vim/vim/commit/3b5f929b18492fec291d1ec95a91f54e5912c03b
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
84 |
192ae655ac91
commit https://github.com/vim/vim/commit/3b5f929b18492fec291d1ec95a91f54e5912c03b
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
85 server = ThreadedTCPServer((HOST, PORT), ThreadedTCPRequestHandler) |
192ae655ac91
commit https://github.com/vim/vim/commit/3b5f929b18492fec291d1ec95a91f54e5912c03b
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
86 ip, port = server.server_address |
192ae655ac91
commit https://github.com/vim/vim/commit/3b5f929b18492fec291d1ec95a91f54e5912c03b
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
87 |
192ae655ac91
commit https://github.com/vim/vim/commit/3b5f929b18492fec291d1ec95a91f54e5912c03b
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
88 # Start a thread with the server -- that thread will then start one |
192ae655ac91
commit https://github.com/vim/vim/commit/3b5f929b18492fec291d1ec95a91f54e5912c03b
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
89 # more thread for each request |
192ae655ac91
commit https://github.com/vim/vim/commit/3b5f929b18492fec291d1ec95a91f54e5912c03b
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
90 server_thread = threading.Thread(target=server.serve_forever) |
192ae655ac91
commit https://github.com/vim/vim/commit/3b5f929b18492fec291d1ec95a91f54e5912c03b
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
91 |
192ae655ac91
commit https://github.com/vim/vim/commit/3b5f929b18492fec291d1ec95a91f54e5912c03b
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
92 # Exit the server thread when the main thread terminates |
192ae655ac91
commit https://github.com/vim/vim/commit/3b5f929b18492fec291d1ec95a91f54e5912c03b
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
93 server_thread.daemon = True |
192ae655ac91
commit https://github.com/vim/vim/commit/3b5f929b18492fec291d1ec95a91f54e5912c03b
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
94 server_thread.start() |
7874
2313f1a94153
commit https://github.com/vim/vim/commit/488a130ea261f02317adc2c2ca93cc6e68cf2c23
Christian Brabandt <cb@256bit.org>
parents:
7788
diff
changeset
|
95 print("Server loop running in thread: ", server_thread.name) |
7788
192ae655ac91
commit https://github.com/vim/vim/commit/3b5f929b18492fec291d1ec95a91f54e5912c03b
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
96 |
8673
ed7251c3e2d3
commit https://github.com/vim/vim/commit/e18c0b39815c5a746887a509c2cd9f11fadaba07
Christian Brabandt <cb@256bit.org>
parents:
8148
diff
changeset
|
97 print("Listening on port {0}".format(PORT)) |
7788
192ae655ac91
commit https://github.com/vim/vim/commit/3b5f929b18492fec291d1ec95a91f54e5912c03b
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
98 while True: |
192ae655ac91
commit https://github.com/vim/vim/commit/3b5f929b18492fec291d1ec95a91f54e5912c03b
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
99 typed = sys.stdin.readline() |
192ae655ac91
commit https://github.com/vim/vim/commit/3b5f929b18492fec291d1ec95a91f54e5912c03b
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
100 if "quit" in typed: |
7874
2313f1a94153
commit https://github.com/vim/vim/commit/488a130ea261f02317adc2c2ca93cc6e68cf2c23
Christian Brabandt <cb@256bit.org>
parents:
7788
diff
changeset
|
101 print("Goodbye!") |
7788
192ae655ac91
commit https://github.com/vim/vim/commit/3b5f929b18492fec291d1ec95a91f54e5912c03b
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
102 break |
192ae655ac91
commit https://github.com/vim/vim/commit/3b5f929b18492fec291d1ec95a91f54e5912c03b
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
103 if thesocket is None: |
7874
2313f1a94153
commit https://github.com/vim/vim/commit/488a130ea261f02317adc2c2ca93cc6e68cf2c23
Christian Brabandt <cb@256bit.org>
parents:
7788
diff
changeset
|
104 print("No socket yet") |
7788
192ae655ac91
commit https://github.com/vim/vim/commit/3b5f929b18492fec291d1ec95a91f54e5912c03b
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
105 else: |
8673
ed7251c3e2d3
commit https://github.com/vim/vim/commit/e18c0b39815c5a746887a509c2cd9f11fadaba07
Christian Brabandt <cb@256bit.org>
parents:
8148
diff
changeset
|
106 print("sending {0}".format(typed)) |
7874
2313f1a94153
commit https://github.com/vim/vim/commit/488a130ea261f02317adc2c2ca93cc6e68cf2c23
Christian Brabandt <cb@256bit.org>
parents:
7788
diff
changeset
|
107 thesocket.sendall(typed.encode('utf-8')) |
7788
192ae655ac91
commit https://github.com/vim/vim/commit/3b5f929b18492fec291d1ec95a91f54e5912c03b
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
108 |
192ae655ac91
commit https://github.com/vim/vim/commit/3b5f929b18492fec291d1ec95a91f54e5912c03b
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
109 server.shutdown() |
192ae655ac91
commit https://github.com/vim/vim/commit/3b5f929b18492fec291d1ec95a91f54e5912c03b
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
110 server.server_close() |