Sun, 17 Jan 2010 15:23:00 +0000
Added code to use the PYTHONPATH environment setting in the debuggers.
--- a/DebugClients/Python/DebugClientBase.py Sun Jan 17 13:41:01 2010 +0000 +++ b/DebugClients/Python/DebugClientBase.py Sun Jan 17 15:23:00 2010 +0000 @@ -474,8 +474,7 @@ pass sys.argv.append(fn) sys.argv.extend(eval(args)) - sys.path[0] = os.path.dirname(sys.argv[0]) - sys.path.insert(0, '') + sys.path = self.__getSysPath(os.path.dirname(sys.argv[0])) if wd == '': os.chdir(sys.path[1]) else: @@ -520,8 +519,7 @@ pass sys.argv.append(fn) sys.argv.extend(eval(args)) - sys.path[0] = os.path.dirname(sys.argv[0]) - sys.path.insert(0, '') + sys.path = self.__getSysPath(os.path.dirname(sys.argv[0])) if wd == '': os.chdir(sys.path[1]) else: @@ -558,8 +556,7 @@ pass sys.argv.append(fn) sys.argv.extend(eval(args)) - sys.path[0] = os.path.dirname(sys.argv[0]) - sys.path.insert(0, '') + sys.path = self.__getSysPath(os.path.dirname(sys.argv[0])) if wd == '': os.chdir(sys.path[1]) else: @@ -597,8 +594,7 @@ pass sys.argv.append(fn) sys.argv.extend(eval(args)) - sys.path[0] = os.path.dirname(sys.argv[0]) - sys.path.insert(0, '') + sys.path = self.__getSysPath(os.path.dirname(sys.argv[0])) if wd == '': os.chdir(sys.path[1]) else: @@ -1763,8 +1759,7 @@ self.dircache = [] sys.argv = progargs[:] sys.argv[0] = os.path.abspath(sys.argv[0]) - sys.path[0] = os.path.dirname(sys.argv[0]) - sys.path.insert(0, '') + sys.path = self.__getSysPath(os.path.dirname(sys.argv[0])) if wd == '': os.chdir(sys.path[1]) else: @@ -1960,3 +1955,19 @@ return DebugClientOrigClose(fd) + + def __getSysPath(self, firstEntry): + """ + Private slot to calculate a path list including the PYTHONPATH + environment variable. + + @param firstEntry entry to be put first in sys.path (string) + @return path list for use as sys.path (list of strings) + """ + sysPath = [path for path in os.environ.get("PYTHONPATH", "").split(os.pathsep) + if path not in sys.path] + sys.path[:] + if "" in sysPath: + sysPath.remove("") + sysPath.insert(0, firstEntry) + sysPath.insert(0, '') + return sysPath
--- a/DebugClients/Python3/DebugClientBase.py Sun Jan 17 13:41:01 2010 +0000 +++ b/DebugClients/Python3/DebugClientBase.py Sun Jan 17 15:23:00 2010 +0000 @@ -461,8 +461,7 @@ pass sys.argv.append(fn) sys.argv.extend(eval(args.replace("u'", "'"))) - sys.path[0] = os.path.dirname(sys.argv[0]) - sys.path.insert(0, '') + sys.path = self.__getSysPath(os.path.dirname(sys.argv[0])) if wd == '': os.chdir(sys.path[1]) else: @@ -508,8 +507,7 @@ pass sys.argv.append(fn) sys.argv.extend(eval(args.replace("u'", "'"))) - sys.path[0] = os.path.dirname(sys.argv[0]) - sys.path.insert(0, '') + sys.path = self.__getSysPath(os.path.dirname(sys.argv[0])) if wd == '': os.chdir(sys.path[1]) else: @@ -547,8 +545,7 @@ pass sys.argv.append(fn) sys.argv.extend(eval(args.replace("u'", "'"))) - sys.path[0] = os.path.dirname(sys.argv[0]) - sys.path.insert(0, '') + sys.path = self.__getSysPath(os.path.dirname(sys.argv[0])) if wd == '': os.chdir(sys.path[1]) else: @@ -587,8 +584,7 @@ pass sys.argv.append(fn) sys.argv.extend(eval(args.replace("u'", "'"))) - sys.path[0] = os.path.dirname(sys.argv[0]) - sys.path.insert(0, '') + sys.path = self.__getSysPath(os.path.dirname(sys.argv[0])) if wd == '': os.chdir(sys.path[1]) else: @@ -1783,8 +1779,7 @@ self.dircache = [] sys.argv = progargs[:] sys.argv[0] = os.path.abspath(sys.argv[0]) - sys.path[0] = os.path.dirname(sys.argv[0]) - sys.path.insert(0, '') + sys.path = self.__getSysPath(os.path.dirname(sys.argv[0])) if wd == '': os.chdir(sys.path[1]) else: @@ -1981,3 +1976,19 @@ return DebugClientOrigClose(fd) + + def __getSysPath(self, firstEntry): + """ + Private slot to calculate a path list including the PYTHONPATH + environment variable. + + @param firstEntry entry to be put first in sys.path (string) + @return path list for use as sys.path (list of strings) + """ + sysPath = [path for path in os.environ.get("PYTHONPATH", "").split(os.pathsep) + if path not in sys.path] + sys.path[:] + if "" in sysPath: + sysPath.remove("") + sysPath.insert(0, firstEntry) + sysPath.insert(0, '') + return sysPath
--- a/Documentation/Help/source.qhp Sun Jan 17 13:41:01 2010 +0000 +++ b/Documentation/Help/source.qhp Sun Jan 17 15:23:00 2010 +0000 @@ -6121,6 +6121,7 @@ <keyword name="DebugClientBase.__formatQt4Variable" id="DebugClientBase.__formatQt4Variable" ref="eric5.DebugClients.Python.DebugClientBase.html#DebugClientBase.__formatQt4Variable" /> <keyword name="DebugClientBase.__formatVariablesList" id="DebugClientBase.__formatVariablesList" ref="eric5.DebugClients.Python.DebugClientBase.html#DebugClientBase.__formatVariablesList" /> <keyword name="DebugClientBase.__generateFilterObjects" id="DebugClientBase.__generateFilterObjects" ref="eric5.DebugClients.Python.DebugClientBase.html#DebugClientBase.__generateFilterObjects" /> + <keyword name="DebugClientBase.__getSysPath" id="DebugClientBase.__getSysPath" ref="eric5.DebugClients.Python.DebugClientBase.html#DebugClientBase.__getSysPath" /> <keyword name="DebugClientBase.__interact" id="DebugClientBase.__interact" ref="eric5.DebugClients.Python.DebugClientBase.html#DebugClientBase.__interact" /> <keyword name="DebugClientBase.__resolveHost" id="DebugClientBase.__resolveHost" ref="eric5.DebugClients.Python.DebugClientBase.html#DebugClientBase.__resolveHost" /> <keyword name="DebugClientBase.__setCoding" id="DebugClientBase.__setCoding" ref="eric5.DebugClients.Python.DebugClientBase.html#DebugClientBase.__setCoding" /> @@ -6288,6 +6289,7 @@ <keyword name="DebugClientBase.__formatQt4Variable" id="DebugClientBase.__formatQt4Variable" ref="eric5.DebugClients.Python3.DebugClientBase.html#DebugClientBase.__formatQt4Variable" /> <keyword name="DebugClientBase.__formatVariablesList" id="DebugClientBase.__formatVariablesList" ref="eric5.DebugClients.Python3.DebugClientBase.html#DebugClientBase.__formatVariablesList" /> <keyword name="DebugClientBase.__generateFilterObjects" id="DebugClientBase.__generateFilterObjects" ref="eric5.DebugClients.Python3.DebugClientBase.html#DebugClientBase.__generateFilterObjects" /> + <keyword name="DebugClientBase.__getSysPath" id="DebugClientBase.__getSysPath" ref="eric5.DebugClients.Python3.DebugClientBase.html#DebugClientBase.__getSysPath" /> <keyword name="DebugClientBase.__interact" id="DebugClientBase.__interact" ref="eric5.DebugClients.Python3.DebugClientBase.html#DebugClientBase.__interact" /> <keyword name="DebugClientBase.__resolveHost" id="DebugClientBase.__resolveHost" ref="eric5.DebugClients.Python3.DebugClientBase.html#DebugClientBase.__resolveHost" /> <keyword name="DebugClientBase.__setCoding" id="DebugClientBase.__setCoding" ref="eric5.DebugClients.Python3.DebugClientBase.html#DebugClientBase.__setCoding" />
--- a/Documentation/Source/eric5.DebugClients.Python.DebugClientBase.html Sun Jan 17 13:41:01 2010 +0000 +++ b/Documentation/Source/eric5.DebugClients.Python.DebugClientBase.html Sun Jan 17 15:23:00 2010 +0000 @@ -130,6 +130,9 @@ <td><a href="#DebugClientBase.__generateFilterObjects">__generateFilterObjects</a></td> <td>Private slot to convert a filter string to a list of filter objects.</td> </tr><tr> +<td><a href="#DebugClientBase.__getSysPath">__getSysPath</a></td> +<td>Private slot to calculate a path list including the PYTHONPATH environment variable.</td> +</tr><tr> <td><a href="#DebugClientBase.__interact">__interact</a></td> <td>Private method to Interact with the debugger.</td> </tr><tr> @@ -350,6 +353,22 @@ <dd> string of filter patterns separated by ';' </dd> +</dl><a NAME="DebugClientBase.__getSysPath" ID="DebugClientBase.__getSysPath"></a> +<h4>DebugClientBase.__getSysPath</h4> +<b>__getSysPath</b>(<i>firstEntry</i>) +<p> + Private slot to calculate a path list including the PYTHONPATH + environment variable. +</p><dl> +<dt><i>firstEntry</i></dt> +<dd> +entry to be put first in sys.path (string) +</dd> +</dl><dl> +<dt>Returns:</dt> +<dd> +path list for use as sys.path (list of strings) +</dd> </dl><a NAME="DebugClientBase.__interact" ID="DebugClientBase.__interact"></a> <h4>DebugClientBase.__interact</h4> <b>__interact</b>(<i></i>)
--- a/Documentation/Source/eric5.DebugClients.Python3.DebugClientBase.html Sun Jan 17 13:41:01 2010 +0000 +++ b/Documentation/Source/eric5.DebugClients.Python3.DebugClientBase.html Sun Jan 17 15:23:00 2010 +0000 @@ -130,6 +130,9 @@ <td><a href="#DebugClientBase.__generateFilterObjects">__generateFilterObjects</a></td> <td>Private slot to convert a filter string to a list of filter objects.</td> </tr><tr> +<td><a href="#DebugClientBase.__getSysPath">__getSysPath</a></td> +<td>Private slot to calculate a path list including the PYTHONPATH environment variable.</td> +</tr><tr> <td><a href="#DebugClientBase.__interact">__interact</a></td> <td>Private method to Interact with the debugger.</td> </tr><tr> @@ -365,6 +368,22 @@ <dd> string of filter patterns separated by ';' </dd> +</dl><a NAME="DebugClientBase.__getSysPath" ID="DebugClientBase.__getSysPath"></a> +<h4>DebugClientBase.__getSysPath</h4> +<b>__getSysPath</b>(<i>firstEntry</i>) +<p> + Private slot to calculate a path list including the PYTHONPATH + environment variable. +</p><dl> +<dt><i>firstEntry</i></dt> +<dd> +entry to be put first in sys.path (string) +</dd> +</dl><dl> +<dt>Returns:</dt> +<dd> +path list for use as sys.path (list of strings) +</dd> </dl><a NAME="DebugClientBase.__interact" ID="DebugClientBase.__interact"></a> <h4>DebugClientBase.__interact</h4> <b>__interact</b>(<i></i>)
--- a/changelog Sun Jan 17 13:41:01 2010 +0000 +++ b/changelog Sun Jan 17 15:23:00 2010 +0000 @@ -1,5 +1,9 @@ Change Log ---------- +Version 5.0-snapshot-2010mmdd: +- bug fixes +- added code to use the PYTHONPATH environment setting in the debuggers + Version 5.0-snapshot-20100116: - first snapshot of eric5