From: <nr...@us...> - 2008-08-01 23:02:50
|
Revision: 5050 http://jython.svn.sourceforge.net/jython/?rev=5050&view=rev Author: nriley Date: 2008-08-01 23:02:47 +0000 (Fri, 01 Aug 2008) Log Message: ----------- JYTHONPATH support. Modified Paths: -------------- branches/asm/src/org/python/core/PySystemState.java branches/asm/src/org/python/util/jython.java Modified: branches/asm/src/org/python/core/PySystemState.java =================================================================== --- branches/asm/src/org/python/core/PySystemState.java 2008-08-01 22:38:32 UTC (rev 5049) +++ branches/asm/src/org/python/core/PySystemState.java 2008-08-01 23:02:47 UTC (rev 5050) @@ -440,13 +440,14 @@ } catch (Exception exc) { } } + try { + String jythonpath = System.getenv("JYTHONPATH"); + if (jythonpath != null) + registry.setProperty("python.path", jythonpath); + } catch (SecurityException e) { + } if (postProperties != null) { - for (Enumeration e=postProperties.keys(); e.hasMoreElements();) - { - String key = (String)e.nextElement(); - String value = (String)postProperties.get(key); - registry.put(key, value); - } + registry.putAll(postProperties); } if (standalone) { // set default standalone property (if not yet set) Modified: branches/asm/src/org/python/util/jython.java =================================================================== --- branches/asm/src/org/python/util/jython.java 2008-08-01 22:38:32 UTC (rev 5049) +++ branches/asm/src/org/python/util/jython.java 2008-08-01 23:02:47 UTC (rev 5050) @@ -54,7 +54,10 @@ //"-x : skip first line of source, allowing use of non-Unix forms of #!cmd\n" + "file : program read from script file\n" + "- : program read from stdin (default; interactive mode if a tty)\n" + - "arg ... : arguments passed to program in sys.argv[1:]"; + "arg ... : arguments passed to program in sys.argv[1:]\n" + + "Other environment variables:\n" + + "JYTHONPATH: '" + java.io.File.pathSeparator + "'-separated list of directories prefixed to the default module\n" + + " search path. The result is sys.path."; public static void runJar(String filename) { // TBD: this is kind of gross because a local called `zipfile' just This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |