src/eric7/DebugClients/Python/DebugClientBase.py

branch
eric7
changeset 10423
299802979277
parent 10417
c6011e501282
child 10439
21c28b0f9e41
equal deleted inserted replaced
10422:e28b89693f37 10423:299802979277
296 @param filename name of the source file 296 @param filename name of the source file
297 @type str 297 @type str
298 @param mode kind of code to be generated (exec or eval) 298 @param mode kind of code to be generated (exec or eval)
299 @type str 299 @type str
300 @return compiled code object (None in case of errors) 300 @return compiled code object (None in case of errors)
301 @rtype Code
301 """ 302 """
302 with codecs.open(filename, encoding=self.__coding) as fp: 303 with codecs.open(filename, encoding=self.__coding) as fp:
303 statement = fp.read() 304 statement = fp.read()
304 305
305 return self.__compileCommand(statement, filename=filename, mode=mode) 306 return self.__compileCommand(statement, filename=filename, mode=mode)
313 @param filename name of the source file 314 @param filename name of the source file
314 @type str 315 @type str
315 @param mode kind of code to be generated (exec or eval) 316 @param mode kind of code to be generated (exec or eval)
316 @type str 317 @type str
317 @return compiled code object (None in case of errors) 318 @return compiled code object (None in case of errors)
319 @rtype Code
318 """ 320 """
319 try: 321 try:
320 code = compile(statement + "\n", filename, mode) 322 code = compile(statement + "\n", filename, mode)
321 except SyntaxError: 323 except SyntaxError:
322 exctype, excval, exctb = sys.exc_info() 324 exctype, excval, exctb = sys.exc_info()
1045 def readReady(self, stream): 1047 def readReady(self, stream):
1046 """ 1048 """
1047 Public method called when there is data ready to be read. 1049 Public method called when there is data ready to be read.
1048 1050
1049 @param stream file like object that has data to be read 1051 @param stream file like object that has data to be read
1052 @type file like
1050 @return flag indicating an error condition 1053 @return flag indicating an error condition
1051 @rtype bool 1054 @rtype bool
1052 """ 1055 """
1053 error = False 1056 error = False
1054 1057
1070 def writeReady(self, stream): 1073 def writeReady(self, stream):
1071 """ 1074 """
1072 Public method called when we are ready to write data. 1075 Public method called when we are ready to write data.
1073 1076
1074 @param stream file like object that has data to be written 1077 @param stream file like object that has data to be written
1078 @type file like
1075 """ 1079 """
1076 stream.write_p("") 1080 stream.write_p("")
1077 stream.flush() 1081 stream.flush()
1078 1082
1079 def __interact(self): 1083 def __interact(self):

eric ide

mercurial