[Pydev-cvs] org.python.pydev.debug/src/org/python/pydev/debug/ui/launching PythonRunner.java, 1.34
Brought to you by:
fabioz
From: Fabio Z. <fa...@us...> - 2008-04-28 23:04:45
|
Update of /cvsroot/pydev/org.python.pydev.debug/src/org/python/pydev/debug/ui/launching In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8086/src/org/python/pydev/debug/ui/launching Modified Files: PythonRunner.java Log Message: Encoding passed with environment variable bug: http://sourceforge.net/tracker/index.php?func=detail&aid=1950217&group_id=85796&atid=577329 Index: PythonRunner.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev.debug/src/org/python/pydev/debug/ui/launching/PythonRunner.java,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** PythonRunner.java 9 Apr 2008 01:38:59 -0000 1.34 --- PythonRunner.java 28 Apr 2008 23:03:16 -0000 1.35 *************** *** 24,28 **** import org.python.copiedfromeclipsesrc.JDTNotAvailableException; import org.python.pydev.core.IInterpreterManager; - import org.python.pydev.core.REF; import org.python.pydev.core.docutils.StringUtils; import org.python.pydev.debug.core.Constants; --- 24,27 ---- *************** *** 211,215 **** */ private static Process createProcess(ILaunch launch, String[] envp, String[] cmdLine, File workingDirectory) throws CoreException { ! createEncodingFileForLaunch(launch); Process p = DebugPlugin.exec(cmdLine, workingDirectory, envp); return p; --- 210,220 ---- */ private static Process createProcess(ILaunch launch, String[] envp, String[] cmdLine, File workingDirectory) throws CoreException { ! String encoding = launch.getAttribute(DebugPlugin.ATTR_CONSOLE_ENCODING); ! if(encoding != null && encoding.trim().length() > 0){ ! String[] s = new String[envp.length+1]; ! System.arraycopy(envp, 0, s, 0, envp.length); ! s[s.length-1] = "PYDEV_CONSOLE_ENCODING="+encoding; ! envp = s; ! } Process p = DebugPlugin.exec(cmdLine, workingDirectory, envp); return p; *************** *** 244,272 **** * It'll then display the appropriate UI. */ ! private static IProcess registerWithDebugPluginForProcessType(String label, ILaunch launch, Process p, Map<Object, Object> processAttributes, String processType) { processAttributes.put(IProcess.ATTR_PROCESS_TYPE, processType); processAttributes.put(IProcess.ATTR_PROCESS_LABEL, label); processAttributes.put(DebugPlugin.ATTR_CAPTURE_OUTPUT, "true"); - createEncodingFileForLaunch(launch); return DebugPlugin.newProcess(launch,p, label, processAttributes); } - /** - * Creates a file the specification of the console encoding to be used by the pydev sitecustomize. - * - * @param launch the launch to which the encoding shoud be created. - */ - public static void createEncodingFileForLaunch(ILaunch launch) { - String encoding = launch.getAttribute(DebugPlugin.ATTR_CONSOLE_ENCODING); - if(encoding != null && encoding.trim().length() > 0){ - try { - File file = PydevPlugin.getScriptWithinPySrc("pydev_sitecustomize"); - file = new File(file, "encoding_config"); - REF.writeStrToFile(encoding.trim(), file); - } catch (Throwable e) { - PydevPlugin.log(e); - } - } - } } --- 249,260 ---- * It'll then display the appropriate UI. */ ! private static IProcess registerWithDebugPluginForProcessType(String label, ILaunch launch, Process p, ! Map<Object, Object> processAttributes, String processType) { processAttributes.put(IProcess.ATTR_PROCESS_TYPE, processType); processAttributes.put(IProcess.ATTR_PROCESS_LABEL, label); processAttributes.put(DebugPlugin.ATTR_CAPTURE_OUTPUT, "true"); return DebugPlugin.newProcess(launch,p, label, processAttributes); } } |