DebugClients/Python3/AsyncFile.py

branch
jsonrpc
changeset 5129
e4ab234cf071
parent 5128
b6cbdba69967
child 5131
889ed5ff7a68
equal deleted inserted replaced
5128:b6cbdba69967 5129:e4ab234cf071
7 Module implementing an asynchronous file like socket interface for the 7 Module implementing an asynchronous file like socket interface for the
8 debugger. 8 debugger.
9 """ 9 """
10 10
11 import socket 11 import socket
12
13 from DebugUtilities import prepareJsonCommand
12 14
13 15
14 def AsyncPendingWrite(file): 16 def AsyncPendingWrite(file):
15 """ 17 """
16 Module function to check for data to be written. 18 Module function to check for data to be written.
295 297
296 @param s text to be written (string) 298 @param s text to be written (string)
297 """ 299 """
298 self.__checkMode('w') 300 self.__checkMode('w')
299 301
300 import json 302 cmd = prepareJsonCommand("ClientOutput", {
301 commandDict = { 303 "text": s,
302 "jsonrpc": "2.0", 304 })
303 "method": "ClientOutput",
304 "params": {
305 "text": s,
306 }
307 }
308 cmd = json.dumps(commandDict) + '\n'
309
310 self.write_p(cmd) 305 self.write_p(cmd)
311 306
312 def write_p(self, s): 307 def write_p(self, s):
313 """ 308 """
314 Public method to write a string to the file. 309 Public method to write a string to the file.

eric ide

mercurial