eric6/DebugClients/Python/AsyncFile.py

changeset 7760
fcd3322bf6ed
parent 7707
6abcf4275d0e
child 7802
eefe954f01e8
child 7836
2f0d208b8137
equal deleted inserted replaced
7759:51aa6c6b66f7 7760:fcd3322bf6ed
331 def write(self, s): 331 def write(self, s):
332 """ 332 """
333 Public method to write a string to the file. 333 Public method to write a string to the file.
334 334
335 @param s text to be written 335 @param s text to be written
336 @type str 336 @type str, bytes or bytearray
337 """ 337 """
338 self.__checkMode('w') 338 self.__checkMode('w')
339
340 if isinstance(s, (bytes, bytearray)):
341 # convert to string to send it
342 s = repr(s)
339 343
340 cmd = prepareJsonCommand("ClientOutput", { 344 cmd = prepareJsonCommand("ClientOutput", {
341 "text": s, 345 "text": s,
342 }) 346 })
343 self.wpending.append(cmd) 347 self.wpending.append(cmd)

eric ide

mercurial