DebugClients/Python/DebugClientBase.py

branch
5_2_x
changeset 1707
033317caabaf
parent 1606
446515c955f6
child 1727
9355815a4403
equal deleted inserted replaced
1692:f67b8b8e372a 1707:033317caabaf
205 # The list of regexp objects to filter variables against 205 # The list of regexp objects to filter variables against
206 self.globalsFilterObjects = [] 206 self.globalsFilterObjects = []
207 self.localsFilterObjects = [] 207 self.localsFilterObjects = []
208 208
209 self.pendingResponse = DebugProtocol.ResponseOK 209 self.pendingResponse = DebugProtocol.ResponseOK
210 self.fncache = {} 210 self._fncache = {}
211 self.dircache = [] 211 self.dircache = []
212 self.inRawMode = 0 212 self.inRawMode = 0
213 self.mainProcStr = None # used for the passive mode 213 self.mainProcStr = None # used for the passive mode
214 self.passive = 0 # used to indicate the passive mode 214 self.passive = 0 # used to indicate the passive mode
215 self.running = None 215 self.running = None
467 else: 467 else:
468 os.environ[key] = value 468 os.environ[key] = value
469 return 469 return
470 470
471 if cmd == DebugProtocol.RequestLoad: 471 if cmd == DebugProtocol.RequestLoad:
472 self.fncache = {} 472 self._fncache = {}
473 self.dircache = [] 473 self.dircache = []
474 sys.argv = [] 474 sys.argv = []
475 wd, fn, args, tracePython = arg.split('|') 475 wd, fn, args, tracePython = arg.split('|')
476 self.__setCoding(fn) 476 self.__setCoding(fn)
477 sys.argv.append(fn) 477 sys.argv.append(fn)
1116 """ 1116 """
1117 if os.path.isabs(fn): 1117 if os.path.isabs(fn):
1118 return fn 1118 return fn
1119 1119
1120 # Check the cache. 1120 # Check the cache.
1121 if fn in self.fncache: 1121 if fn in self._fncache:
1122 return self.fncache[fn] 1122 return self._fncache[fn]
1123 1123
1124 # Search sys.path. 1124 # Search sys.path.
1125 for p in sys.path: 1125 for p in sys.path:
1126 afn = os.path.abspath(os.path.join(p, fn)) 1126 afn = os.path.abspath(os.path.join(p, fn))
1127 nafn = os.path.normcase(afn) 1127 nafn = os.path.normcase(afn)
1128 1128
1129 if os.path.exists(nafn): 1129 if os.path.exists(nafn):
1130 self.fncache[fn] = afn 1130 self._fncache[fn] = afn
1131 d = os.path.dirname(afn) 1131 d = os.path.dirname(afn)
1132 if (d not in sys.path) and (d not in self.dircache): 1132 if (d not in sys.path) and (d not in self.dircache):
1133 self.dircache.append(d) 1133 self.dircache.append(d)
1134 return afn 1134 return afn
1135 1135
1137 for p in self.dircache: 1137 for p in self.dircache:
1138 afn = os.path.abspath(os.path.join(p, fn)) 1138 afn = os.path.abspath(os.path.join(p, fn))
1139 nafn = os.path.normcase(afn) 1139 nafn = os.path.normcase(afn)
1140 1140
1141 if os.path.exists(nafn): 1141 if os.path.exists(nafn):
1142 self.fncache[fn] = afn 1142 self._fncache[fn] = afn
1143 return afn 1143 return afn
1144 1144
1145 # Nothing found. 1145 # Nothing found.
1146 return fn 1146 return fn
1147 1147
1734 self.passive = 1 1734 self.passive = 1
1735 self.write("%s%s|%d\n" % (DebugProtocol.PassiveStartup, self.running, exceptions)) 1735 self.write("%s%s|%d\n" % (DebugProtocol.PassiveStartup, self.running, exceptions))
1736 self.__interact() 1736 self.__interact()
1737 1737
1738 # setup the debugger variables 1738 # setup the debugger variables
1739 self.fncache = {} 1739 self._fncache = {}
1740 self.dircache = [] 1740 self.dircache = []
1741 self.mainFrame = None 1741 self.mainFrame = None
1742 self.inRawMode = 0 1742 self.inRawMode = 0
1743 self.debugging = 1 1743 self.debugging = 1
1744 1744
1773 port = os.getenv('ERICPORT', 42424) 1773 port = os.getenv('ERICPORT', 42424)
1774 1774
1775 remoteAddress = self.__resolveHost(host) 1775 remoteAddress = self.__resolveHost(host)
1776 self.connectDebugger(port, remoteAddress, redirect) 1776 self.connectDebugger(port, remoteAddress, redirect)
1777 1777
1778 self.fncache = {} 1778 self._fncache = {}
1779 self.dircache = [] 1779 self.dircache = []
1780 sys.argv = progargs[:] 1780 sys.argv = progargs[:]
1781 sys.argv[0] = os.path.abspath(sys.argv[0]) 1781 sys.argv[0] = os.path.abspath(sys.argv[0])
1782 sys.path = self.__getSysPath(os.path.dirname(sys.argv[0])) 1782 sys.path = self.__getSysPath(os.path.dirname(sys.argv[0]))
1783 if wd == '': 1783 if wd == '':

eric ide

mercurial