DebugClients/Python3/DebugClientBase.py

branch
jsonrpc
changeset 5131
889ed5ff7a68
parent 5129
e4ab234cf071
child 5135
04905a8681dc
equal deleted inserted replaced
5130:27fe451262bf 5131:889ed5ff7a68
720 del tblist[:1] 720 del tblist[:1]
721 tlist = traceback.format_list(tblist) 721 tlist = traceback.format_list(tblist)
722 if tlist: 722 if tlist:
723 tlist.insert( 723 tlist.insert(
724 0, "Traceback (innermost last):\n") 724 0, "Traceback (innermost last):\n")
725 tlist[len(tlist):] = \ 725 tlist.extend(traceback.format_exception_only(
726 traceback.format_exception_only( 726 exc_type, exc_value))
727 exc_type, exc_value)
728 finally: 727 finally:
729 tblist = exc_tb = None 728 tblist = exc_tb = None
730 729
731 self.sendJsonCommand("ClientOutput", { 730 self.sendJsonCommand("ClientOutput", {
732 "text": "".join(tlist) 731 "text": "".join(tlist)
821 820
822 elif method == "RequestWatchIgnore": 821 elif method == "RequestWatchIgnore":
823 wp = self.mainThread.get_watch(params["condition"]) 822 wp = self.mainThread.get_watch(params["condition"])
824 if wp is not None: 823 if wp is not None:
825 wp.ignore = params["count"] 824 wp.ignore = params["count"]
826 return
827 825
828 elif method == "RequestShutdown": 826 elif method == "RequestShutdown":
829 self.sessionClose() 827 self.sessionClose()
830 828
831 elif method == "RequestCompletion": 829 elif method == "RequestCompletion":
832 self.__completionList(params["text"]) 830 self.__completionList(params["text"])
833 831
834 elif method == "RequestUTPrepare": 832 elif method == "RequestUTPrepare":
833 sys.path.insert(
834 0, os.path.dirname(os.path.abspath(params["filename"])))
835 os.chdir(sys.path[0])
836
835 # set the system exception handling function to ensure, that 837 # set the system exception handling function to ensure, that
836 # we report on all unhandled exceptions 838 # we report on all unhandled exceptions
837 sys.excepthook = self.__unhandled_exception 839 sys.excepthook = self.__unhandled_exception
838 self.__interceptSignals() 840 self.__interceptSignals()
839 841
1343 @param message status message 1345 @param message status message
1344 @type str 1346 @type str
1345 """ 1347 """
1346 if status is None: 1348 if status is None:
1347 status = 0 1349 status = 0
1348 else: 1350 elif not isinstance(status, int):
1349 try: 1351 message = str(status)
1350 int(status) 1352 status = 1
1351 except ValueError:
1352 status = 1
1353 1353
1354 if self.running: 1354 if self.running:
1355 self.set_quit() 1355 self.set_quit()
1356 self.running = None 1356 self.running = None
1357 self.sendJsonCommand("ResponseExit", { 1357 self.sendJsonCommand("ResponseExit", {

eric ide

mercurial