You can subscribe to this list here.
2000 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
(107) |
Dec
(67) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2001 |
Jan
(76) |
Feb
(125) |
Mar
(72) |
Apr
(13) |
May
(18) |
Jun
(12) |
Jul
(129) |
Aug
(47) |
Sep
(1) |
Oct
(36) |
Nov
(128) |
Dec
(124) |
2002 |
Jan
(59) |
Feb
|
Mar
(14) |
Apr
(14) |
May
(72) |
Jun
(9) |
Jul
(3) |
Aug
(5) |
Sep
(18) |
Oct
(65) |
Nov
(28) |
Dec
(12) |
2003 |
Jan
(10) |
Feb
(2) |
Mar
(4) |
Apr
(33) |
May
(21) |
Jun
(9) |
Jul
(29) |
Aug
(34) |
Sep
(4) |
Oct
(8) |
Nov
(15) |
Dec
(4) |
2004 |
Jan
(26) |
Feb
(12) |
Mar
(11) |
Apr
(9) |
May
(7) |
Jun
|
Jul
(5) |
Aug
|
Sep
(3) |
Oct
(7) |
Nov
(1) |
Dec
(10) |
2005 |
Jan
(2) |
Feb
(72) |
Mar
(16) |
Apr
(39) |
May
(48) |
Jun
(97) |
Jul
(57) |
Aug
(13) |
Sep
(16) |
Oct
(24) |
Nov
(100) |
Dec
(24) |
2006 |
Jan
(15) |
Feb
(34) |
Mar
(33) |
Apr
(31) |
May
(79) |
Jun
(64) |
Jul
(41) |
Aug
(64) |
Sep
(31) |
Oct
(46) |
Nov
(55) |
Dec
(37) |
2007 |
Jan
(32) |
Feb
(61) |
Mar
(11) |
Apr
(58) |
May
(46) |
Jun
(30) |
Jul
(94) |
Aug
(93) |
Sep
(86) |
Oct
(69) |
Nov
(125) |
Dec
(177) |
2008 |
Jan
(169) |
Feb
(97) |
Mar
(74) |
Apr
(113) |
May
(120) |
Jun
(334) |
Jul
(215) |
Aug
(237) |
Sep
(72) |
Oct
(189) |
Nov
(126) |
Dec
(160) |
2009 |
Jan
(180) |
Feb
(45) |
Mar
(98) |
Apr
(140) |
May
(151) |
Jun
(71) |
Jul
(107) |
Aug
(119) |
Sep
(73) |
Oct
(121) |
Nov
(14) |
Dec
(6) |
2010 |
Jan
(13) |
Feb
(9) |
Mar
(10) |
Apr
(64) |
May
(3) |
Jun
(16) |
Jul
(7) |
Aug
(23) |
Sep
(17) |
Oct
(37) |
Nov
(5) |
Dec
(8) |
2011 |
Jan
(10) |
Feb
(11) |
Mar
(77) |
Apr
(11) |
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <fwi...@us...> - 2009-07-17 15:47:50
|
Revision: 6542 http://jython.svn.sourceforge.net/jython/?rev=6542&view=rev Author: fwierzbicki Date: 2009-07-17 15:47:45 +0000 (Fri, 17 Jul 2009) Log Message: ----------- Really call into Jython with invokedynamic -- based on Nicholas Riley's github code InvokeDynamicModuleSample.java from git://github.com/nriley/jython.git. Modified Paths: -------------- branches/indy/src/org/python/compiler/IndyTest.java Modified: branches/indy/src/org/python/compiler/IndyTest.java =================================================================== --- branches/indy/src/org/python/compiler/IndyTest.java 2009-07-17 05:27:51 UTC (rev 6541) +++ branches/indy/src/org/python/compiler/IndyTest.java 2009-07-17 15:47:45 UTC (rev 6542) @@ -4,24 +4,49 @@ import java.dyn.InvokeDynamic; import java.dyn.Linkage; import java.dyn.MethodType; +import java.dyn.MethodHandle; import java.dyn.MethodHandles; import java.dyn.MethodType; import org.python.core.Py; +import org.python.core.PyCode; +import org.python.core.PyFunction; +import org.python.core.PyInteger; +import org.python.core.PyObject; import org.python.core.PyString; +import org.python.core.PyTuple; +import org.python.core.ThreadState; public class IndyTest { public static void run() { - PyString result = InvokeDynamic.<PyString>sayHello("Hello Indy!"); - System.out.println(result); + ThreadState ts = Py.getThreadState(); + System.out.println("foo = " + ts.frame.getname("foo")); + PyObject result = InvokeDynamic.<PyObject>foo(ts, new PyInteger(4), Py.None, + Py.EmptyObjects, new PyTuple()); + System.out.println("result = " + result); } static { Linkage.registerBootstrapMethod("linkDynamic"); } private static CallSite linkDynamic(Class<?> caller, String name, MethodType type) { - CallSite c = new CallSite(caller, name, type); - c.setTarget(MethodHandles.lookup().findStatic(Py.class, "newString", - MethodType.make(PyString.class, String.class))); - return c; + System.out.println("linkDynamic..."); + CallSite site = new CallSite(caller, name, type); + ThreadState ts = Py.getThreadState(); + PyCode func_code = ((PyFunction)ts.frame.getname(name)).func_code; + + MethodType oneArgCall = MethodType.make( + PyObject.class, //return type + ThreadState.class, // state + PyObject.class, // arg1 + PyObject.class, // globals + PyObject[].class, // defaults + PyObject.class // closure + ); + MethodHandle call = MethodHandles.lookup().findVirtual(PyCode.class, "call", oneArgCall); + call = MethodHandles.insertArguments(call, 0, func_code); + call = MethodHandles.convertArguments(call, type); + site.setTarget(call); + + return site; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nr...@us...> - 2009-07-17 05:27:55
|
Revision: 6541 http://jython.svn.sourceforge.net/jython/?rev=6541&view=rev Author: nriley Date: 2009-07-17 05:27:51 +0000 (Fri, 17 Jul 2009) Log Message: ----------- JSR 223 support for compile and eval of Strings. Modified Paths: -------------- branches/jsr223/build.xml branches/jsr223/src/org/python/core/Py.java branches/jsr223/src/org/python/core/PyFinalizableInstance.java branches/jsr223/src/org/python/jsr223/PyScriptEngine.java branches/jsr223/src/org/python/util/PythonInterpreter.java Added Paths: ----------- branches/jsr223/src/META-INF/ branches/jsr223/src/META-INF/services/ branches/jsr223/src/META-INF/services/javax.script.ScriptEngineFactory branches/jsr223/tests/java/org/python/jsr223/ branches/jsr223/tests/java/org/python/jsr223/ScriptEngineTest.java Modified: branches/jsr223/build.xml =================================================================== --- branches/jsr223/build.xml 2009-07-17 04:28:55 UTC (rev 6540) +++ branches/jsr223/build.xml 2009-07-17 05:27:51 UTC (rev 6541) @@ -503,6 +503,10 @@ </copy> <!-- grammar must now be up to date --> <property name="antlr.notneeded" value="true" /> + + <copy todir="${compile.dir}/META-INF/services"> + <fileset dir="${source.dir}/META-INF/services" /> + </copy> </target> <!-- Added: branches/jsr223/src/META-INF/services/javax.script.ScriptEngineFactory =================================================================== --- branches/jsr223/src/META-INF/services/javax.script.ScriptEngineFactory (rev 0) +++ branches/jsr223/src/META-INF/services/javax.script.ScriptEngineFactory 2009-07-17 05:27:51 UTC (rev 6541) @@ -0,0 +1 @@ +org.python.jsr223.PyScriptEngineFactory Modified: branches/jsr223/src/org/python/core/Py.java =================================================================== --- branches/jsr223/src/org/python/core/Py.java 2009-07-17 04:28:55 UTC (rev 6540) +++ branches/jsr223/src/org/python/core/Py.java 2009-07-17 05:27:51 UTC (rev 6541) @@ -1021,7 +1021,7 @@ stderr.println(getStackTrace((Throwable) javaError)); } } - stderr.println(formatException(type, value, tb)); + stderr.println(formatException(type, value)); } /** @@ -1074,7 +1074,7 @@ out.print("^\n"); } - static String formatException(PyObject type, PyObject value, PyObject tb) { + public static String formatException(PyObject type, PyObject value) { StringBuilder buf = new StringBuilder(); if (PyException.isExceptionClass(type)) { @@ -1100,7 +1100,7 @@ } else { buf.append(type.__str__()); } - if (value != Py.None) { + if (value != null && value != Py.None) { // only print colon if the str() of the object is not the empty string PyObject s = value.__str__(); if (!(s instanceof PyString) || s.__len__() != 0) { Modified: branches/jsr223/src/org/python/core/PyFinalizableInstance.java =================================================================== --- branches/jsr223/src/org/python/core/PyFinalizableInstance.java 2009-07-17 04:28:55 UTC (rev 6540) +++ branches/jsr223/src/org/python/core/PyFinalizableInstance.java 2009-07-17 05:27:51 UTC (rev 6541) @@ -31,7 +31,7 @@ } catch (PyException e) { ; } Py.stderr.println("Exception " + - Py.formatException(exc.type, exc.value, exc.traceback) + + Py.formatException(exc.type, exc.value) + " in " + method + " ignored"); } Modified: branches/jsr223/src/org/python/jsr223/PyScriptEngine.java =================================================================== --- branches/jsr223/src/org/python/jsr223/PyScriptEngine.java 2009-07-17 04:28:55 UTC (rev 6540) +++ branches/jsr223/src/org/python/jsr223/PyScriptEngine.java 2009-07-17 05:27:51 UTC (rev 6541) @@ -1,5 +1,6 @@ package org.python.jsr223; +import org.python.core.*; import java.io.Reader; import javax.script.AbstractScriptEngine; import javax.script.Bindings; @@ -10,9 +11,6 @@ import javax.script.ScriptEngine; import javax.script.ScriptEngineFactory; import javax.script.ScriptException; -import org.python.core.Py; -import org.python.core.PyException; -import org.python.core.PyObject; import org.python.util.PythonInterpreter; public class PyScriptEngine extends AbstractScriptEngine implements Compilable, Invocable { @@ -26,9 +24,17 @@ } public Object eval(String script, ScriptContext context) throws ScriptException { - throw new UnsupportedOperationException("Not supported yet."); + return eval(compileScript(script, context)); } + private Object eval(PyCode code) throws ScriptException { + try { + return interp.eval(code).__tojava__(Object.class); + } catch (PyException e) { + throw scriptException(e); + } + } + // it would be nice if we supported a Reader interface in Py.compileFlags, instead of having // to create a string here public Object eval(Reader reader, ScriptContext context) throws ScriptException { @@ -43,15 +49,26 @@ return factory; } - // i assume this should simply return a PyModule object or something public CompiledScript compile(String script) throws ScriptException { - throw new UnsupportedOperationException("Not supported yet."); + return new PyCompiledScript(compileScript(script, context)); } public CompiledScript compile(Reader script) throws ScriptException { throw new UnsupportedOperationException("Not supported yet."); } + private PyCode compileScript(String script, ScriptContext context) throws ScriptException { + try { + String filename = (String) context.getAttribute(ScriptEngine.FILENAME); + if (filename == null) + return interp.compileExpressionOrModule(script); + else + return interp.compileExpressionOrModule(script, filename); + } catch (PyException e) { + throw scriptException(e); + } + } + public Object invokeMethod(Object thiz, String name, Object... args) throws ScriptException, NoSuchMethodException { try { if (thiz instanceof PyObject) { @@ -85,6 +102,48 @@ throw new UnsupportedOperationException("Not supported yet."); } + private static ScriptException scriptException(PyException e) { + ScriptException se = null; + try { + e.normalize(); + + PyObject type = e.type; + PyObject value = e.value; + PyTraceback tb = e.traceback; + + if (__builtin__.isinstance(value, Py.SyntaxError)) { + PyObject filename = value.__findattr__("filename"); + PyObject lineno = value.__findattr__("lineno"); + PyObject offset = value.__findattr__("offset"); + value = value.__findattr__("msg"); + + se = new ScriptException( + Py.formatException(type, value), + filename == null ? "<script>" : filename.toString(), + lineno == null ? 0 : lineno.asInt(), + offset == null ? 0 : offset.asInt()); + } else if (tb != null) { + String filename; + if (tb.tb_frame == null || tb.tb_frame.f_code == null) + filename = null; + else + filename = tb.tb_frame.f_code.co_filename; + + se = new ScriptException( + Py.formatException(type, value), + filename, + tb.tb_lineno); + } else { + se = new ScriptException(Py.formatException(type, value)); + } + se.initCause(e); + return se; + } catch (Exception ee) { + se = new ScriptException(e); + } + return se; + } + private static PyObject[] java2py(Object[] args) { PyObject wrapped[] = new PyObject[args.length]; for (int i = 0; i < args.length; i++) { @@ -93,18 +152,20 @@ return wrapped; } - // wraps a PyCode object - private static class PyCompiledScript extends CompiledScript { + private class PyCompiledScript extends CompiledScript { + private PyCode code; - @Override - public Object eval(ScriptContext arg0) throws ScriptException { - throw new UnsupportedOperationException("Not supported yet."); + PyCompiledScript(PyCode code) { + this.code = code; } - @Override public ScriptEngine getEngine() { - throw new UnsupportedOperationException("Not supported yet."); + return PyScriptEngine.this; } + public Object eval(ScriptContext ctx) throws ScriptException { + // can't read filename from context at this point + return PyScriptEngine.this.eval(code); + } } } Modified: branches/jsr223/src/org/python/util/PythonInterpreter.java =================================================================== --- branches/jsr223/src/org/python/util/PythonInterpreter.java 2009-07-17 04:28:55 UTC (rev 6540) +++ branches/jsr223/src/org/python/util/PythonInterpreter.java 2009-07-17 05:27:51 UTC (rev 6541) @@ -2,8 +2,10 @@ import java.util.Properties; +import org.python.antlr.base.mod; import org.python.core.CompileMode; import org.python.core.CompilerFlags; +import org.python.core.ParserFacade; import org.python.core.Py; import org.python.core.PyCode; import org.python.core.PyException; @@ -13,6 +15,7 @@ import org.python.core.PyObject; import org.python.core.PyString; import org.python.core.PyStringMap; +import org.python.core.PySyntaxError; import org.python.core.PySystemState; import org.python.core.__builtin__; @@ -130,6 +133,14 @@ } /** + * Evaluate a Python code object and return the result + */ + public PyObject eval(PyObject code) { + setState(); + return __builtin__.eval(code, locals, locals); + } + + /** * Execute a string of Python source in the local namespace */ public void exec(String s) { @@ -166,6 +177,34 @@ Py.flushLine(); } + /** + * Compile a string of Python source as either an expression (if possible) or module. + * + * Designed for use by a JSR 223 implementation: "the Scripting API does not distinguish + * between scripts which return values and those which do not, nor do they make the + * corresponding distinction between evaluating or executing objects." (SCR.4.2.1) + */ + public PyCode compileExpressionOrModule(String script) { + return compileExpressionOrModule(script, "<script>"); + } + + public PyCode compileExpressionOrModule(String script, String filename) { + mod node; + try { + // first, try parsing as an expression + node = ParserFacade.parse(script, CompileMode.eval, filename, cflags); + } catch (PySyntaxError e) { + try { + // then, try parsing as a module + node = ParserFacade.parse(script, CompileMode.exec, filename, cflags); + } catch (PySyntaxError ee) { + throw ee; + } + } + return Py.compile_flags(node, filename, CompileMode.eval, cflags); + } + + public PyObject getLocals() { return locals; } Added: branches/jsr223/tests/java/org/python/jsr223/ScriptEngineTest.java =================================================================== --- branches/jsr223/tests/java/org/python/jsr223/ScriptEngineTest.java (rev 0) +++ branches/jsr223/tests/java/org/python/jsr223/ScriptEngineTest.java 2009-07-17 05:27:51 UTC (rev 6541) @@ -0,0 +1,58 @@ +package org.python.jsr223; + +import javax.script.Compilable; +import javax.script.CompiledScript; +import javax.script.ScriptContext; +import javax.script.ScriptEngine; +import javax.script.ScriptEngineManager; +import javax.script.ScriptException; +import javax.script.SimpleScriptContext; +import junit.framework.TestCase; + +public class ScriptEngineTest extends TestCase { + + public void testEvalString() throws ScriptException { + ScriptEngineManager manager = new ScriptEngineManager(); + ScriptEngine pythonEngine = manager.getEngineByName("python"); + + assertNull(pythonEngine.eval("x = 5")); + assertEquals(Integer.valueOf(5), pythonEngine.eval("x")); + } + + public void testSyntaxError() { + ScriptEngineManager manager = new ScriptEngineManager(); + ScriptEngine pythonEngine = manager.getEngineByName("python"); + + try { + pythonEngine.eval("5q"); + } catch (ScriptException e) { + assertEquals(e.getColumnNumber(), 1); + assertEquals(e.getLineNumber(), 1); + assertTrue(e.getMessage().startsWith("SyntaxError: ")); + return; + } + assertTrue("Expected a ScriptException", false); + } + + public void testScriptFilename() { + ScriptEngineManager manager = new ScriptEngineManager(); + ScriptEngine pythonEngine = manager.getEngineByName("python"); + SimpleScriptContext scriptContext = new SimpleScriptContext(); + scriptContext.setAttribute(ScriptEngine.FILENAME, "sample.py", ScriptContext.ENGINE_SCOPE); + try { + pythonEngine.eval("foo", scriptContext); + } catch (ScriptException e) { + assertEquals("sample.py", e.getFileName()); + return; + } + assertTrue("Expected a ScriptException", false); + } + + public void testCompileEvalString() throws ScriptException { + ScriptEngineManager manager = new ScriptEngineManager(); + ScriptEngine pythonEngine = manager.getEngineByName("python"); + + CompiledScript five = ((Compilable)pythonEngine).compile("5"); + assertEquals(Integer.valueOf(5), five.eval()); + } +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fwi...@us...> - 2009-07-17 04:28:58
|
Revision: 6540 http://jython.svn.sourceforge.net/jython/?rev=6540&view=rev Author: fwierzbicki Date: 2009-07-17 04:28:55 +0000 (Fri, 17 Jul 2009) Log Message: ----------- Simplest possible test of InvokeDynamic embedded in Jython. Used R?\195?\169mi Forax's 292 backport, just because I got it working before I got an MLVM patched JDK 7 working. Modified Paths: -------------- branches/indy/build.xml Added Paths: ----------- branches/indy/extlibs/asm-all-3.2.jar branches/indy/extlibs/jsr292-backport.jar branches/indy/extlibs/jsr292-mock.jar branches/indy/src/org/python/compiler/IndyTest.java Modified: branches/indy/build.xml =================================================================== --- branches/indy/build.xml 2009-07-15 20:05:51 UTC (rev 6539) +++ branches/indy/build.xml 2009-07-17 04:28:55 UTC (rev 6540) @@ -115,12 +115,11 @@ <target name="init" depends="version-init"> <property name="build.compiler" value="modern" /> - <property name="jdk.target.version" value="1.5" /> - <property name="jdk.source.version" value="1.5" /> + <property name="jdk.target.version" value="1.7" /> + <property name="jdk.source.version" value="1.7" /> <property name="deprecation" value="true" /> <property name="debug" value="true" /> <property name="nowarn" value="false" /> - <property name="javac.Xlint" value="-Xlint -Xlint:-serial -Xlint:-unchecked -Xlint:-cast"/> <!-- properties work.dir and jython.base.dir are also defined in full-preinit --> <property name="work.dir" value="${basedir}" /> @@ -141,7 +140,11 @@ <property name="dist.dir" value="${work.dir}/dist" /> <property name="apidoc.dir" value="${dist.dir}/Doc/javadoc" /> <property name="junit.reports" value="${dist.dir}/testreports" /> + <property name="javac.Xlint" value="-Xlint -Xlint:-serial -Xlint:-unchecked -Xlint:-cast -Xbootclasspath/p:${extlibs.dir}/jsr292-mock.jar"/> + <!-- + <property name="javac.Xlint" value="-Xlint -Xlint:-serial -XDinvokedynamic -Xlint:-unchecked -Xlint:-cast"/> + --> <!-- classpaths --> <path id="main.classpath"> <pathelement path="${extlibs.dir}/libreadline-java-0.8.jar" /> @@ -155,10 +158,10 @@ <pathelement path="${extlibs.dir}/antlr-3.1.3.jar" /> <pathelement path="${extlibs.dir}/stringtemplate-3.2.jar" /> - <pathelement path="${extlibs.dir}/asm-3.1.jar" /> - <pathelement path="${extlibs.dir}/asm-commons-3.1.jar" /> + <pathelement path="${extlibs.dir}/asm-all-3.2.jar" /> <pathelement path="${extlibs.dir}/constantine-0.4.jar" /> <pathelement path="${extlibs.dir}/jna-posix.jar"/> + <pathelement path="${extlibs.dir}/jsr292-mock.jar"/> </path> <available property="informix.present" classname="com.informix.jdbc.IfxDriver" classpath="${informix.jar}" /> @@ -166,7 +169,7 @@ <path id="test.classpath"> <path refid="main.classpath"/> - <pathelement path="${extlibs.dir}/asm-commons-3.1.jar" /> + <pathelement path="${extlibs.dir}/asm-all-3.2.jar" /> <pathelement path="${extlibs.dir}/junit-3.8.2.jar" /> <pathelement path="${exposed.dir}" /> <pathelement path="${compile.dir}" /> @@ -548,9 +551,7 @@ <zipfileset src="${dist.dir}/${jython.dev.jar}"/> <zipfileset src="extlibs/antlr-runtime-3.1.3.jar"/> <rule pattern="org.antlr.runtime.**" result="org.python.antlr.runtime.@1"/> - <zipfileset src="extlibs/asm-3.1.jar"/> - <zipfileset src="extlibs/asm-commons-3.1.jar"/> - <zipfileset src="extlibs/asm-util-3.1.jar"/> + <zipfileset src="extlibs/asm-all-3.2.jar"/> <rule pattern="org.objectweb.asm.**" result="org.python.objectweb.asm.@1"/> <zipfileset src="extlibs/jna.jar"/> <zipfileset src="extlibs/jna-posix.jar"/> Added: branches/indy/extlibs/asm-all-3.2.jar =================================================================== (Binary files differ) Property changes on: branches/indy/extlibs/asm-all-3.2.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: branches/indy/extlibs/jsr292-backport.jar =================================================================== (Binary files differ) Property changes on: branches/indy/extlibs/jsr292-backport.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: branches/indy/extlibs/jsr292-mock.jar =================================================================== (Binary files differ) Property changes on: branches/indy/extlibs/jsr292-mock.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: branches/indy/src/org/python/compiler/IndyTest.java =================================================================== --- branches/indy/src/org/python/compiler/IndyTest.java (rev 0) +++ branches/indy/src/org/python/compiler/IndyTest.java 2009-07-17 04:28:55 UTC (rev 6540) @@ -0,0 +1,27 @@ +package org.python.compiler; + +import java.dyn.CallSite; +import java.dyn.InvokeDynamic; +import java.dyn.Linkage; +import java.dyn.MethodType; +import java.dyn.MethodHandles; +import java.dyn.MethodType; + +import org.python.core.Py; +import org.python.core.PyString; + +public class IndyTest { + + public static void run() { + PyString result = InvokeDynamic.<PyString>sayHello("Hello Indy!"); + System.out.println(result); + } + + static { Linkage.registerBootstrapMethod("linkDynamic"); } + private static CallSite linkDynamic(Class<?> caller, String name, MethodType type) { + CallSite c = new CallSite(caller, name, type); + c.setTarget(MethodHandles.lookup().findStatic(Py.class, "newString", + MethodType.make(PyString.class, String.class))); + return c; + } +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <th...@us...> - 2009-07-15 20:05:58
|
Revision: 6539 http://jython.svn.sourceforge.net/jython/?rev=6539&view=rev Author: thobes Date: 2009-07-15 20:05:51 +0000 (Wed, 15 Jul 2009) Log Message: ----------- Changed the ContextManager interface to get the exception as one argument, this reduces the need fo object (re-) creation. This also reduces the overhead even more for the optimized context managers, since parts of the code that was previously generated in the compiled Python code is now part of the library in ContextGuard. Also fixed a bug in the code for turning generator functions into optimized context managers. Modified Paths: -------------- trunk/jython/src/org/python/compiler/CodeCompiler.java trunk/jython/src/org/python/core/ContextGuard.java trunk/jython/src/org/python/core/ContextManager.java trunk/jython/src/org/python/modules/_threading/Condition.java trunk/jython/src/org/python/modules/_threading/Lock.java Modified: trunk/jython/src/org/python/compiler/CodeCompiler.java =================================================================== --- trunk/jython/src/org/python/compiler/CodeCompiler.java 2009-07-15 02:34:53 UTC (rev 6538) +++ trunk/jython/src/org/python/compiler/CodeCompiler.java 2009-07-15 20:05:51 UTC (rev 6539) @@ -2278,7 +2278,7 @@ final Method contextGuard_getManager = Method.getMethod("org.python.core.ContextManager getManager (org.python.core.PyObject)"); final Method __enter__ = Method.getMethod("org.python.core.PyObject __enter__ (org.python.core.ThreadState)"); - final Method __exit__ = Method.getMethod("boolean __exit__ (org.python.core.ThreadState,org.python.core.PyObject,org.python.core.PyObject,org.python.core.PyObject)"); + final Method __exit__ = Method.getMethod("boolean __exit__ (org.python.core.ThreadState,org.python.core.PyException)"); // mgr = (EXPR) visit(node.getInternalContext_expr()); @@ -2313,9 +2313,7 @@ public void finalBody(CodeCompiler compiler) throws Exception { compiler.code.aload(mgr_tmp); loadThreadState(); - compiler.getNone(); - compiler.code.dup(); - compiler.code.dup(); + compiler.code.aconst_null(); compiler.code.invokeinterface(Type.getType(ContextManager.class).getInternalName(), __exit__.getName(), __exit__.getDescriptor()); compiler.code.pop(); } @@ -2355,25 +2353,15 @@ loadFrame(); code.invokestatic("org/python/core/Py", "setException", "(" + $throwable + $pyFrame + ")" + $pyExc); - code.pop(); + code.aload(mgr_tmp); + code.swap(); loadThreadState(); - code.getfield("org/python/core/ThreadState", "exception", $pyExc); - int ts_tmp = storeTop(); + code.swap(); + code.invokeinterface(Type.getType(ContextManager.class).getInternalName(), __exit__.getName(), __exit__.getDescriptor()); // # The exceptional case is handled here // exc = False # implicit // if not exit(*sys.exc_info()): - code.aload(mgr_tmp); - loadThreadState(); - code.aload(ts_tmp); - code.getfield("org/python/core/PyException", "type", $pyObj); - code.aload(ts_tmp); - code.getfield("org/python/core/PyException", "value", $pyObj); - code.aload(ts_tmp); - code.freeLocal(ts_tmp); - code.getfield("org/python/core/PyException", "traceback", "Lorg/python/core/PyTraceback;"); - code.checkcast("org/python/core/PyObject"); - code.invokeinterface(Type.getType(ContextManager.class).getInternalName(), __exit__.getName(), __exit__.getDescriptor()); code.ifne(label_end); // raise // # The exception is swallowed if exit() returns true Modified: trunk/jython/src/org/python/core/ContextGuard.java =================================================================== --- trunk/jython/src/org/python/core/ContextGuard.java 2009-07-15 02:34:53 UTC (rev 6538) +++ trunk/jython/src/org/python/core/ContextGuard.java 2009-07-15 20:05:51 UTC (rev 6539) @@ -17,9 +17,18 @@ return __enter__method.__call__(ts); } - public boolean __exit__(ThreadState ts, PyObject type, PyObject value, - PyObject traceback) { - return __exit__method.__call__(ts, type, value, traceback).__nonzero__(); + public boolean __exit__(ThreadState ts, PyException exception) { + final PyObject type, value, traceback; + if (exception != null) { + type = exception.type; + value = exception.value; + traceback = exception.traceback; + } else { + type = value = traceback = Py.None; + } + return __exit__method.__call__(ts, type, + value == null ? Py.None : value, + traceback == null ? Py.None : traceback).__nonzero__(); } public static ContextManager getManager(PyObject manager) { @@ -43,7 +52,7 @@ * finally: * print "done" */ - + public static PyObject makeManager(PyObject object) { if (object instanceof PyFunction) { PyFunction function = (PyFunction) object; @@ -125,19 +134,18 @@ return res; } - public boolean __exit__(ThreadState ts, PyObject type, PyObject value, - PyObject traceback) { - PyException ex = null; - if (type != null && type != Py.None) { - ex = Py.makeException(type, value, traceback); - frame.setGeneratorInput(ex); + public boolean __exit__(ThreadState ts, PyException exception) { + if (exception != null) { + frame.setGeneratorInput(exception); } - PyObject res = null; + final PyObject res; try { res = body(ts); } catch(PyException e) { - if (e == ex) { + if (e.equals(exception)) { return false; + } else { + throw e; } } if (frame.f_lasti != -1) { Modified: trunk/jython/src/org/python/core/ContextManager.java =================================================================== --- trunk/jython/src/org/python/core/ContextManager.java 2009-07-15 02:34:53 UTC (rev 6538) +++ trunk/jython/src/org/python/core/ContextManager.java 2009-07-15 20:05:51 UTC (rev 6539) @@ -7,5 +7,5 @@ public interface ContextManager { public PyObject __enter__(ThreadState ts); - public boolean __exit__(ThreadState ts, PyObject type, PyObject value, PyObject traceback); + public boolean __exit__(ThreadState ts, PyException exception); } Modified: trunk/jython/src/org/python/modules/_threading/Condition.java =================================================================== --- trunk/jython/src/org/python/modules/_threading/Condition.java 2009-07-15 02:34:53 UTC (rev 6538) +++ trunk/jython/src/org/python/modules/_threading/Condition.java 2009-07-15 20:05:51 UTC (rev 6539) @@ -2,6 +2,7 @@ import org.python.core.ContextManager; import org.python.core.Py; +import org.python.core.PyException; import org.python.core.PyNewWrapper; import org.python.core.PyObject; import org.python.core.PyType; @@ -65,7 +66,7 @@ _lock.release(); } - public boolean __exit__(ThreadState ts, PyObject type, PyObject value, PyObject traceback) { + public boolean __exit__(ThreadState ts, PyException exception) { _lock.release(); return false; } Modified: trunk/jython/src/org/python/modules/_threading/Lock.java =================================================================== --- trunk/jython/src/org/python/modules/_threading/Lock.java 2009-07-15 02:34:53 UTC (rev 6538) +++ trunk/jython/src/org/python/modules/_threading/Lock.java 2009-07-15 20:05:51 UTC (rev 6539) @@ -3,6 +3,7 @@ import java.util.concurrent.locks.ReentrantLock; import org.python.core.ContextManager; import org.python.core.Py; +import org.python.core.PyException; import org.python.core.PyNewWrapper; import org.python.core.PyObject; import org.python.core.PyType; @@ -76,7 +77,7 @@ return false; } - public boolean __exit__(ThreadState ts, PyObject type, PyObject value, PyObject traceback) { + public boolean __exit__(ThreadState ts, PyException exception) { _lock.unlock(); return false; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <th...@us...> - 2009-07-15 02:34:55
|
Revision: 6538 http://jython.svn.sourceforge.net/jython/?rev=6538&view=rev Author: thobes Date: 2009-07-15 02:34:53 +0000 (Wed, 15 Jul 2009) Log Message: ----------- Added a tentative implementation of an optimized call path for using generators as context managers (as contextlib.contextmanager does by wrapping generators). This implementation unwraps the code object and wraps it in context manager instead of wrapping the entire generator in a context manager. Modified Paths: -------------- trunk/jython/src/org/python/core/ContextGuard.java Modified: trunk/jython/src/org/python/core/ContextGuard.java =================================================================== --- trunk/jython/src/org/python/core/ContextGuard.java 2009-07-15 02:31:42 UTC (rev 6537) +++ trunk/jython/src/org/python/core/ContextGuard.java 2009-07-15 02:34:53 UTC (rev 6538) @@ -1,10 +1,8 @@ package org.python.core; -/** Straightens the call path for some common cases +/** + * Straightens the call path for some common cases */ - -// XXX - add support for generators in conjunction w/ contextlib.contextmanager - public class ContextGuard implements ContextManager { private final PyObject __enter__method; @@ -19,7 +17,8 @@ return __enter__method.__call__(ts); } - public boolean __exit__(ThreadState ts, PyObject type, PyObject value, PyObject traceback) { + public boolean __exit__(ThreadState ts, PyObject type, PyObject value, + PyObject traceback) { return __exit__method.__call__(ts, type, value, traceback).__nonzero__(); } @@ -30,4 +29,123 @@ return new ContextGuard(manager); } } + + // XXX - tentative support for generators in conjunction w/ contextlib.contextmanager + + /* Sample usage: + * + * from org.python.core.ContextGuard import makeManager as contextmanager + * @contextmanager + * def my_manager(): + * print "setup" + * try: + * yield + * finally: + * print "done" + */ + + public static PyObject makeManager(PyObject object) { + if (object instanceof PyFunction) { + PyFunction function = (PyFunction) object; + PyCode code = function.func_code; + if (code instanceof PyBaseCode) { + PyBaseCode pyCode = (PyBaseCode) code; + if (pyCode.co_flags.isFlagSet(CodeFlag.CO_GENERATOR)) { + return new PyFunction(function.func_globals, + function.func_defaults, + new ContextCode(pyCode), + function.__doc__, + (function.func_closure == null) ? null : + ((PyTuple)function.func_closure).getArray()); + } + } + } + throw Py.TypeError("Argument must be a generator function."); + } + + private static class ContextCode extends PyBaseCode { + private final PyBaseCode code; + ContextCode(PyBaseCode code) { + this.co_name = code.co_name; + this.code = code; + this.co_argcount = code.co_argcount; + this.nargs = code.nargs; + this.co_firstlineno = code.co_firstlineno; + this.co_varnames = code.co_varnames; + this.co_cellvars = code.co_cellvars; + this.jy_npurecell = code.jy_npurecell; + this.co_freevars = code.co_freevars; + this.co_filename = code.co_filename; + this.co_nlocals = code.co_nlocals; + this.varargs = code.varargs; + this.varkwargs = code.varkwargs; + for (CodeFlag flag : CodeFlag.values()) { + if (code.co_flags.isFlagSet(flag) && flag != CodeFlag.CO_GENERATOR) { + this.co_flags.setFlag(flag); + } + } + } + @SuppressWarnings("serial") + @Override + protected PyObject interpret(PyFrame frame, ThreadState ts) { + frame.f_back = null; + return new GeneratorContextManager(frame) { + @Override + PyObject body(ThreadState ts) { + return code.interpret(frame, ts); + } + }; + } + @SuppressWarnings("serial") + @Override + public PyObject call(ThreadState ts, PyFrame frame, final PyObject closure) { + frame.f_back = null; + return new GeneratorContextManager(frame) { + @Override + PyObject body(ThreadState ts) { + return code.call(ts, frame, closure); + } + }; + } + } + + @SuppressWarnings("serial") + private static abstract class GeneratorContextManager extends PyObject implements ContextManager { + final PyFrame frame; + + public GeneratorContextManager(PyFrame frame) { + this.frame = frame; + } + + public PyObject __enter__(ThreadState ts) { + PyObject res = body(ts); + if (frame.f_lasti == -1) { + throw Py.RuntimeError("generator didn't yield"); + } + return res; + } + + public boolean __exit__(ThreadState ts, PyObject type, PyObject value, + PyObject traceback) { + PyException ex = null; + if (type != null && type != Py.None) { + ex = Py.makeException(type, value, traceback); + frame.setGeneratorInput(ex); + } + PyObject res = null; + try { + res = body(ts); + } catch(PyException e) { + if (e == ex) { + return false; + } + } + if (frame.f_lasti != -1) { + throw Py.RuntimeError("generator didn't stop"); + } + return res.__nonzero__(); + } + + abstract PyObject body(ThreadState ts); + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <th...@us...> - 2009-07-15 02:31:49
|
Revision: 6537 http://jython.svn.sourceforge.net/jython/?rev=6537&view=rev Author: thobes Date: 2009-07-15 02:31:42 +0000 (Wed, 15 Jul 2009) Log Message: ----------- Performance improvements for list multiplication. Modified Paths: -------------- trunk/jython/src/org/python/core/PyList.java trunk/jython/src/org/python/core/PyTuple.java Modified: trunk/jython/src/org/python/core/PyList.java =================================================================== --- trunk/jython/src/org/python/core/PyList.java 2009-07-13 16:32:44 UTC (rev 6536) +++ trunk/jython/src/org/python/core/PyList.java 2009-07-15 02:31:42 UTC (rev 6537) @@ -21,7 +21,7 @@ public class PyList extends PySequenceList implements List { public static final PyType TYPE = PyType.fromClass(PyList.class); - protected final List<PyObject> list; + private final List<PyObject> list; public volatile int gListAllocatedStatus = -1; public PyList() { @@ -77,6 +77,10 @@ return new PyList(list, false); } + List<PyObject> getList() { + return Collections.unmodifiableList(list); + } + private static List<PyObject> listify(Iterator<PyObject> iter) { List<PyObject> list = Generic.list(); while (iter.hasNext()) { @@ -215,11 +219,12 @@ throw Py.MemoryError(""); } - PyList newList = new PyList(); + PyObject[] elements = list.toArray(new PyObject[size]); + PyObject[] newList = new PyObject[newSize]; for (int i = 0; i < count; i++) { - newList.addAll(list); + System.arraycopy(elements, 0, newList, i * size, size); } - return newList; + return new PyList(newList); } @ExposedMethod(type = MethodType.BINARY, doc = BuiltinDocs.list___ne___doc) Modified: trunk/jython/src/org/python/core/PyTuple.java =================================================================== --- trunk/jython/src/org/python/core/PyTuple.java 2009-07-13 16:32:44 UTC (rev 6536) +++ trunk/jython/src/org/python/core/PyTuple.java 2009-07-15 02:31:42 UTC (rev 6537) @@ -461,7 +461,7 @@ @Override public boolean containsAll(Collection c) { if (c instanceof PyList) { - return getList().containsAll(((PyList)c).list); + return getList().containsAll(((PyList)c).getList()); } else if (c instanceof PyTuple) { return getList().containsAll(((PyTuple)c).getList()); } else { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fwi...@us...> - 2009-07-13 16:32:48
|
Revision: 6536 http://jython.svn.sourceforge.net/jython/?rev=6536&view=rev Author: fwierzbicki Date: 2009-07-13 16:32:44 +0000 (Mon, 13 Jul 2009) Log Message: ----------- Fix for http://bugs.jython.org/issue645615 "cannot import through symbolic links". Now only explicitely enforcing case sensative imports on Windows and Mac. In the presense of both case insensative systems and symlinks there may be a performance penalty, as we walk the directory looking for exact matches in this case. This is the same method used in CPython. Modified Paths: -------------- trunk/jython/Lib/test/test_import_jy.py trunk/jython/NEWS trunk/jython/build.xml trunk/jython/src/org/python/core/imp.java Added Paths: ----------- trunk/jython/src/org/python/core/util/PlatformUtil.java Modified: trunk/jython/Lib/test/test_import_jy.py =================================================================== --- trunk/jython/Lib/test/test_import_jy.py 2009-07-13 15:29:30 UTC (rev 6535) +++ trunk/jython/Lib/test/test_import_jy.py 2009-07-13 16:32:44 UTC (rev 6536) @@ -164,6 +164,28 @@ def test_sys_modules_deletion(self): self.assertRaises(ZeroDivisionError, __import__, 'test.module_deleter') + #XXX: this is probably a good test to push upstream to CPython. + if hasattr(os, "symlink"): + def test_symlinks(self): + # Ensure imports work over symlinks. Did not work in Jython from + # 2.1 to 2.5.0, fixed in 2.5.1 See + # http://bugs.jython.org/issue645615. + sym = test_support.TESTFN+"1" + try: + os.mkdir(test_support.TESTFN) + init = os.path.join(test_support.TESTFN, "__init__.py") + fp = open(init, 'w') + fp.write("test = 'imported'") + fp.close() + os.symlink(test_support.TESTFN, sym) + module = os.path.basename(sym) + module_obj = __import__(module) + self.assertEquals(module_obj.test, 'imported') + + finally: + shutil.rmtree(test_support.TESTFN) + test_support.unlink(sym) + def test_main(): test_support.run_unittest(MislabeledImportTestCase, OverrideBuiltinsImportTestCase, Modified: trunk/jython/NEWS =================================================================== --- trunk/jython/NEWS 2009-07-13 15:29:30 UTC (rev 6535) +++ trunk/jython/NEWS 2009-07-13 16:32:44 UTC (rev 6536) @@ -7,6 +7,7 @@ - Setting __javaname__ in classes subclassing Java classes or implementing Java interfaces sets the name of the produced proxy class. Bugs Fixed + - [ 645615 ] cannot import through symbolic links - [ 1366 ] parsing of lamda expression fails - [ 1365 ] continuation lines fail in interactive interpreter - [ 1377 ] Event names shadowed by a field name on Java types leads to a NPE Modified: trunk/jython/build.xml =================================================================== --- trunk/jython/build.xml 2009-07-13 15:29:30 UTC (rev 6535) +++ trunk/jython/build.xml 2009-07-13 16:32:44 UTC (rev 6536) @@ -158,6 +158,7 @@ <pathelement path="${extlibs.dir}/asm-3.1.jar" /> <pathelement path="${extlibs.dir}/asm-commons-3.1.jar" /> <pathelement path="${extlibs.dir}/constantine-0.4.jar" /> + <pathelement path="${extlibs.dir}/jna.jar"/> <pathelement path="${extlibs.dir}/jna-posix.jar"/> </path> Modified: trunk/jython/src/org/python/core/imp.java =================================================================== --- trunk/jython/src/org/python/core/imp.java 2009-07-13 15:29:30 UTC (rev 6535) +++ trunk/jython/src/org/python/core/imp.java 2009-07-13 16:32:44 UTC (rev 6536) @@ -11,6 +11,7 @@ import org.python.compiler.Module; import org.python.core.util.FileUtil; +import org.python.core.util.PlatformUtil; /** * Utility functions for "import" support. @@ -527,12 +528,26 @@ } public static boolean caseok(File file, String filename) { - if (Options.caseok) { + if (Options.caseok || !PlatformUtil.isCaseInsensitive()) { return true; } try { File canFile = new File(file.getCanonicalPath()); - return filename.regionMatches(0, canFile.getName(), 0, filename.length()); + boolean match = filename.regionMatches(0, canFile.getName(), 0, filename.length()); + if (!match) { + //possibly a symlink. Get parent and look for exact match in listdir() + //This is what CPython does in the case of Mac OS X and Cygwin. + //XXX: This will be a performance hit, maybe jdk7 nio2 can give us a better + // method? + File parent = file.getParentFile(); + String[] children = parent.list(); + for (String c: children) { + if (c.equals(filename)) { + return true; + } + } + } + return match; } catch (IOException exc) { return false; } Added: trunk/jython/src/org/python/core/util/PlatformUtil.java =================================================================== --- trunk/jython/src/org/python/core/util/PlatformUtil.java (rev 0) +++ trunk/jython/src/org/python/core/util/PlatformUtil.java 2009-07-13 16:32:44 UTC (rev 6536) @@ -0,0 +1,24 @@ +// Copyright (c) 2009 Jython project +package org.python.core.util; + +// Note: Sun does not sponsor the jna project, even though the package name +// might imply otherwise. +import com.sun.jna.Platform; + +/** + * Methods for testing the platform/operating system that we are on. + */ +public class PlatformUtil { + + /** + * @return True if the operating system we are on is case insensitive, + * where case insensitive means that a file that is stored as FOO + * can be accessed as (for example) FoO. + */ + //Currently we just check to see if we are on windows or macs, which are + //commonly (though not always!) case insensitive. There are certainly cases + //where this is not sufficient, like the case of mounted filesystems. + public static boolean isCaseInsensitive() { + return Platform.isMac() || Platform.isWindows(); + } +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <th...@us...> - 2009-07-13 15:29:39
|
Revision: 6535 http://jython.svn.sourceforge.net/jython/?rev=6535&view=rev Author: thobes Date: 2009-07-13 15:29:30 +0000 (Mon, 13 Jul 2009) Log Message: ----------- Fixed incompatibility with CPython in the new ContextManager protocol, the evaluation order in the implementation was not as specified by PEP 343. According to PEP 343 the __exit__ attribute should be accessed and stored before the __enter__ attribute is accessed and invoked. Modified Paths: -------------- trunk/jython/src/org/python/core/ContextGuard.java Modified: trunk/jython/src/org/python/core/ContextGuard.java =================================================================== --- trunk/jython/src/org/python/core/ContextGuard.java 2009-07-12 18:14:32 UTC (rev 6534) +++ trunk/jython/src/org/python/core/ContextGuard.java 2009-07-13 15:29:30 UTC (rev 6535) @@ -11,8 +11,8 @@ private final PyObject __exit__method; private ContextGuard(PyObject manager) { + __exit__method = manager.__getattr__("__exit__"); __enter__method = manager.__getattr__("__enter__"); - __exit__method = manager.__getattr__("__exit__"); } public PyObject __enter__(ThreadState ts) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cg...@us...> - 2009-07-12 18:14:38
|
Revision: 6534 http://jython.svn.sourceforge.net/jython/?rev=6534&view=rev Author: cgroves Date: 2009-07-12 18:14:32 +0000 (Sun, 12 Jul 2009) Log Message: ----------- Whoops, isEmpty is a 1.6 method Modified Paths: -------------- trunk/jython/src/org/python/core/util/StringUtil.java Modified: trunk/jython/src/org/python/core/util/StringUtil.java =================================================================== --- trunk/jython/src/org/python/core/util/StringUtil.java 2009-07-12 08:07:51 UTC (rev 6533) +++ trunk/jython/src/org/python/core/util/StringUtil.java 2009-07-12 18:14:32 UTC (rev 6534) @@ -105,7 +105,7 @@ * http://java.sun.com/docs/books/jls/second_edition/html/lexical.doc.html#40625 */ public static boolean isJavaIdentifier(String ident) { - if (ident.isEmpty() || JAVA_LITERALS.contains(ident)) { + if (ident.length() == 0 || JAVA_LITERALS.contains(ident)) { return false; } int cp = ident.codePointAt(0); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cg...@us...> - 2009-07-12 08:07:52
|
Revision: 6533 http://jython.svn.sourceforge.net/jython/?rev=6533&view=rev Author: cgroves Date: 2009-07-12 08:07:51 +0000 (Sun, 12 Jul 2009) Log Message: ----------- Add javaproxy_dir to sys, and if it's set, compile Java proxies to that directory. Modified Paths: -------------- trunk/jython/Lib/test/test_java_subclasses.py trunk/jython/src/org/python/core/MakeProxies.java trunk/jython/src/org/python/core/Py.java trunk/jython/src/org/python/core/PySystemState.java Added Paths: ----------- trunk/jython/Lib/test/import_as_java_class.py trunk/jython/Lib/test/static_proxy.py Added: trunk/jython/Lib/test/import_as_java_class.py =================================================================== --- trunk/jython/Lib/test/import_as_java_class.py (rev 0) +++ trunk/jython/Lib/test/import_as_java_class.py 2009-07-12 08:07:51 UTC (rev 6533) @@ -0,0 +1,7 @@ +# Part of test_java_subclasses.StaticProxyCompilationTest +from java.lang import Class + +# Grab the proxy class statically compiled by the containing test +cls = Class.forName("test.static_proxy.RunnableImpl") +# Instantiating the proxy class should import the module containing it and create the Python side +assert cls.newInstance().meth() == 78 Added: trunk/jython/Lib/test/static_proxy.py =================================================================== --- trunk/jython/Lib/test/static_proxy.py (rev 0) +++ trunk/jython/Lib/test/static_proxy.py 2009-07-12 08:07:51 UTC (rev 6533) @@ -0,0 +1,11 @@ +# Part of test_java_subclasses.StaticProxyCompilationTest. This needs to be its own module +# so the statically compiled proxy can import it. +from java.lang import Runnable + +class RunnableImpl(Runnable): + __javaname__ = "test.static_proxy.RunnableImpl" + def run(self): + pass + + def meth(self): + return 78 Modified: trunk/jython/Lib/test/test_java_subclasses.py =================================================================== --- trunk/jython/Lib/test/test_java_subclasses.py 2009-07-12 05:41:43 UTC (rev 6532) +++ trunk/jython/Lib/test/test_java_subclasses.py 2009-07-12 08:07:51 UTC (rev 6533) @@ -1,6 +1,8 @@ '''Tests subclassing Java classes in Python''' import os import sys +import tempfile +import subprocess import unittest from test import test_support @@ -345,6 +347,26 @@ except TypeError: pass +class StaticProxyCompilationTest(unittest.TestCase): + def setUp(self): + self.orig_proxy_dir = sys.javaproxy_dir + sys.javaproxy_dir = tempfile.mkdtemp() + + def tearDown(self): + sys.javaproxy_dir = self.orig_proxy_dir + + def test_proxies_without_classloader(self): + # importing with proxy_dir set compiles RunnableImpl there + import static_proxy + + # Use the existing environment with the proxy dir added on the classpath + env = dict(os.environ) + env["CLASSPATH"] = sys.javaproxy_dir + script = test_support.findfile("import_as_java_class.py") + self.assertEquals(subprocess.call([sys.executable, "-J-Dpython.cachedir.skip=true", + script], env=env), + 0) + def test_main(): test_support.run_unittest(InterfaceTest, TableModelTest, @@ -352,4 +374,5 @@ PythonSubclassesTest, AbstractOnSyspathTest, ContextClassloaderTest, - SettingJavaClassNameTest) + SettingJavaClassNameTest, + StaticProxyCompilationTest) Modified: trunk/jython/src/org/python/core/MakeProxies.java =================================================================== --- trunk/jython/src/org/python/core/MakeProxies.java 2009-07-12 05:41:43 UTC (rev 6532) +++ trunk/jython/src/org/python/core/MakeProxies.java 2009-07-12 08:07:51 UTC (rev 6533) @@ -61,6 +61,10 @@ "must be valid Java identifiers: " + "http://java.sun.com/docs/books/jls/second_edition/html/lexical.doc.html#40625"); } + Class<?> proxy = Py.findClass(fullProxyName); + if (proxy != null) { + return proxy; + } } else { fullProxyName = proxyPrefix + proxyName + "$" + proxyNumber++; } @@ -81,7 +85,11 @@ jm.build(); ByteArrayOutputStream bytes = new ByteArrayOutputStream(); jm.classfile.write(bytes); - Py.saveClassFile(fullProxyName, bytes); + if (customProxyName != null) { + Py.saveClassFile(fullProxyName, bytes, Py.getSystemState().javaproxy_dir); + } else { + Py.saveClassFile(fullProxyName, bytes); + } return makeClass(superclass, vinterfaces, jm.myClass, bytes); } catch (Exception exc) { Modified: trunk/jython/src/org/python/core/Py.java =================================================================== --- trunk/jython/src/org/python/core/Py.java 2009-07-12 05:41:43 UTC (rev 6532) +++ trunk/jython/src/org/python/core/Py.java 2009-07-12 08:07:51 UTC (rev 6533) @@ -830,8 +830,9 @@ public static void initProxy(PyProxy proxy, String module, String pyclass, Object[] args) { - if (proxy._getPyInstance() != null) + if (proxy._getPyInstance() != null) { return; + } ThreadState ts = getThreadState(); PyObject instance = ts.getInitializingProxy(); if (instance != null) { @@ -1759,14 +1760,17 @@ } public static void saveClassFile(String name, ByteArrayOutputStream bytestream) { - String dirname = Options.proxyDebugDirectory; + saveClassFile(name, bytestream, Options.proxyDebugDirectory); + } + + public static void saveClassFile(String name, ByteArrayOutputStream baos, String dirname) { if (dirname == null) { return; } - - byte[] bytes = bytestream.toByteArray(); + byte[] bytes = baos.toByteArray(); File dir = new File(dirname); File file = makeFilename(name, dir); + new File(file.getParent()).mkdirs(); try { FileOutputStream o = new FileOutputStream(file); Modified: trunk/jython/src/org/python/core/PySystemState.java =================================================================== --- trunk/jython/src/org/python/core/PySystemState.java 2009-07-12 05:41:43 UTC (rev 6532) +++ trunk/jython/src/org/python/core/PySystemState.java 2009-07-12 08:07:51 UTC (rev 6533) @@ -40,6 +40,7 @@ public static final String PYTHON_CACHEDIR_SKIP = "python.cachedir.skip"; public static final String PYTHON_CONSOLE_ENCODING = "python.console.encoding"; protected static final String CACHEDIR_DEFAULT_NAME = "cachedir"; + public static final String PYTHON_JAVAPROXYDIR = "python.javaproxydir"; public static final String JYTHON_JAR = "jython.jar"; public static final String JYTHON_DEV_JAR = "jython-dev.jar"; @@ -138,6 +139,13 @@ public PyObject last_type = Py.None; public PyObject last_traceback = Py.None; + private static String defaultJavaProxyDir; + + /** + * The directory where named Java proxies are written. + */ + public String javaproxy_dir; + public PyObject __name__ = new PyString("sys"); public PyObject __dict__; @@ -189,6 +197,8 @@ __dict__.invoke("update", getType().fastGetDict()); __dict__.__setitem__("displayhook", __displayhook__); __dict__.__setitem__("excepthook", __excepthook__); + + javaproxy_dir = defaultJavaProxyDir; } void reload() throws PyIgnoreMethodTag { @@ -857,6 +867,8 @@ // other initializations initBuiltins(registry); initStaticFields(); + defaultJavaProxyDir = registry.getProperty(PYTHON_JAVAPROXYDIR); + // Initialize the path (and add system defaults) defaultPath = initPath(registry, standalone, jarFileName); defaultArgv = initArgv(argv); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cg...@us...> - 2009-07-12 05:41:47
|
Revision: 6532 http://jython.svn.sourceforge.net/jython/?rev=6532&view=rev Author: cgroves Date: 2009-07-12 05:41:43 +0000 (Sun, 12 Jul 2009) Log Message: ----------- Set the name of the produced proxy class to the value from __javaclass__ if it's set in the Python class. Modified Paths: -------------- trunk/jython/Lib/test/test_java_subclasses.py trunk/jython/NEWS trunk/jython/src/org/python/compiler/Module.java trunk/jython/src/org/python/core/MakeProxies.java trunk/jython/src/org/python/core/PyType.java trunk/jython/src/org/python/core/util/StringUtil.java Modified: trunk/jython/Lib/test/test_java_subclasses.py =================================================================== --- trunk/jython/Lib/test/test_java_subclasses.py 2009-07-12 00:53:25 UTC (rev 6531) +++ trunk/jython/Lib/test/test_java_subclasses.py 2009-07-12 05:41:43 UTC (rev 6532) @@ -321,10 +321,35 @@ self.assertEquals(len(called), 1) +class SettingJavaClassNameTest(unittest.TestCase): + def test_setting_name(self): + class Fixedname(Runnable): + __javaname__ = 'name.set.in.Python' + def run(self): + pass + self.assertEquals('name.set.in.Python', Fixedname().getClass().name) + try: + class NumberPackageName(Runnable): + __javaname__ = 'ok.7.ok' + def run(self): + pass + self.fail("Shouldn't be able to set a package name that starts with a digit") + except TypeError: + pass + try: + class LiteralPackageName(Runnable): + __javaname__ = 'ok.true.ok' + def run(self): + pass + self.fail("Shouldn't be able to use a Java literal as a package name") + except TypeError: + pass + def test_main(): test_support.run_unittest(InterfaceTest, TableModelTest, AutoSuperTest, PythonSubclassesTest, AbstractOnSyspathTest, - ContextClassloaderTest) + ContextClassloaderTest, + SettingJavaClassNameTest) Modified: trunk/jython/NEWS =================================================================== --- trunk/jython/NEWS 2009-07-12 00:53:25 UTC (rev 6531) +++ trunk/jython/NEWS 2009-07-12 05:41:43 UTC (rev 6532) @@ -4,6 +4,8 @@ New Features - Upgraded to ANTLR 3.1.3 - [ 1859477 ] Dynamically loaded ServletFilters like PyServlet + - Setting __javaname__ in classes subclassing Java classes or implementing Java interfaces sets + the name of the produced proxy class. Bugs Fixed - [ 1366 ] parsing of lamda expression fails - [ 1365 ] continuation lines fail in interactive interpreter Modified: trunk/jython/src/org/python/compiler/Module.java =================================================================== --- trunk/jython/src/org/python/compiler/Module.java 2009-07-12 00:53:25 UTC (rev 6531) +++ trunk/jython/src/org/python/compiler/Module.java 2009-07-12 05:41:43 UTC (rev 6532) @@ -12,6 +12,11 @@ import org.objectweb.asm.Label; import org.objectweb.asm.Opcodes; +import org.objectweb.asm.Type; +import org.python.antlr.ParseException; +import org.python.antlr.PythonTree; +import org.python.antlr.ast.Suite; +import org.python.antlr.base.mod; import org.python.core.CodeBootstrap; import org.python.core.CodeFlag; import org.python.core.CodeLoader; @@ -19,11 +24,7 @@ import org.python.core.Py; import org.python.core.PyException; import org.python.core.PyRunnableBootstrap; -import org.objectweb.asm.Type; -import org.python.antlr.ParseException; -import org.python.antlr.PythonTree; -import org.python.antlr.ast.Suite; -import org.python.antlr.base.mod; +import org.python.core.util.StringUtil; class PyIntegerConstant extends Constant implements ClassConstants, Opcodes { @@ -365,20 +366,7 @@ } List codes; - private boolean isJavaIdentifier(String s) { - char[] chars = s.toCharArray(); - if (chars.length == 0) - return false; - if (!Character.isJavaIdentifierStart(chars[0])) - return false; - for(int i=1; i<chars.length; i++) { - if (!Character.isJavaIdentifierPart(chars[i])) - return false; - } - return true; - } - //XXX: this can probably go away now that we can probably just copy the list. private List<String> toNameAr(List names,boolean nullok) { int sz = names.size(); @@ -423,7 +411,7 @@ code.id = codes.size(); //Better names in the future? - if (isJavaIdentifier(name)) + if (StringUtil.isJavaIdentifier(name)) code.fname = name+"$"+code.id; else code.fname = "f$"+code.id; @@ -549,7 +537,7 @@ c.invokestatic("org/python/core/Py", "runMain", "(" + bootstrap + $strArr + ")V"); c.return_(); } - + public void addBootstrap() throws IOException { Code c = classfile.addMethod(CodeLoader.GET_BOOTSTRAP_METHOD_NAME, "()" + Type.getDescriptor(CodeBootstrap.class), @@ -655,7 +643,7 @@ String name, String filename, boolean linenumbers, boolean printResults, CompilerFlags cflags) - throws Exception + throws Exception { compile(node, ostream, name, filename, linenumbers, printResults, cflags, org.python.core.imp.NO_MTIME); } Modified: trunk/jython/src/org/python/core/MakeProxies.java =================================================================== --- trunk/jython/src/org/python/core/MakeProxies.java 2009-07-12 00:53:25 UTC (rev 6531) +++ trunk/jython/src/org/python/core/MakeProxies.java 2009-07-12 05:41:43 UTC (rev 6532) @@ -8,6 +8,7 @@ import org.python.compiler.AdapterMaker; import org.python.compiler.JavaMaker; +import org.python.core.util.StringUtil; class MakeProxies { @@ -51,13 +52,24 @@ List<Class<?>> vinterfaces, String className, String proxyName, PyObject dict) { Class<?>[] interfaces = vinterfaces.toArray(new Class<?>[vinterfaces.size()]); - String fullProxyName = proxyPrefix + proxyName + "$" + proxyNumber++; + String fullProxyName; + PyObject customProxyName = dict.__finditem__("__javaname__"); + if (customProxyName != null) { + fullProxyName = Py.tojava(customProxyName, String.class); + if (!StringUtil.isJavaClassName(fullProxyName)) { + throw Py.TypeError(fullProxyName + " isn't a valid Java class name. Classes " + + "must be valid Java identifiers: " + + "http://java.sun.com/docs/books/jls/second_edition/html/lexical.doc.html#40625"); + } + } else { + fullProxyName = proxyPrefix + proxyName + "$" + proxyNumber++; + } String pythonModuleName; PyObject mn = dict.__finditem__("__module__"); if (mn == null) { pythonModuleName = "foo"; } else { - pythonModuleName = (String) mn.__tojava__(String.class); + pythonModuleName = Py.tojava(mn, String.class); } JavaMaker jm = new JavaMaker(superclass, interfaces, Modified: trunk/jython/src/org/python/core/PyType.java =================================================================== --- trunk/jython/src/org/python/core/PyType.java 2009-07-12 00:53:25 UTC (rev 6531) +++ trunk/jython/src/org/python/core/PyType.java 2009-07-12 05:41:43 UTC (rev 6532) @@ -579,11 +579,9 @@ if (module != null) { proxyName = module.toString() + "$" + proxyName; } - Class<?> proxyClass = MakeProxies.makeProxy(baseProxyClass, interfaces, name, proxyName, - dict); - javaProxy = proxyClass; + javaProxy = MakeProxies.makeProxy(baseProxyClass, interfaces, name, proxyName, dict); - PyType proxyType = PyType.fromClass(proxyClass); + PyType proxyType = PyType.fromClass((Class<?>)javaProxy); List<PyObject> cleanedBases = Generic.list(); boolean addedProxyType = false; for (PyObject base : bases) { Modified: trunk/jython/src/org/python/core/util/StringUtil.java =================================================================== --- trunk/jython/src/org/python/core/util/StringUtil.java 2009-07-12 00:53:25 UTC (rev 6531) +++ trunk/jython/src/org/python/core/util/StringUtil.java 2009-07-12 05:41:43 UTC (rev 6532) @@ -3,8 +3,10 @@ import java.io.UnsupportedEncodingException; import java.nio.ByteBuffer; +import java.util.Set; import org.python.core.Py; +import org.python.util.Generic; /** * String Utility methods. @@ -84,4 +86,47 @@ chars[0] = Character.toLowerCase(c0); return new String(chars); } + + /** + * Returns true if each segment of <code>name</code> produced by splitting it on '.' is a valid + * Java identifier. + */ + public static boolean isJavaClassName(String name) { + for (String segment : name.split("\\.")) { + if (!isJavaIdentifier(segment)) { + return false; + } + } + return true; + } + + /** + * Returns true if ident is a valid Java identifier as defined by + * http://java.sun.com/docs/books/jls/second_edition/html/lexical.doc.html#40625 + */ + public static boolean isJavaIdentifier(String ident) { + if (ident.isEmpty() || JAVA_LITERALS.contains(ident)) { + return false; + } + int cp = ident.codePointAt(0); + if (!Character.isJavaIdentifierStart(cp)) { + return false; + } + for (int i = Character.charCount(cp); i < ident.length(); i += Character.charCount(cp)) { + cp = ident.codePointAt(i); + if (!Character.isJavaIdentifierPart(cp)) { + return false; + } + } + return true; + } + + // True false and null are just literals, the rest are keywords + private static final Set<String> JAVA_LITERALS = Generic.set("abstract", "continue", "for", + "new", "switch", "assert", "default", "goto", "package", "synchronized", "boolean", "do", + "if", "private", "this", "break", "double", "implements", "protected", "throw", "byte", + "else", "import", "public", "throws", "case", "enum", "instanceof", "return", "transient", + "catch", "extends", "int", "short", "try", "char", "final", "interface", "static", "void", + "class", "finally", "long", "strictfp", "volatile", "const", "float", "native", "super", + "while", "true", "false", "null"); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fwi...@us...> - 2009-07-12 00:53:27
|
Revision: 6531 http://jython.svn.sourceforge.net/jython/?rev=6531&view=rev Author: fwierzbicki Date: 2009-07-12 00:53:25 +0000 (Sun, 12 Jul 2009) Log Message: ----------- reducing heap memory for antlr task from 1024 to 128 since that appears to be enough for the problematic case (JDK 6 on OS X). Modified Paths: -------------- trunk/jython/build.xml Modified: trunk/jython/build.xml =================================================================== --- trunk/jython/build.xml 2009-07-12 00:18:02 UTC (rev 6530) +++ trunk/jython/build.xml 2009-07-12 00:53:25 UTC (rev 6531) @@ -428,7 +428,7 @@ <target name="antlr_gen" depends="prepare-output" unless="antlr.notneeded"> <java classname="org.antlr.Tool" failonerror="true" fork="true" dir="${jython.base.dir}"> - <jvmarg value="-Xmx1024m"/> + <jvmarg value="-Xmx128m"/> <arg value="-Xconversiontimeout"/> <arg value="2000"/> <arg value="-fo"/> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fwi...@us...> - 2009-07-12 00:18:10
|
Revision: 6530 http://jython.svn.sourceforge.net/jython/?rev=6530&view=rev Author: fwierzbicki Date: 2009-07-12 00:18:02 +0000 (Sun, 12 Jul 2009) Log Message: ----------- upped memory for antlr task. Needed for (at least) JDK 6 on OS X. Modified Paths: -------------- trunk/jython/build.xml Modified: trunk/jython/build.xml =================================================================== --- trunk/jython/build.xml 2009-07-11 23:22:13 UTC (rev 6529) +++ trunk/jython/build.xml 2009-07-12 00:18:02 UTC (rev 6530) @@ -428,6 +428,7 @@ <target name="antlr_gen" depends="prepare-output" unless="antlr.notneeded"> <java classname="org.antlr.Tool" failonerror="true" fork="true" dir="${jython.base.dir}"> + <jvmarg value="-Xmx1024m"/> <arg value="-Xconversiontimeout"/> <arg value="2000"/> <arg value="-fo"/> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pj...@us...> - 2009-07-11 23:22:26
|
Revision: 6529 http://jython.svn.sourceforge.net/jython/?rev=6529&view=rev Author: pjenvey Date: 2009-07-11 23:22:13 +0000 (Sat, 11 Jul 2009) Log Message: ----------- don't encode unicode when printing to an intercepted stream thanks Pekka Klarck fixes #1802339 Modified Paths: -------------- trunk/jython/Lib/test/test_unicode_jy.py trunk/jython/NEWS trunk/jython/src/org/python/core/StdoutWrapper.java Modified: trunk/jython/Lib/test/test_unicode_jy.py =================================================================== --- trunk/jython/Lib/test/test_unicode_jy.py 2009-07-11 22:38:33 UTC (rev 6528) +++ trunk/jython/Lib/test/test_unicode_jy.py 2009-07-11 23:22:13 UTC (rev 6529) @@ -6,6 +6,7 @@ import re import sys import unittest +from StringIO import StringIO from test import test_support class UnicodeTestCase(unittest.TestCase): @@ -156,9 +157,25 @@ self.assertEquals(u"\u00e7%s" % "foo", u"\u00e7foo") +class UnicodeStdIOTestCase(unittest.TestCase): + + def setUp(self): + self.stdout = sys.stdout + + def tearDown(self): + sys.stdout = self.stdout + + def test_intercepted_stdout(self): + msg = u'Circle is 360\u00B0' + sys.stdout = StringIO() + print msg, + self.assertEqual(sys.stdout.getvalue(), msg) + + def test_main(): test_support.run_unittest(UnicodeTestCase, - UnicodeFormatTestCase) + UnicodeFormatTestCase, + UnicodeStdIOTestCase) if __name__ == "__main__": Modified: trunk/jython/NEWS =================================================================== --- trunk/jython/NEWS 2009-07-11 22:38:33 UTC (rev 6528) +++ trunk/jython/NEWS 2009-07-11 23:22:13 UTC (rev 6529) @@ -10,6 +10,7 @@ - [ 1377 ] Event names shadowed by a field name on Java types leads to a NPE - [ 1381 ] Redundant declarations of interface implementation hides overriden methods - [ 1189 ] MD5 hash is incorrectly calculated when string contains non-latin chars and using python md5 lib + - [ 1802339 ] Problem printing unicode when stdout intercepted Jython 2.5.0 The same as rc4. Modified: trunk/jython/src/org/python/core/StdoutWrapper.java =================================================================== --- trunk/jython/src/org/python/core/StdoutWrapper.java 2009-07-11 22:38:33 UTC (rev 6528) +++ trunk/jython/src/org/python/core/StdoutWrapper.java 2009-07-11 23:22:13 UTC (rev 6529) @@ -41,6 +41,7 @@ return obj; } + @Override public void flush() { PyObject obj = myFile(); if (obj instanceof PyFile) { @@ -64,10 +65,12 @@ } } + @Override public void write(int i) { write(new String(new char[] { (char) i })); } + @Override public void write(byte[] data, int off, int len) { write(StringUtil.fromBytes(data, off, len)); } @@ -112,10 +115,10 @@ } else { s = o.__str__().toString(); } + file.write(s); - int len = s.length(); - file.write(s); if (o instanceof PyString) { + int len = s.length(); if (len == 0 || !Character.isWhitespace(s.charAt(len - 1)) || s.charAt(len - 1) == ' ') { file.softspace = space; @@ -123,6 +126,7 @@ } else { file.softspace = space; } + if (newline) { file.write("\n"); file.softspace = false; @@ -143,9 +147,10 @@ } else { s = o.toString(); } - int len = s.length(); file.write(s); + if (o instanceof PyString) { + int len = s.length(); if (len == 0 || !Character.isWhitespace(s.charAt(len - 1)) || s.charAt(len - 1) == ' ') { file.softspace = space; @@ -153,6 +158,7 @@ } else { file.softspace = space; } + if (newline) { file.write("\n"); file.softspace = false; @@ -164,11 +170,15 @@ obj.invoke("write", Py.Space); obj.__setattr__("softspace", Py.Zero); } - PyString string = o.__str__(); - String s = o.toString(); - int len = s.length(); - obj.invoke("write", string); + + if (!(o instanceof PyUnicode)) { + o = o.__str__(); + } + obj.invoke("write", o); + if (o instanceof PyString) { + String s = o.toString(); + int len = s.length(); if (len == 0 || !Character.isWhitespace(s.charAt(len - 1)) || s.charAt(len - 1) == ' ') { obj.__setattr__("softspace", space ? Py.One : Py.Zero); @@ -176,6 +186,7 @@ } else { obj.__setattr__("softspace", space ? Py.One : Py.Zero); } + if (newline) { obj.invoke("write", Py.Newline); obj.__setattr__("softspace", Py.Zero); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pj...@us...> - 2009-07-11 22:38:53
|
Revision: 6528 http://jython.svn.sourceforge.net/jython/?rev=6528&view=rev Author: pjenvey Date: 2009-07-11 22:38:33 +0000 (Sat, 11 Jul 2009) Log Message: ----------- small refactor Modified Paths: -------------- trunk/jython/src/org/python/core/__builtin__.java Modified: trunk/jython/src/org/python/core/__builtin__.java =================================================================== --- trunk/jython/src/org/python/core/__builtin__.java 2009-07-11 06:47:49 UTC (rev 6527) +++ trunk/jython/src/org/python/core/__builtin__.java 2009-07-11 22:38:33 UTC (rev 6528) @@ -21,6 +21,7 @@ super(name, index, minargs, maxargs); } + @Override public PyObject __call__() { switch (this.index) { case 4: @@ -42,6 +43,7 @@ } } + @Override public PyObject __call__(PyObject arg1) { switch (this.index) { case 0: @@ -121,6 +123,7 @@ } } + @Override public PyObject __call__(PyObject arg1, PyObject arg2) { switch (this.index) { case 2: @@ -176,6 +179,7 @@ } } + @Override public PyObject __call__(PyObject arg1, PyObject arg2, PyObject arg3) { switch (this.index) { case 2: @@ -244,6 +248,7 @@ } } + @Override public PyObject __call__(PyObject arg1, PyObject arg2, PyObject arg3, PyObject arg4) { switch (this.index) { case 44: @@ -261,6 +266,7 @@ } } + @Override public PyObject fancyCall(PyObject[] args) { switch (this.index) { case 29: @@ -272,6 +278,7 @@ } } + @Override public PyObject getModule() { return module; } @@ -574,24 +581,20 @@ } StringBuilder builder = new StringBuilder(); - boolean ok; for (PyObject item : seq.asIterable()) { - ok = false; if (func == Py.None) { - if (item.__nonzero__()) { - ok = true; + if (!item.__nonzero__()) { + continue; } - } else if (func.__call__(item).__nonzero__()) { - ok = true; + } else if (!func.__call__(item).__nonzero__()) { + continue; } - if (ok) { - if (!Py.isInstance(item, stringType)) { - String name = stringType.fastGetName(); - throw Py.TypeError(String.format("can't filter %s to %s: __getitem__ returned " - + "different type", name, name)); - } - builder.append(item.toString()); + if (!Py.isInstance(item, stringType)) { + String name = stringType.fastGetName(); + throw Py.TypeError(String.format("can't filter %s to %s: __getitem__ returned " + + "different type", name, name)); } + builder.append(item.toString()); } String result = builder.toString(); @@ -609,20 +612,16 @@ PyList list = new PyList(); PyObject item; - boolean ok; for (int i = 0; i < len; i++) { - ok = false; item = seq.__finditem__(i); if (func == Py.None) { - if (item.__nonzero__()) { - ok = true; + if (!item.__nonzero__()) { + continue; } - } else if (func.__call__(item).__nonzero__()) { - ok = true; + } else if (!func.__call__(item).__nonzero__()) { + continue; } - if (ok) { - list.append(item); - } + list.append(item); } return PyTuple.fromIterable(list); } @@ -1221,6 +1220,7 @@ "is the number of parent directories to search relative to the current module."); } + @Override public PyObject __call__(PyObject args[], String keywords[]) { ArgParser ap = new ArgParser("__import__", args, keywords, new String[]{"name", "globals", "locals", "fromlist", "level"}, @@ -1436,6 +1436,7 @@ "This always returns a floating point number. Precision may be negative."); } + @Override public PyObject __call__(PyObject args[], String kwds[]) { ArgParser ap = new ArgParser("round", args, kwds, new String[] {"number", "ndigits"}, 0); PyObject number = ap.getPyObject(0); @@ -1474,6 +1475,7 @@ + "in addition to any features explicitly specified."); } + @Override public PyObject __call__(PyObject args[], String kwds[]) { ArgParser ap = new ArgParser("compile", args, kwds, new String[] {"source", "filename", "mode", "flags", @@ -1556,6 +1558,7 @@ "Passing an Input/OutputStream to open is deprecated, use " + "org.python.core.util.FileUtil.wrap(stream[, bufsize]) instead."; + @Override public PyObject __call__(PyObject args[], String kwds[]) { ArgParser ap = new ArgParser("file", args, kwds, new String[] {"name", "mode", "bufsize"}, 1); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <zy...@us...> - 2009-07-11 06:47:51
|
Revision: 6527 http://jython.svn.sourceforge.net/jython/?rev=6527&view=rev Author: zyasoft Date: 2009-07-11 06:47:49 +0000 (Sat, 11 Jul 2009) Log Message: ----------- Added the ContextManager interface and supporting code to enable context mgmt through the with-statement to be efficiently inlined by the JVM. The ContextManager interface allows for direct calls via invokeinterface of __enter__ and __exit__ instead of requiring getattr. ContextGuard is used to wrap managers that don't support this Java interface. threading.Lock (=RLock) and Condition are now written in Java for performance and support the new ContextManager protocol. This addresses some of the performance issues that Tobias blogged on http://journal.thobe.org/2009/06/performance-of-synchronization.html Bumped bytecode magic. Modified Paths: -------------- trunk/jython/CoreExposed.includes trunk/jython/Lib/threading.py trunk/jython/src/org/python/compiler/CodeCompiler.java trunk/jython/src/org/python/core/imp.java trunk/jython/src/org/python/modules/Setup.java trunk/jython/src/org/python/modules/_collections/Collections.java trunk/jython/src/org/python/modules/_collections/PyDeque.java Added Paths: ----------- trunk/jython/src/org/python/core/ContextGuard.java trunk/jython/src/org/python/core/ContextManager.java trunk/jython/src/org/python/modules/_threading/ trunk/jython/src/org/python/modules/_threading/Condition.java trunk/jython/src/org/python/modules/_threading/Lock.java trunk/jython/src/org/python/modules/_threading/_threading.java Modified: trunk/jython/CoreExposed.includes =================================================================== --- trunk/jython/CoreExposed.includes 2009-07-09 01:47:52 UTC (rev 6526) +++ trunk/jython/CoreExposed.includes 2009-07-11 06:47:49 UTC (rev 6527) @@ -41,25 +41,27 @@ org/python/core/PyType.class org/python/core/PyUnicode.class org/python/core/PyXRange.class +org/python/modules/PyStruct.class +org/python/modules/PyTeeIterator.class org/python/modules/_codecs$EncodingMap.class +org/python/modules/_collections/PyDefaultDict.class +org/python/modules/_collections/PyDeque.class org/python/modules/_csv/PyDialect.class org/python/modules/_csv/PyReader.class org/python/modules/_csv/PyWriter.class org/python/modules/_functools/PyPartial.class +org/python/modules/_hashlib$Hash.class +org/python/modules/_threading/Condition.class +org/python/modules/_threading/Lock.class org/python/modules/_weakref/CallableProxyType.class +org/python/modules/_weakref/ProxyType.class org/python/modules/_weakref/ReferenceType.class -org/python/modules/_weakref/ProxyType.class -org/python/modules/_hashlib$Hash.class -org/python/modules/_collections/PyDefaultDict.class -org/python/modules/_collections/PyDeque.class org/python/modules/operator$PyAttrGetter.class org/python/modules/operator$PyItemGetter.class org/python/modules/random/PyRandom.class org/python/modules/thread/PyLocal.class org/python/modules/time/PyTimeTuple.class org/python/modules/zipimport/zipimporter.class -org/python/modules/PyStruct.class -org/python/modules/PyTeeIterator.class org/python/antlr/AST.class org/python/antlr/ast/alias.class org/python/antlr/ast/arguments.class Modified: trunk/jython/Lib/threading.py =================================================================== --- trunk/jython/Lib/threading.py 2009-07-09 01:47:52 UTC (rev 6526) +++ trunk/jython/Lib/threading.py 2009-07-11 06:47:49 UTC (rev 6527) @@ -5,6 +5,7 @@ from org.python.util import jython from thread import _newFunctionThread from thread import _local as local +from _threading import Lock, RLock, Condition import java.lang.Thread import weakref @@ -55,78 +56,7 @@ global _trace_hook _trace_hook = func -def RLock(*args, **kwargs): - return _RLock(*args, **kwargs) -class _RLock(object): - def __init__(self): - self._lock = ReentrantLock() - self.__owner = None - - def acquire(self, blocking=1): - if blocking: - self._lock.lock() - self.__owner = currentThread() - return True - else: - return self._lock.tryLock() - - def __enter__(self): - self.acquire() - return self - - def release(self): - assert self._lock.isHeldByCurrentThread(), \ - "release() of un-acquire()d lock" - self.__owner = None - self._lock.unlock() - - def __exit__(self, t, v, tb): - self.release() - - def locked(self): - return self._lock.isLocked() - - def _is_owned(self): - return self._lock.isHeldByCurrentThread() - -Lock = _RLock - -class Condition(object): - def __init__(self, lock=None): - if lock is None: - lock = RLock() - self._lock = lock - self._condition = lock._lock.newCondition() - - def acquire(self): - return self._lock.acquire() - - def __enter__(self): - self.acquire() - return self - - def release(self): - return self._lock.release() - - def __exit__(self, t, v, tb): - self.release() - - def wait(self, timeout=None): - if timeout: - return self._condition.awaitNanos(int(timeout * 1e9)) - else: - return self._condition.await() - - def notify(self): - return self._condition.signal() - - def notifyAll(self): - return self._condition.signalAll() - - def _is_owned(self): - return self._lock._lock.isHeldByCurrentThread() - class Semaphore(object): def __init__(self, value=1): if value < 0: Modified: trunk/jython/src/org/python/compiler/CodeCompiler.java =================================================================== --- trunk/jython/src/org/python/compiler/CodeCompiler.java 2009-07-09 01:47:52 UTC (rev 6526) +++ trunk/jython/src/org/python/compiler/CodeCompiler.java 2009-07-11 06:47:49 UTC (rev 6527) @@ -72,6 +72,8 @@ import org.python.antlr.base.mod; import org.python.antlr.base.stmt; import org.python.core.CompilerFlags; +import org.python.core.ContextGuard; +import org.python.core.ContextManager; import org.python.core.PyComplex; import org.python.core.PyFloat; import org.python.core.PyInteger; @@ -85,6 +87,7 @@ import org.objectweb.asm.Type; import org.objectweb.asm.commons.Method; + public class CodeCompiler extends Visitor implements Opcodes, ClassConstants //, PythonGrammarTreeConstants { @@ -324,10 +327,7 @@ public int makeArray(java.util.List<? extends PythonTree> nodes) throws Exception { // XXX: This should produce an array on the stack (if possible) instead of a local - // the caller is responsible for freeing. All callers are incorrectly freeing the - // array reference -- they do call freeLocal, but without nullifying the reference - // in the local. This is causing short term memory leaks - // (e.g. test_weakref.test_getweakrefs) + // the caller is responsible for freeing. int n; if (nodes == null) @@ -2276,24 +2276,24 @@ final Label label_catch = new Label(); final Label label_end = new Label(); - final Method getattr = Method.getMethod("org.python.core.PyObject __getattr__ (String)"); - final Method call = Method.getMethod("org.python.core.PyObject __call__ (org.python.core.ThreadState)"); - final Method call3 = Method.getMethod("org.python.core.PyObject __call__ (org.python.core.ThreadState,org.python.core.PyObject,org.python.core.PyObject,org.python.core.PyObject)"); + final Method contextGuard_getManager = Method.getMethod("org.python.core.ContextManager getManager (org.python.core.PyObject)"); + final Method __enter__ = Method.getMethod("org.python.core.PyObject __enter__ (org.python.core.ThreadState)"); + final Method __exit__ = Method.getMethod("boolean __exit__ (org.python.core.ThreadState,org.python.core.PyObject,org.python.core.PyObject,org.python.core.PyObject)"); // mgr = (EXPR) visit(node.getInternalContext_expr()); + + // wrap the manager with the ContextGuard (or get it directly if it supports the ContextManager interface) + code.invokestatic(Type.getType(ContextGuard.class).getInternalName(), contextGuard_getManager.getName(), contextGuard_getManager.getDescriptor()); code.dup(); - code.ldc("__exit__"); - code.invokevirtual(Type.getType(PyObject.class).getInternalName(), getattr.getName(), getattr.getDescriptor()); - final int __exit__ = code.getLocal("org/python/core/PyObject"); - code.astore(__exit__); + final int mgr_tmp = code.getLocal(Type.getType(ContextManager.class).getInternalName()); + code.astore(mgr_tmp); + // value = mgr.__enter__() - code.ldc("__enter__"); - code.invokevirtual(Type.getType(PyObject.class).getInternalName(), getattr.getName(), getattr.getDescriptor()); loadThreadState(); - code.invokevirtual(Type.getType(PyObject.class).getInternalName(), call.getName(), call.getDescriptor()); + code.invokeinterface(Type.getType(ContextManager.class).getInternalName(), __enter__.getName(), __enter__.getDescriptor()); int value_tmp = code.getLocal("org/python/core/PyObject"); code.astore(value_tmp); @@ -2311,13 +2311,12 @@ @Override public void finalBody(CodeCompiler compiler) throws Exception { - compiler.code.aload(__exit__); + compiler.code.aload(mgr_tmp); loadThreadState(); compiler.getNone(); compiler.code.dup(); compiler.code.dup(); - compiler.code.invokevirtual(Type.getType(PyObject.class).getInternalName(), - call3.getName(), call3.getDescriptor()); + compiler.code.invokeinterface(Type.getType(ContextManager.class).getInternalName(), __exit__.getName(), __exit__.getDescriptor()); compiler.code.pop(); } }; @@ -2364,7 +2363,7 @@ // # The exceptional case is handled here // exc = False # implicit // if not exit(*sys.exc_info()): - code.aload(__exit__); + code.aload(mgr_tmp); loadThreadState(); code.aload(ts_tmp); code.getfield("org/python/core/PyException", "type", $pyObj); @@ -2374,8 +2373,7 @@ code.freeLocal(ts_tmp); code.getfield("org/python/core/PyException", "traceback", "Lorg/python/core/PyTraceback;"); code.checkcast("org/python/core/PyObject"); - code.invokevirtual(Type.getType(PyObject.class).getInternalName(), call3.getName(), call3.getDescriptor()); - code.invokevirtual("org/python/core/PyObject", "__nonzero__", "()Z"); + code.invokeinterface(Type.getType(ContextManager.class).getInternalName(), __exit__.getName(), __exit__.getDescriptor()); code.ifne(label_end); // raise // # The exception is swallowed if exit() returns true @@ -2384,7 +2382,7 @@ code.athrow(); code.label(label_end); - code.freeLocal(__exit__); + code.freeLocal(mgr_tmp); handler.addExceptionHandlers(label_catch); return null; Added: trunk/jython/src/org/python/core/ContextGuard.java =================================================================== --- trunk/jython/src/org/python/core/ContextGuard.java (rev 0) +++ trunk/jython/src/org/python/core/ContextGuard.java 2009-07-11 06:47:49 UTC (rev 6527) @@ -0,0 +1,33 @@ +package org.python.core; + +/** Straightens the call path for some common cases + */ + +// XXX - add support for generators in conjunction w/ contextlib.contextmanager + +public class ContextGuard implements ContextManager { + + private final PyObject __enter__method; + private final PyObject __exit__method; + + private ContextGuard(PyObject manager) { + __enter__method = manager.__getattr__("__enter__"); + __exit__method = manager.__getattr__("__exit__"); + } + + public PyObject __enter__(ThreadState ts) { + return __enter__method.__call__(ts); + } + + public boolean __exit__(ThreadState ts, PyObject type, PyObject value, PyObject traceback) { + return __exit__method.__call__(ts, type, value, traceback).__nonzero__(); + } + + public static ContextManager getManager(PyObject manager) { + if (manager instanceof ContextManager) { + return (ContextManager) manager; + } else { + return new ContextGuard(manager); + } + } +} Added: trunk/jython/src/org/python/core/ContextManager.java =================================================================== --- trunk/jython/src/org/python/core/ContextManager.java (rev 0) +++ trunk/jython/src/org/python/core/ContextManager.java 2009-07-11 06:47:49 UTC (rev 6527) @@ -0,0 +1,11 @@ +package org.python.core; + +/** A <code>PyObject</code> that provides <code>__enter__</code> and <code>__exit__</code> methods for use in the with-statement. + * + * Implementing context managers can then be potentially inlined by the JVM. + */ + +public interface ContextManager { + public PyObject __enter__(ThreadState ts); + public boolean __exit__(ThreadState ts, PyObject type, PyObject value, PyObject traceback); +} Modified: trunk/jython/src/org/python/core/imp.java =================================================================== --- trunk/jython/src/org/python/core/imp.java 2009-07-09 01:47:52 UTC (rev 6526) +++ trunk/jython/src/org/python/core/imp.java 2009-07-11 06:47:49 UTC (rev 6527) @@ -20,7 +20,7 @@ private static final String UNKNOWN_SOURCEFILE = "<unknown>"; - private static final int APIVersion = 23; + private static final int APIVersion = 24; public static final int NO_MTIME = -1; Modified: trunk/jython/src/org/python/modules/Setup.java =================================================================== --- trunk/jython/src/org/python/modules/Setup.java 2009-07-09 01:47:52 UTC (rev 6526) +++ trunk/jython/src/org/python/modules/Setup.java 2009-07-11 06:47:49 UTC (rev 6527) @@ -55,6 +55,7 @@ "_csv:org.python.modules._csv._csv", "_systemrestart", "_ast:org.python.antlr.ast.AstModule", - "_marshal" + "_marshal", + "_threading:org.python.modules._threading._threading" }; } Modified: trunk/jython/src/org/python/modules/_collections/Collections.java =================================================================== --- trunk/jython/src/org/python/modules/_collections/Collections.java 2009-07-09 01:47:52 UTC (rev 6526) +++ trunk/jython/src/org/python/modules/_collections/Collections.java 2009-07-11 06:47:49 UTC (rev 6527) @@ -1,7 +1,6 @@ package org.python.modules._collections; import org.python.core.ClassDictInit; -import org.python.core.PyType; import org.python.core.PyObject; /** Modified: trunk/jython/src/org/python/modules/_collections/PyDeque.java =================================================================== --- trunk/jython/src/org/python/modules/_collections/PyDeque.java 2009-07-09 01:47:52 UTC (rev 6526) +++ trunk/jython/src/org/python/modules/_collections/PyDeque.java 2009-07-11 06:47:49 UTC (rev 6527) @@ -2,19 +2,11 @@ import org.python.core.PyIterator; import org.python.core.PyObject; -import org.python.core.PySequenceIter; import org.python.core.PyTuple; import org.python.core.PyType; import org.python.core.Py; import org.python.core.PyException; -import org.python.core.PyInteger; -import org.python.core.PyLong; -import org.python.core.PyNewWrapper; -import org.python.core.PyMethodDescr; import org.python.core.PyBuiltinCallable; -import org.python.core.PyBuiltinMethod; -import org.python.core.PyBuiltinMethodNarrow; -import org.python.core.PyString; import org.python.core.ThreadState; import org.python.expose.ExposedMethod; import org.python.expose.ExposedNew; Added: trunk/jython/src/org/python/modules/_threading/Condition.java =================================================================== --- trunk/jython/src/org/python/modules/_threading/Condition.java (rev 0) +++ trunk/jython/src/org/python/modules/_threading/Condition.java 2009-07-11 06:47:49 UTC (rev 6527) @@ -0,0 +1,120 @@ +package org.python.modules._threading; + +import org.python.core.ContextManager; +import org.python.core.Py; +import org.python.core.PyNewWrapper; +import org.python.core.PyObject; +import org.python.core.PyType; +import org.python.core.ThreadState; +import org.python.expose.ExposedType; +import org.python.expose.ExposedMethod; +import org.python.expose.ExposedNew; + +@ExposedType(name = "_threading.Condition") +public class Condition extends PyObject implements ContextManager { + + public static final PyType TYPE = PyType.fromClass(Condition.class); + private final Lock _lock; + private final java.util.concurrent.locks.Condition _condition; + + public Condition() { + this(new Lock()); + } + + public Condition(Lock lock) { + _lock = lock; + _condition = lock._lock.newCondition(); + } + + @ExposedNew + final static PyObject Condition___new__ (PyNewWrapper new_, boolean init, + PyType subtype, PyObject[] args, String[] keywords) { + final int nargs = args.length; + if (nargs == 1) { + return new Condition((Lock)args[0]); + } + return new Condition(); + } + + public boolean acquire() { + return Condition_acquire(); + } + + @ExposedMethod + final boolean Condition_acquire() { + return _lock.acquire(); + } + + public PyObject __enter__(ThreadState ts) { + _lock.acquire(); + return this; + } + + @ExposedMethod + final PyObject Condition___enter__() { + Condition_acquire(); + return this; + } + + public void release() { + Condition_release(); + } + + @ExposedMethod + final void Condition_release() { + _lock.release(); + } + + public boolean __exit__(ThreadState ts, PyObject type, PyObject value, PyObject traceback) { + _lock.release(); + return false; + } + + @ExposedMethod + final boolean Condition___exit__(PyObject type, PyObject value, PyObject traceback) { + Condition_release(); + return false; + } + + public void wait$(PyObject timeout) throws InterruptedException { + Condition_wait(timeout); + } + + @ExposedMethod(defaults = "Py.None") + final void Condition_wait(PyObject timeout) throws InterruptedException { + if (timeout == Py.None) { + _condition.await(); + } else { + long nanos = (long) (timeout.__float__().asDouble() * 1e9); + _condition.awaitNanos(nanos); + } + } + + public void notify$() { + Condition_notify(); + } + + @ExposedMethod + final void Condition_notify() { + _condition.signal(); + } + + public void notifyAll$() { + Condition_notifyAll(); + } + + @ExposedMethod + final void Condition_notifyAll() { + _condition.signalAll(); + } + + public boolean _is_owned() { + return Condition__is_owned(); + } + + @ExposedMethod + final boolean Condition__is_owned() { + return _lock._lock.isHeldByCurrentThread(); + } +} + Added: trunk/jython/src/org/python/modules/_threading/Lock.java =================================================================== --- trunk/jython/src/org/python/modules/_threading/Lock.java (rev 0) +++ trunk/jython/src/org/python/modules/_threading/Lock.java 2009-07-11 06:47:49 UTC (rev 6527) @@ -0,0 +1,101 @@ +package org.python.modules._threading; + +import java.util.concurrent.locks.ReentrantLock; +import org.python.core.ContextManager; +import org.python.core.Py; +import org.python.core.PyNewWrapper; +import org.python.core.PyObject; +import org.python.core.PyType; +import org.python.core.ThreadState; +import org.python.expose.ExposedMethod; +import org.python.expose.ExposedNew; +import org.python.expose.ExposedType; + +@ExposedType(name = "_threading.Lock") +public class Lock extends PyObject implements ContextManager { + + public static final PyType TYPE = PyType.fromClass(Lock.class); + final ReentrantLock _lock; + + public Lock() { + _lock = new ReentrantLock(); + } + + @ExposedNew + final static PyObject Lock___new__ (PyNewWrapper new_, boolean init, + PyType subtype, PyObject[] args, String[] keywords) { + final int nargs = args.length; + return new Lock(); + } + + + @ExposedMethod(defaults = "true") + final boolean Lock_acquire(boolean blocking) { + if (blocking) { + _lock.lock(); + return true; + } else { + return _lock.tryLock(); + } + } + + public boolean acquire() { + return Lock_acquire(true); + } + + public boolean acquire(boolean blocking) { + return Lock_acquire(blocking); + } + + @ExposedMethod + final PyObject Lock___enter__() { + _lock.lock(); + return this; + } + + public PyObject __enter__(ThreadState ts) { + _lock.lock(); + return this; + } + + @ExposedMethod + final void Lock_release() { + if (!_lock.isHeldByCurrentThread()) { + throw Py.AssertionError("release() of un-acquire()d lock"); + } + _lock.unlock(); + } + + public void release() { + Lock_release(); + } + + @ExposedMethod + final boolean Lock___exit__(PyObject type, PyObject value, PyObject traceback) { + _lock.unlock(); + return false; + } + + public boolean __exit__(ThreadState ts, PyObject type, PyObject value, PyObject traceback) { + _lock.unlock(); + return false; + } + + @ExposedMethod + final boolean Lock_locked() { + return _lock.isLocked(); + } + + public boolean locked() { + return Lock_locked(); + } + + @ExposedMethod + final boolean Lock__is_owned() { + return _lock.isHeldByCurrentThread(); + } + + public boolean _is_owned() { + return Lock__is_owned(); + } +} Added: trunk/jython/src/org/python/modules/_threading/_threading.java =================================================================== --- trunk/jython/src/org/python/modules/_threading/_threading.java (rev 0) +++ trunk/jython/src/org/python/modules/_threading/_threading.java 2009-07-11 06:47:49 UTC (rev 6527) @@ -0,0 +1,15 @@ +package org.python.modules._threading; + +import org.python.core.ClassDictInit; +import org.python.core.Py; +import org.python.core.PyObject; + +public class _threading implements ClassDictInit { + + public static void classDictInit(PyObject dict) { + dict.__setitem__("__name__", Py.newString("_threading")); + dict.__setitem__("Lock", Lock.TYPE); + dict.__setitem__("RLock", Lock.TYPE); + dict.__setitem__("Condition", Condition.TYPE); + } +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cg...@us...> - 2009-07-09 01:47:59
|
Revision: 6526 http://jython.svn.sourceforge.net/jython/?rev=6526&view=rev Author: cgroves Date: 2009-07-09 01:47:52 +0000 (Thu, 09 Jul 2009) Log Message: ----------- Ensure that Thread.group is None since we're not doing anything with it, and that's what CPython does Modified Paths: -------------- trunk/jython/Lib/threading.py Modified: trunk/jython/Lib/threading.py =================================================================== --- trunk/jython/Lib/threading.py 2009-07-07 21:13:06 UTC (rev 6525) +++ trunk/jython/Lib/threading.py 2009-07-09 01:47:52 UTC (rev 6526) @@ -218,6 +218,7 @@ class Thread(JavaThread): def __init__(self, group=None, target=None, name=None, args=None, kwargs=None): + assert group is None, "group argument must be None for now" _thread = self._create_thread() JavaThread.__init__(self, _thread) if args is None: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <am...@us...> - 2009-07-07 21:13:07
|
Revision: 6525 http://jython.svn.sourceforge.net/jython/?rev=6525&view=rev Author: amak Date: 2009-07-07 21:13:06 +0000 (Tue, 07 Jul 2009) Log Message: ----------- Javadoc corrections. Modified Paths: -------------- trunk/jython/build.xml trunk/jython/src/com/xhaus/modjy/ModjyJServlet.java Modified: trunk/jython/build.xml =================================================================== --- trunk/jython/build.xml 2009-07-07 19:31:47 UTC (rev 6524) +++ trunk/jython/build.xml 2009-07-07 21:13:06 UTC (rev 6525) @@ -626,7 +626,7 @@ source="${jdk.source.version}" public="true" breakiterator="yes" - packagenames="org.python.core, org.python.util, com.ziclix.python.sql" + packagenames="org.python.core, org.python.util, com.ziclix.python.sql, com.xhaus.modjy" windowtitle="Jython API documentation" bottom="<a href='http://www.jython.org' target='_top'>Jython homepage</a>" > Modified: trunk/jython/src/com/xhaus/modjy/ModjyJServlet.java =================================================================== --- trunk/jython/src/com/xhaus/modjy/ModjyJServlet.java 2009-07-07 19:31:47 UTC (rev 6524) +++ trunk/jython/src/com/xhaus/modjy/ModjyJServlet.java 2009-07-07 21:13:06 UTC (rev 6525) @@ -54,9 +54,11 @@ protected HttpServlet modjyServlet; /** - * Read configuration 1. Both context and servlet parameters are included in the set, so that + * Read configuration + * 1. Both context and servlet parameters are included in the set, so that * the definition of some parameters (e.g python.*) can be shared between multiple WSGI - * servlets. 2. servlet params take precedence over context parameters + * servlets. + * 2. servlet params take precedence over context parameters */ protected Properties readConfiguration() { Properties props = new Properties(); @@ -77,8 +79,11 @@ } /** - * Initialise the modjy servlet. 1. Read the configuration 2. Initialise the jython runtime 3. - * Setup, in relation to the J2EE servlet environment 4. Create the jython-implemented servlet + * Initialise the modjy servlet. + * 1. Read the configuration + * 2. Initialise the jython runtime + * 3. Setup, in relation to the J2EE servlet environment + * 4. Create the jython-implemented servlet * 5. Initialise the jython-implemented servlet */ @Override @@ -110,9 +115,9 @@ /** * Actually service the incoming request. Simply delegate to the jython servlet. * - * @param request + * @param req * - The incoming HttpServletRequest - * @param response + * @param resp * - The outgoing HttpServletResponse */ @Override @@ -131,8 +136,6 @@ * - The properties from which config options are found * @param systemState * - The PySystemState corresponding to the interpreter servicing requests - * @returns A String giving the path to the modjy.jar file (which is used only for error - * reporting) */ protected void setupEnvironment(PythonInterpreter interp, Properties props, @@ -144,7 +147,7 @@ * Do all processing in relation to the lib-python subdirectory of WEB-INF * * @param interp - * - The PythinInterpreter used to service requests + * - The PythonInterpreter used to service requests * @param systemState * - The PySystemState whose path should be updated */ @@ -167,6 +170,8 @@ /** * Process an individual file .pth file in the lib-python directory * + * @param interp + * - The PythonInterpreter which will execute imports * @param systemState * - The PySystemState whose path should be updated * @param pythonLibPath This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fwi...@us...> - 2009-07-07 19:31:57
|
Revision: 6524 http://jython.svn.sourceforge.net/jython/?rev=6524&view=rev Author: fwierzbicki Date: 2009-07-07 19:31:47 +0000 (Tue, 07 Jul 2009) Log Message: ----------- Merged revisions 6061-6065,6071,6074-6082,6084-6088,6090,6093-6120,6124-6132,6135,6137-6142,6148-6150,6152-6159,6161-6167,6169-6175,6177-6185,6187-6189,6193-6194,6198,6203-6205,6208-6214,6218-6221,6224-6226,6230,6232-6236,6241,6243-6267,6269,6277-6283,6286-6292,6295-6306,6309-6338,6340-6341,6343-6359,6361-6374,6376-6385,6387-6397,6407-6462,6464-6470,6473-6475 via svnmerge from https://jython.svn.sourceforge.net/svnroot/jython/trunk/jython Modified Paths: -------------- trunk/sandbox/wierzbicki/test27/.classpath trunk/sandbox/wierzbicki/test27/ACKNOWLEDGMENTS trunk/sandbox/wierzbicki/test27/CPythonLib.includes trunk/sandbox/wierzbicki/test27/CoreExposed.includes trunk/sandbox/wierzbicki/test27/Lib/codeop.py trunk/sandbox/wierzbicki/test27/Lib/compiler/pycodegen.py trunk/sandbox/wierzbicki/test27/Lib/compiler/transformer.py trunk/sandbox/wierzbicki/test27/Lib/javashell.py trunk/sandbox/wierzbicki/test27/Lib/new.py trunk/sandbox/wierzbicki/test27/Lib/os.py trunk/sandbox/wierzbicki/test27/Lib/pkgutil.py trunk/sandbox/wierzbicki/test27/Lib/popen2.py trunk/sandbox/wierzbicki/test27/Lib/posixpath.py trunk/sandbox/wierzbicki/test27/Lib/select.py trunk/sandbox/wierzbicki/test27/Lib/socket.py trunk/sandbox/wierzbicki/test27/Lib/subprocess.py trunk/sandbox/wierzbicki/test27/Lib/tarfile.py trunk/sandbox/wierzbicki/test27/Lib/tempfile.py trunk/sandbox/wierzbicki/test27/Lib/test/check_for_initializer_in_syspath.py trunk/sandbox/wierzbicki/test27/Lib/test/classimport.jar trunk/sandbox/wierzbicki/test27/Lib/test/classimport_Lib.jar trunk/sandbox/wierzbicki/test27/Lib/test/output/test_profile trunk/sandbox/wierzbicki/test27/Lib/test/python_home.policy trunk/sandbox/wierzbicki/test27/Lib/test/regrtest.py trunk/sandbox/wierzbicki/test27/Lib/test/test_ast_jy.py trunk/sandbox/wierzbicki/test27/Lib/test/test_builtin_jy.py trunk/sandbox/wierzbicki/test27/Lib/test/test_chdir.py trunk/sandbox/wierzbicki/test27/Lib/test/test_class_jy.py trunk/sandbox/wierzbicki/test27/Lib/test/test_classpathimporter.py trunk/sandbox/wierzbicki/test27/Lib/test/test_cmd_line.py trunk/sandbox/wierzbicki/test27/Lib/test/test_cmp_jy.py trunk/sandbox/wierzbicki/test27/Lib/test/test_codeop.py trunk/sandbox/wierzbicki/test27/Lib/test/test_codeop_jy.py trunk/sandbox/wierzbicki/test27/Lib/test/test_complex_jy.py trunk/sandbox/wierzbicki/test27/Lib/test/test_cpickle_jy.py trunk/sandbox/wierzbicki/test27/Lib/test/test_descr.py trunk/sandbox/wierzbicki/test27/Lib/test/test_descr_jy.py trunk/sandbox/wierzbicki/test27/Lib/test/test_dict_jy.py trunk/sandbox/wierzbicki/test27/Lib/test/test_dictproxy_jy.py trunk/sandbox/wierzbicki/test27/Lib/test/test_eof_jy.py trunk/sandbox/wierzbicki/test27/Lib/test/test_file.py trunk/sandbox/wierzbicki/test27/Lib/test/test_fileno.py trunk/sandbox/wierzbicki/test27/Lib/test/test_float_jy.py trunk/sandbox/wierzbicki/test27/Lib/test/test_func_syntax_jy.py trunk/sandbox/wierzbicki/test27/Lib/test/test_import_jy.py trunk/sandbox/wierzbicki/test27/Lib/test/test_java_integration.py trunk/sandbox/wierzbicki/test27/Lib/test/test_java_subclasses.py trunk/sandbox/wierzbicki/test27/Lib/test/test_java_visibility.py trunk/sandbox/wierzbicki/test27/Lib/test/test_javalist.py trunk/sandbox/wierzbicki/test27/Lib/test/test_largefile.py trunk/sandbox/wierzbicki/test27/Lib/test/test_list_jy.py trunk/sandbox/wierzbicki/test27/Lib/test/test_marshal.py trunk/sandbox/wierzbicki/test27/Lib/test/test_pkgimport.py trunk/sandbox/wierzbicki/test27/Lib/test/test_repr.py trunk/sandbox/wierzbicki/test27/Lib/test/test_sax.py trunk/sandbox/wierzbicki/test27/Lib/test/test_scope.py trunk/sandbox/wierzbicki/test27/Lib/test/test_set.py trunk/sandbox/wierzbicki/test27/Lib/test/test_set_jy.py trunk/sandbox/wierzbicki/test27/Lib/test/test_signal.py trunk/sandbox/wierzbicki/test27/Lib/test/test_slots_jy.py trunk/sandbox/wierzbicki/test27/Lib/test/test_socket.py trunk/sandbox/wierzbicki/test27/Lib/test/test_str_jy.py trunk/sandbox/wierzbicki/test27/Lib/test/test_subprocess.py trunk/sandbox/wierzbicki/test27/Lib/test/test_subprocess_jy.py trunk/sandbox/wierzbicki/test27/Lib/test/test_support.py trunk/sandbox/wierzbicki/test27/Lib/test/test_tarfile.py trunk/sandbox/wierzbicki/test27/Lib/test/test_tempfile.py trunk/sandbox/wierzbicki/test27/Lib/test/test_traceback.py trunk/sandbox/wierzbicki/test27/Lib/test/test_unicode.py trunk/sandbox/wierzbicki/test27/Lib/test/test_unicode_jy.py trunk/sandbox/wierzbicki/test27/Lib/test/test_weakref.py trunk/sandbox/wierzbicki/test27/Lib/threading.py trunk/sandbox/wierzbicki/test27/Lib/unicodedata.py trunk/sandbox/wierzbicki/test27/Lib/xml/parsers/expat.py trunk/sandbox/wierzbicki/test27/Misc/make_binops.py trunk/sandbox/wierzbicki/test27/NEWS trunk/sandbox/wierzbicki/test27/README.txt trunk/sandbox/wierzbicki/test27/Tools/jythonc/SrcGenCompiler.py trunk/sandbox/wierzbicki/test27/ast/asdl_antlr.py trunk/sandbox/wierzbicki/test27/bugtests/classes/test292j.java trunk/sandbox/wierzbicki/test27/build.xml trunk/sandbox/wierzbicki/test27/extlibs/jna-posix.jar trunk/sandbox/wierzbicki/test27/extlibs/jna.jar trunk/sandbox/wierzbicki/test27/grammar/Python.g trunk/sandbox/wierzbicki/test27/grammar/PythonPartial.g trunk/sandbox/wierzbicki/test27/maven/build.xml trunk/sandbox/wierzbicki/test27/registry trunk/sandbox/wierzbicki/test27/src/com/ziclix/python/sql/DataHandler.java trunk/sandbox/wierzbicki/test27/src/com/ziclix/python/sql/Fetch.java trunk/sandbox/wierzbicki/test27/src/com/ziclix/python/sql/JDBC20DataHandler.java trunk/sandbox/wierzbicki/test27/src/com/ziclix/python/sql/Jython22DataHandler.java trunk/sandbox/wierzbicki/test27/src/com/ziclix/python/sql/PyCursor.java trunk/sandbox/wierzbicki/test27/src/com/ziclix/python/sql/handler/InformixDataHandler.java trunk/sandbox/wierzbicki/test27/src/com/ziclix/python/sql/handler/MySQLDataHandler.java trunk/sandbox/wierzbicki/test27/src/com/ziclix/python/sql/handler/OracleDataHandler.java trunk/sandbox/wierzbicki/test27/src/com/ziclix/python/sql/handler/PostgresqlDataHandler.java trunk/sandbox/wierzbicki/test27/src/org/python/Version.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/BaseParser.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/GrammarActions.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/PythonTree.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/PythonTreeAdaptor.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/ast/Assert.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/ast/AssertDerived.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/ast/Assign.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/ast/AssignDerived.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/ast/AstModule.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/ast/Attribute.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/ast/AttributeDerived.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/ast/AugAssign.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/ast/AugAssignDerived.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/ast/BinOp.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/ast/BinOpDerived.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/ast/BoolOp.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/ast/BoolOpDerived.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/ast/Break.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/ast/BreakDerived.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/ast/Call.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/ast/CallDerived.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/ast/ClassDef.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/ast/ClassDefDerived.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/ast/Compare.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/ast/CompareDerived.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/ast/Continue.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/ast/ContinueDerived.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/ast/Delete.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/ast/DeleteDerived.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/ast/Dict.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/ast/DictDerived.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/ast/Ellipsis.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/ast/EllipsisDerived.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/ast/ExceptHandler.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/ast/ExceptHandlerDerived.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/ast/Exec.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/ast/ExecDerived.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/ast/Expr.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/ast/ExprDerived.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/ast/Expression.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/ast/ExpressionDerived.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/ast/ExtSlice.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/ast/ExtSliceDerived.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/ast/For.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/ast/ForDerived.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/ast/FunctionDef.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/ast/FunctionDefDerived.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/ast/GeneratorExp.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/ast/GeneratorExpDerived.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/ast/Global.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/ast/GlobalDerived.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/ast/If.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/ast/IfDerived.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/ast/IfExp.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/ast/IfExpDerived.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/ast/Import.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/ast/ImportDerived.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/ast/ImportFrom.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/ast/ImportFromDerived.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/ast/Index.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/ast/IndexDerived.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/ast/Interactive.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/ast/InteractiveDerived.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/ast/Lambda.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/ast/LambdaDerived.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/ast/List.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/ast/ListComp.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/ast/ListCompDerived.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/ast/ListDerived.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/ast/Module.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/ast/ModuleDerived.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/ast/Name.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/ast/NameDerived.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/ast/Num.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/ast/NumDerived.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/ast/Pass.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/ast/PassDerived.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/ast/Print.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/ast/PrintDerived.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/ast/Raise.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/ast/RaiseDerived.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/ast/Repr.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/ast/ReprDerived.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/ast/Return.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/ast/ReturnDerived.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/ast/Slice.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/ast/SliceDerived.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/ast/Str.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/ast/StrDerived.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/ast/Subscript.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/ast/SubscriptDerived.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/ast/Suite.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/ast/SuiteDerived.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/ast/TryExcept.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/ast/TryExceptDerived.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/ast/TryFinally.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/ast/TryFinallyDerived.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/ast/Tuple.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/ast/TupleDerived.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/ast/UnaryOp.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/ast/UnaryOpDerived.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/ast/While.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/ast/WhileDerived.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/ast/With.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/ast/WithDerived.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/ast/Yield.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/ast/YieldDerived.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/ast/alias.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/ast/aliasDerived.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/ast/arguments.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/ast/argumentsDerived.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/ast/comprehension.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/ast/comprehensionDerived.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/ast/keyword.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/ast/keywordDerived.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/op/AddDerived.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/op/AndDerived.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/op/AugLoadDerived.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/op/AugStoreDerived.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/op/BitAndDerived.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/op/BitOrDerived.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/op/BitXorDerived.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/op/DelDerived.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/op/DivDerived.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/op/EqDerived.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/op/FloorDivDerived.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/op/GtDerived.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/op/GtEDerived.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/op/InDerived.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/op/InvertDerived.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/op/IsDerived.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/op/IsNotDerived.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/op/LShiftDerived.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/op/LoadDerived.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/op/LtDerived.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/op/LtEDerived.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/op/ModDerived.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/op/MultDerived.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/op/NotDerived.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/op/NotEqDerived.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/op/NotInDerived.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/op/OrDerived.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/op/ParamDerived.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/op/PowDerived.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/op/RShiftDerived.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/op/StoreDerived.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/op/SubDerived.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/op/UAddDerived.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/op/USubDerived.java trunk/sandbox/wierzbicki/test27/src/org/python/compiler/ClassConstants.java trunk/sandbox/wierzbicki/test27/src/org/python/compiler/ClassFile.java trunk/sandbox/wierzbicki/test27/src/org/python/compiler/Code.java trunk/sandbox/wierzbicki/test27/src/org/python/compiler/CodeCompiler.java trunk/sandbox/wierzbicki/test27/src/org/python/compiler/Future.java trunk/sandbox/wierzbicki/test27/src/org/python/compiler/Module.java trunk/sandbox/wierzbicki/test27/src/org/python/core/ArgParser.java trunk/sandbox/wierzbicki/test27/src/org/python/core/AstList.java trunk/sandbox/wierzbicki/test27/src/org/python/core/BaseSet.java trunk/sandbox/wierzbicki/test27/src/org/python/core/BytecodeLoader.java trunk/sandbox/wierzbicki/test27/src/org/python/core/ClasspathPyImporter.java trunk/sandbox/wierzbicki/test27/src/org/python/core/ClasspathPyImporterDerived.java trunk/sandbox/wierzbicki/test27/src/org/python/core/CompilerFlags.java trunk/sandbox/wierzbicki/test27/src/org/python/core/FunctionThread.java trunk/sandbox/wierzbicki/test27/src/org/python/core/InitModule.java trunk/sandbox/wierzbicki/test27/src/org/python/core/JavaImportHelper.java trunk/sandbox/wierzbicki/test27/src/org/python/core/ParserFacade.java trunk/sandbox/wierzbicki/test27/src/org/python/core/Py.java trunk/sandbox/wierzbicki/test27/src/org/python/core/PyArray.java trunk/sandbox/wierzbicki/test27/src/org/python/core/PyArrayDerived.java trunk/sandbox/wierzbicki/test27/src/org/python/core/PyBaseCode.java trunk/sandbox/wierzbicki/test27/src/org/python/core/PyBaseExceptionDerived.java trunk/sandbox/wierzbicki/test27/src/org/python/core/PyBaseString.java trunk/sandbox/wierzbicki/test27/src/org/python/core/PyBooleanDerived.java trunk/sandbox/wierzbicki/test27/src/org/python/core/PyBuiltinMethod.java trunk/sandbox/wierzbicki/test27/src/org/python/core/PyBuiltinMethodSet.java trunk/sandbox/wierzbicki/test27/src/org/python/core/PyBytecode.java trunk/sandbox/wierzbicki/test27/src/org/python/core/PyCallIter.java trunk/sandbox/wierzbicki/test27/src/org/python/core/PyClass.java trunk/sandbox/wierzbicki/test27/src/org/python/core/PyClassMethodDerived.java trunk/sandbox/wierzbicki/test27/src/org/python/core/PyCode.java trunk/sandbox/wierzbicki/test27/src/org/python/core/PyComplex.java trunk/sandbox/wierzbicki/test27/src/org/python/core/PyComplexDerived.java trunk/sandbox/wierzbicki/test27/src/org/python/core/PyDictProxy.java trunk/sandbox/wierzbicki/test27/src/org/python/core/PyDictionary.java trunk/sandbox/wierzbicki/test27/src/org/python/core/PyDictionaryDerived.java trunk/sandbox/wierzbicki/test27/src/org/python/core/PyEnumerateDerived.java trunk/sandbox/wierzbicki/test27/src/org/python/core/PyException.java trunk/sandbox/wierzbicki/test27/src/org/python/core/PyFastSequenceIter.java trunk/sandbox/wierzbicki/test27/src/org/python/core/PyFile.java trunk/sandbox/wierzbicki/test27/src/org/python/core/PyFileDerived.java trunk/sandbox/wierzbicki/test27/src/org/python/core/PyFloat.java trunk/sandbox/wierzbicki/test27/src/org/python/core/PyFloatDerived.java trunk/sandbox/wierzbicki/test27/src/org/python/core/PyFrame.java trunk/sandbox/wierzbicki/test27/src/org/python/core/PyFrozenSetDerived.java trunk/sandbox/wierzbicki/test27/src/org/python/core/PyFunction.java trunk/sandbox/wierzbicki/test27/src/org/python/core/PyFunctionTable.java trunk/sandbox/wierzbicki/test27/src/org/python/core/PyGenerator.java trunk/sandbox/wierzbicki/test27/src/org/python/core/PyInstance.java trunk/sandbox/wierzbicki/test27/src/org/python/core/PyInteger.java trunk/sandbox/wierzbicki/test27/src/org/python/core/PyIntegerDerived.java trunk/sandbox/wierzbicki/test27/src/org/python/core/PyJavaType.java trunk/sandbox/wierzbicki/test27/src/org/python/core/PyList.java trunk/sandbox/wierzbicki/test27/src/org/python/core/PyListDerived.java trunk/sandbox/wierzbicki/test27/src/org/python/core/PyLong.java trunk/sandbox/wierzbicki/test27/src/org/python/core/PyLongDerived.java trunk/sandbox/wierzbicki/test27/src/org/python/core/PyMethod.java trunk/sandbox/wierzbicki/test27/src/org/python/core/PyModuleDerived.java trunk/sandbox/wierzbicki/test27/src/org/python/core/PyObject.java trunk/sandbox/wierzbicki/test27/src/org/python/core/PyObjectDerived.java trunk/sandbox/wierzbicki/test27/src/org/python/core/PyPropertyDerived.java trunk/sandbox/wierzbicki/test27/src/org/python/core/PyReflectedFunction.java trunk/sandbox/wierzbicki/test27/src/org/python/core/PySequence.java trunk/sandbox/wierzbicki/test27/src/org/python/core/PySequenceIter.java trunk/sandbox/wierzbicki/test27/src/org/python/core/PySequenceList.java trunk/sandbox/wierzbicki/test27/src/org/python/core/PySet.java trunk/sandbox/wierzbicki/test27/src/org/python/core/PySetDerived.java trunk/sandbox/wierzbicki/test27/src/org/python/core/PySlice.java trunk/sandbox/wierzbicki/test27/src/org/python/core/PySliceDerived.java trunk/sandbox/wierzbicki/test27/src/org/python/core/PyString.java trunk/sandbox/wierzbicki/test27/src/org/python/core/PyStringDerived.java trunk/sandbox/wierzbicki/test27/src/org/python/core/PyStringMap.java trunk/sandbox/wierzbicki/test27/src/org/python/core/PySuperDerived.java trunk/sandbox/wierzbicki/test27/src/org/python/core/PySystemState.java trunk/sandbox/wierzbicki/test27/src/org/python/core/PyTableCode.java trunk/sandbox/wierzbicki/test27/src/org/python/core/PyTraceback.java trunk/sandbox/wierzbicki/test27/src/org/python/core/PyTuple.java trunk/sandbox/wierzbicki/test27/src/org/python/core/PyTupleDerived.java trunk/sandbox/wierzbicki/test27/src/org/python/core/PyType.java trunk/sandbox/wierzbicki/test27/src/org/python/core/PyTypeDerived.java trunk/sandbox/wierzbicki/test27/src/org/python/core/PyUnicode.java trunk/sandbox/wierzbicki/test27/src/org/python/core/PyUnicodeDerived.java trunk/sandbox/wierzbicki/test27/src/org/python/core/PyXRange.java trunk/sandbox/wierzbicki/test27/src/org/python/core/ReflectedArgs.java trunk/sandbox/wierzbicki/test27/src/org/python/core/StdoutWrapper.java trunk/sandbox/wierzbicki/test27/src/org/python/core/SyspathJavaLoader.java trunk/sandbox/wierzbicki/test27/src/org/python/core/__builtin__.java trunk/sandbox/wierzbicki/test27/src/org/python/core/codecs.java trunk/sandbox/wierzbicki/test27/src/org/python/core/exceptions.java trunk/sandbox/wierzbicki/test27/src/org/python/core/imp.java trunk/sandbox/wierzbicki/test27/src/org/python/core/io/BufferedIOMixin.java trunk/sandbox/wierzbicki/test27/src/org/python/core/io/BufferedWriter.java trunk/sandbox/wierzbicki/test27/src/org/python/core/io/FileIO.java trunk/sandbox/wierzbicki/test27/src/org/python/core/io/IOBase.java trunk/sandbox/wierzbicki/test27/src/org/python/core/io/LineBufferedWriter.java trunk/sandbox/wierzbicki/test27/src/org/python/core/io/StreamIO.java trunk/sandbox/wierzbicki/test27/src/org/python/core/io/UniversalIOWrapper.java trunk/sandbox/wierzbicki/test27/src/org/python/core/packagecache/CachedJarsPackageManager.java trunk/sandbox/wierzbicki/test27/src/org/python/core/packagecache/PackageManager.java trunk/sandbox/wierzbicki/test27/src/org/python/core/packagecache/PathPackageManager.java trunk/sandbox/wierzbicki/test27/src/org/python/core/util/ConcurrentHashSet.java trunk/sandbox/wierzbicki/test27/src/org/python/core/util/FileUtil.java trunk/sandbox/wierzbicki/test27/src/org/python/core/util/StringUtil.java trunk/sandbox/wierzbicki/test27/src/org/python/core/util/importer.java trunk/sandbox/wierzbicki/test27/src/org/python/expose/generate/ExposeTask.java trunk/sandbox/wierzbicki/test27/src/org/python/modules/PyTeeIterator.java trunk/sandbox/wierzbicki/test27/src/org/python/modules/Setup.java trunk/sandbox/wierzbicki/test27/src/org/python/modules/_codecs.java trunk/sandbox/wierzbicki/test27/src/org/python/modules/_collections/PyDefaultDictDerived.java trunk/sandbox/wierzbicki/test27/src/org/python/modules/_collections/PyDeque.java trunk/sandbox/wierzbicki/test27/src/org/python/modules/_collections/PyDequeDerived.java trunk/sandbox/wierzbicki/test27/src/org/python/modules/_csv/PyDialectDerived.java trunk/sandbox/wierzbicki/test27/src/org/python/modules/_csv/PyReader.java trunk/sandbox/wierzbicki/test27/src/org/python/modules/_functools/PyPartialDerived.java trunk/sandbox/wierzbicki/test27/src/org/python/modules/_marshal.java trunk/sandbox/wierzbicki/test27/src/org/python/modules/_weakref/AbstractReference.java trunk/sandbox/wierzbicki/test27/src/org/python/modules/_weakref/GlobalRef.java trunk/sandbox/wierzbicki/test27/src/org/python/modules/_weakref/ReferenceType.java trunk/sandbox/wierzbicki/test27/src/org/python/modules/_weakref/ReferenceTypeDerived.java trunk/sandbox/wierzbicki/test27/src/org/python/modules/_weakref/WeakrefModule.java trunk/sandbox/wierzbicki/test27/src/org/python/modules/binascii.java trunk/sandbox/wierzbicki/test27/src/org/python/modules/cPickle.java trunk/sandbox/wierzbicki/test27/src/org/python/modules/cStringIO.java trunk/sandbox/wierzbicki/test27/src/org/python/modules/imp.java trunk/sandbox/wierzbicki/test27/src/org/python/modules/itertools.java trunk/sandbox/wierzbicki/test27/src/org/python/modules/math.java trunk/sandbox/wierzbicki/test27/src/org/python/modules/random/PyRandom.java trunk/sandbox/wierzbicki/test27/src/org/python/modules/random/PyRandomDerived.java trunk/sandbox/wierzbicki/test27/src/org/python/modules/sre/PatternObject.java trunk/sandbox/wierzbicki/test27/src/org/python/modules/sre/SRE_STATE.java trunk/sandbox/wierzbicki/test27/src/org/python/modules/thread/PyLocalDerived.java trunk/sandbox/wierzbicki/test27/src/org/python/modules/time/Time.java trunk/sandbox/wierzbicki/test27/src/org/python/modules/zipimport/zipimporter.java trunk/sandbox/wierzbicki/test27/src/org/python/modules/zipimport/zipimporterDerived.java trunk/sandbox/wierzbicki/test27/src/org/python/util/Generic.java trunk/sandbox/wierzbicki/test27/src/org/python/util/InteractiveConsole.java trunk/sandbox/wierzbicki/test27/src/org/python/util/InteractiveInterpreter.java trunk/sandbox/wierzbicki/test27/src/org/python/util/JLineConsole.java trunk/sandbox/wierzbicki/test27/src/org/python/util/JythoncAntTask.java trunk/sandbox/wierzbicki/test27/src/org/python/util/PythonInterpreter.java trunk/sandbox/wierzbicki/test27/src/org/python/util/jython.java trunk/sandbox/wierzbicki/test27/src/shell/jython trunk/sandbox/wierzbicki/test27/src/shell/jython.bat trunk/sandbox/wierzbicki/test27/src/templates/README.txt trunk/sandbox/wierzbicki/test27/src/templates/object.derived trunk/sandbox/wierzbicki/test27/tests/java/javatests/Dict2JavaTest.java trunk/sandbox/wierzbicki/test27/tests/java/org/python/antlr/PythonTreeTester.java trunk/sandbox/wierzbicki/test27/tests/java/org/python/expose/generate/MethodExposerTest.java trunk/sandbox/wierzbicki/test27/tests/java/org/python/tests/CustomizableMapHolder.java trunk/sandbox/wierzbicki/test27/tests/shell/test-jython.sh Added Paths: ----------- trunk/sandbox/wierzbicki/test27/Demo/modjy_webapp/ trunk/sandbox/wierzbicki/test27/Demo/modjy_webapp/WEB-INF/ trunk/sandbox/wierzbicki/test27/Demo/modjy_webapp/WEB-INF/lib/ trunk/sandbox/wierzbicki/test27/Demo/modjy_webapp/WEB-INF/lib/readme.txt trunk/sandbox/wierzbicki/test27/Demo/modjy_webapp/WEB-INF/lib-python/ trunk/sandbox/wierzbicki/test27/Demo/modjy_webapp/WEB-INF/lib-python/readme.txt trunk/sandbox/wierzbicki/test27/Demo/modjy_webapp/WEB-INF/web.xml trunk/sandbox/wierzbicki/test27/Demo/modjy_webapp/demo_app.py trunk/sandbox/wierzbicki/test27/Demo/modjy_webapp/readme.txt trunk/sandbox/wierzbicki/test27/Lib/SimpleHTTPServer.py trunk/sandbox/wierzbicki/test27/Lib/distutils/command/build_scripts.py trunk/sandbox/wierzbicki/test27/Lib/distutils/command/install_scripts.py trunk/sandbox/wierzbicki/test27/Lib/gettext.py trunk/sandbox/wierzbicki/test27/Lib/mailbox.py trunk/sandbox/wierzbicki/test27/Lib/modjy/ trunk/sandbox/wierzbicki/test27/Lib/modjy/__init__.py trunk/sandbox/wierzbicki/test27/Lib/modjy/modjy.py trunk/sandbox/wierzbicki/test27/Lib/modjy/modjy_exceptions.py trunk/sandbox/wierzbicki/test27/Lib/modjy/modjy_impl.py trunk/sandbox/wierzbicki/test27/Lib/modjy/modjy_log.py trunk/sandbox/wierzbicki/test27/Lib/modjy/modjy_params.py trunk/sandbox/wierzbicki/test27/Lib/modjy/modjy_publish.py trunk/sandbox/wierzbicki/test27/Lib/modjy/modjy_response.py trunk/sandbox/wierzbicki/test27/Lib/modjy/modjy_write.py trunk/sandbox/wierzbicki/test27/Lib/modjy/modjy_wsgi.py trunk/sandbox/wierzbicki/test27/Lib/netrc.py trunk/sandbox/wierzbicki/test27/Lib/test/badsyntax_eof1.py trunk/sandbox/wierzbicki/test27/Lib/test/bug1126/ trunk/sandbox/wierzbicki/test27/Lib/test/bug1126/bug1126.jar trunk/sandbox/wierzbicki/test27/Lib/test/call_overridden_method.py trunk/sandbox/wierzbicki/test27/Lib/test/module_deleter.py trunk/sandbox/wierzbicki/test27/Lib/test/output/test_types_pyc trunk/sandbox/wierzbicki/test27/Lib/test/pbcvm/ trunk/sandbox/wierzbicki/test27/Lib/test/pbcvm/test/ trunk/sandbox/wierzbicki/test27/Lib/test/pbcvm/test/README trunk/sandbox/wierzbicki/test27/Lib/test/pbcvm/test/__init__.py trunk/sandbox/wierzbicki/test27/Lib/test/pbcvm/test/test_builtin_pyc.pyc trunk/sandbox/wierzbicki/test27/Lib/test/pbcvm/test/test_exceptions_pyc.pyc trunk/sandbox/wierzbicki/test27/Lib/test/pbcvm/test/test_types_pyc.pyc trunk/sandbox/wierzbicki/test27/Lib/test/test_compile_jy.py trunk/sandbox/wierzbicki/test27/Lib/test/test_decorators_jy.py trunk/sandbox/wierzbicki/test27/Lib/test/test_dircache.py trunk/sandbox/wierzbicki/test27/Lib/test/test_nt_paths_jy.py trunk/sandbox/wierzbicki/test27/Lib/test/test_old_mailbox.py trunk/sandbox/wierzbicki/test27/Lib/test/test_pbcvm.py trunk/sandbox/wierzbicki/test27/Lib/test/test_popen2.py trunk/sandbox/wierzbicki/test27/Lib/test/test_pprint.py trunk/sandbox/wierzbicki/test27/Lib/test/test_pythoninterpreter_jy.py trunk/sandbox/wierzbicki/test27/Lib/test/test_seq_jy.py trunk/sandbox/wierzbicki/test27/Lib/test/test_shutil.py trunk/sandbox/wierzbicki/test27/Lib/test/test_threading_jy.py trunk/sandbox/wierzbicki/test27/Lib/test/test_univnewlines.py trunk/sandbox/wierzbicki/test27/Lib/test/test_urllib2.py trunk/sandbox/wierzbicki/test27/Lib/test/test_weakref_jy.py trunk/sandbox/wierzbicki/test27/Lib/urllib.py trunk/sandbox/wierzbicki/test27/extlibs/jline-0.9.95-SNAPSHOT.jar trunk/sandbox/wierzbicki/test27/src/com/xhaus/ trunk/sandbox/wierzbicki/test27/src/com/xhaus/modjy/ trunk/sandbox/wierzbicki/test27/src/com/xhaus/modjy/ModjyJServlet.java trunk/sandbox/wierzbicki/test27/src/org/python/compiler/LegacyCompiler.java trunk/sandbox/wierzbicki/test27/src/org/python/compiler/MTime.java trunk/sandbox/wierzbicki/test27/src/org/python/core/AnnotationReader.java trunk/sandbox/wierzbicki/test27/src/org/python/core/CodeBootstrap.java trunk/sandbox/wierzbicki/test27/src/org/python/core/CodeFlag.java trunk/sandbox/wierzbicki/test27/src/org/python/core/CodeLoader.java trunk/sandbox/wierzbicki/test27/src/org/python/core/CompileMode.java trunk/sandbox/wierzbicki/test27/src/org/python/core/CompilerFacade.java trunk/sandbox/wierzbicki/test27/src/org/python/core/FutureFeature.java trunk/sandbox/wierzbicki/test27/src/org/python/core/Pragma.java trunk/sandbox/wierzbicki/test27/src/org/python/core/PragmaReceiver.java trunk/sandbox/wierzbicki/test27/src/org/python/core/PyFileWriter.java trunk/sandbox/wierzbicki/test27/src/org/python/core/PyRunnableBootstrap.java trunk/sandbox/wierzbicki/test27/src/org/python/core/PythonCodeBundle.java trunk/sandbox/wierzbicki/test27/src/org/python/core/PythonCompiler.java trunk/sandbox/wierzbicki/test27/src/org/python/util/jline-keybindings.properties trunk/sandbox/wierzbicki/test27/tests/java/org/python/core/ trunk/sandbox/wierzbicki/test27/tests/java/org/python/core/PySystemState_registry_Test.java trunk/sandbox/wierzbicki/test27/tests/java/org/python/tests/Child2.java trunk/sandbox/wierzbicki/test27/tests/java/org/python/tests/OwnMethodCaller.java trunk/sandbox/wierzbicki/test27/tests/java/org/python/tests/RespectJavaAccessibility.java trunk/sandbox/wierzbicki/test27/tests/java/org/python/tests/identity/ trunk/sandbox/wierzbicki/test27/tests/java/org/python/tests/identity/IdentityObject.java trunk/sandbox/wierzbicki/test27/tests/java/org/python/tests/identity/IdentityTest.java trunk/sandbox/wierzbicki/test27/tests/java/org/python/tests/props/ trunk/sandbox/wierzbicki/test27/tests/java/org/python/tests/props/BeanPropertyTest.java trunk/sandbox/wierzbicki/test27/tests/java/org/python/tests/props/PropShadow.java trunk/sandbox/wierzbicki/test27/tests/java/org/python/tests/props/Readonly.java trunk/sandbox/wierzbicki/test27/tests/java/org/python/util/jythonTest.java trunk/sandbox/wierzbicki/test27/tests/modjy/ trunk/sandbox/wierzbicki/test27/tests/modjy/__init__.py trunk/sandbox/wierzbicki/test27/tests/modjy/build.xml trunk/sandbox/wierzbicki/test27/tests/modjy/empty.txt trunk/sandbox/wierzbicki/test27/tests/modjy/java/ trunk/sandbox/wierzbicki/test27/tests/modjy/java/com/ trunk/sandbox/wierzbicki/test27/tests/modjy/java/com/xhaus/ trunk/sandbox/wierzbicki/test27/tests/modjy/java/com/xhaus/modjy/ trunk/sandbox/wierzbicki/test27/tests/modjy/java/com/xhaus/modjy/ModjyTestAppInvocation.java trunk/sandbox/wierzbicki/test27/tests/modjy/java/com/xhaus/modjy/ModjyTestBase.java trunk/sandbox/wierzbicki/test27/tests/modjy/java/com/xhaus/modjy/ModjyTestContentHeaders.java trunk/sandbox/wierzbicki/test27/tests/modjy/java/com/xhaus/modjy/ModjyTestEnviron.java trunk/sandbox/wierzbicki/test27/tests/modjy/java/com/xhaus/modjy/ModjyTestHeaders.java trunk/sandbox/wierzbicki/test27/tests/modjy/java/com/xhaus/modjy/ModjyTestReturnIterable.java trunk/sandbox/wierzbicki/test27/tests/modjy/java/com/xhaus/modjy/ModjyTestWSGIStreams.java trunk/sandbox/wierzbicki/test27/tests/modjy/java/com/xhaus/modjy/ModjyTestWebInf.java trunk/sandbox/wierzbicki/test27/tests/modjy/java/com/xhaus/modjy/ModjyTestWriteCallable.java trunk/sandbox/wierzbicki/test27/tests/modjy/lib_python_folder/ trunk/sandbox/wierzbicki/test27/tests/modjy/lib_python_folder/__init__.py trunk/sandbox/wierzbicki/test27/tests/modjy/lib_python_folder/add_zips.pth trunk/sandbox/wierzbicki/test27/tests/modjy/lib_python_folder/do_import.pth trunk/sandbox/wierzbicki/test27/tests/modjy/lib_python_folder/mock_framework/ trunk/sandbox/wierzbicki/test27/tests/modjy/lib_python_folder/mock_framework/__init__.py trunk/sandbox/wierzbicki/test27/tests/modjy/lib_python_folder/mock_framework/web/ trunk/sandbox/wierzbicki/test27/tests/modjy/lib_python_folder/mock_framework/web/__init__.py trunk/sandbox/wierzbicki/test27/tests/modjy/lib_python_folder/mock_framework/web/handlers/ trunk/sandbox/wierzbicki/test27/tests/modjy/lib_python_folder/mock_framework/web/handlers/__init__.py trunk/sandbox/wierzbicki/test27/tests/modjy/lib_python_folder/mock_framework/web/handlers/wsgi_handlers.py trunk/sandbox/wierzbicki/test27/tests/modjy/lib_python_folder/script_name_path_info.py trunk/sandbox/wierzbicki/test27/tests/modjy/lib_python_folder/test_lib/ trunk/sandbox/wierzbicki/test27/tests/modjy/lib_python_folder/test_lib/__init__.py trunk/sandbox/wierzbicki/test27/tests/modjy/lib_python_folder/test_lib/some_libs.py trunk/sandbox/wierzbicki/test27/tests/modjy/lib_python_folder/test_modules.zip trunk/sandbox/wierzbicki/test27/tests/modjy/lines.txt trunk/sandbox/wierzbicki/test27/tests/modjy/readme.txt trunk/sandbox/wierzbicki/test27/tests/modjy/test_apps_dir/ trunk/sandbox/wierzbicki/test27/tests/modjy/test_apps_dir/__init__.py trunk/sandbox/wierzbicki/test27/tests/modjy/test_apps_dir/content_header_tests.py trunk/sandbox/wierzbicki/test27/tests/modjy/test_apps_dir/environ_tests.py trunk/sandbox/wierzbicki/test27/tests/modjy/test_apps_dir/header_tests.py trunk/sandbox/wierzbicki/test27/tests/modjy/test_apps_dir/return_tests.py trunk/sandbox/wierzbicki/test27/tests/modjy/test_apps_dir/simple_app.py trunk/sandbox/wierzbicki/test27/tests/modjy/test_apps_dir/stream_tests.py trunk/sandbox/wierzbicki/test27/tests/modjy/test_apps_dir/web_inf_tests.py trunk/sandbox/wierzbicki/test27/tests/policy/ trunk/sandbox/wierzbicki/test27/tests/policy/nowrite.policy trunk/sandbox/wierzbicki/test27/tests/policy/run.sh trunk/sandbox/wierzbicki/test27/tests/python/ trunk/sandbox/wierzbicki/test27/tests/python/identity_test.py trunk/sandbox/wierzbicki/test27/tests/python/prop_test.py Removed Paths: ------------- trunk/sandbox/wierzbicki/test27/Demo/modjy_webapp/WEB-INF/ trunk/sandbox/wierzbicki/test27/Demo/modjy_webapp/WEB-INF/lib/ trunk/sandbox/wierzbicki/test27/Demo/modjy_webapp/WEB-INF/lib/readme.txt trunk/sandbox/wierzbicki/test27/Demo/modjy_webapp/WEB-INF/lib-python/ trunk/sandbox/wierzbicki/test27/Demo/modjy_webapp/WEB-INF/lib-python/readme.txt trunk/sandbox/wierzbicki/test27/Demo/modjy_webapp/WEB-INF/web.xml trunk/sandbox/wierzbicki/test27/Demo/modjy_webapp/demo_app.py trunk/sandbox/wierzbicki/test27/Demo/modjy_webapp/readme.txt trunk/sandbox/wierzbicki/test27/Lib/modjy/__init__.py trunk/sandbox/wierzbicki/test27/Lib/modjy/modjy.py trunk/sandbox/wierzbicki/test27/Lib/modjy/modjy_exceptions.py trunk/sandbox/wierzbicki/test27/Lib/modjy/modjy_impl.py trunk/sandbox/wierzbicki/test27/Lib/modjy/modjy_log.py trunk/sandbox/wierzbicki/test27/Lib/modjy/modjy_params.py trunk/sandbox/wierzbicki/test27/Lib/modjy/modjy_publish.py trunk/sandbox/wierzbicki/test27/Lib/modjy/modjy_response.py trunk/sandbox/wierzbicki/test27/Lib/modjy/modjy_write.py trunk/sandbox/wierzbicki/test27/Lib/modjy/modjy_wsgi.py trunk/sandbox/wierzbicki/test27/Lib/test/bug1126/bug1126.jar trunk/sandbox/wierzbicki/test27/Lib/test/cfgparser.1 trunk/sandbox/wierzbicki/test27/Lib/test/eof_fodder7.py trunk/sandbox/wierzbicki/test27/Lib/test/pbcvm/test/ trunk/sandbox/wierzbicki/test27/Lib/test/pbcvm/test/README trunk/sandbox/wierzbicki/test27/Lib/test/pbcvm/test/__init__.py trunk/sandbox/wierzbicki/test27/Lib/test/pbcvm/test/test_builtin_pyc.pyc trunk/sandbox/wierzbicki/test27/Lib/test/pbcvm/test/test_exceptions_pyc.pyc trunk/sandbox/wierzbicki/test27/Lib/test/pbcvm/test/test_types_pyc.pyc trunk/sandbox/wierzbicki/test27/Lib/test/test_asynchat.py trunk/sandbox/wierzbicki/test27/Lib/test/test_doctest.py trunk/sandbox/wierzbicki/test27/extlibs/jline-0.9.94.jar trunk/sandbox/wierzbicki/test27/extlibs/modjy_0_25_3.zip trunk/sandbox/wierzbicki/test27/src/com/xhaus/modjy/ trunk/sandbox/wierzbicki/test27/src/com/xhaus/modjy/ModjyJServlet.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/ExpressionParser.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/InteractiveParser.java trunk/sandbox/wierzbicki/test27/src/org/python/antlr/ModuleParser.java trunk/sandbox/wierzbicki/test27/src/org/python/compiler/pbc/ trunk/sandbox/wierzbicki/test27/src/org/python/core/APIReader.java trunk/sandbox/wierzbicki/test27/src/org/python/core/MergeState.java trunk/sandbox/wierzbicki/test27/src/org/python/core/PyObjectArray.java trunk/sandbox/wierzbicki/test27/src/org/python/core/PyObjectList.java trunk/sandbox/wierzbicki/test27/src/org/python/modules/_newmodule.java trunk/sandbox/wierzbicki/test27/tests/java/org/python/core/PySystemState_registry_Test.java trunk/sandbox/wierzbicki/test27/tests/java/org/python/tests/identity/IdentityObject.java trunk/sandbox/wierzbicki/test27/tests/java/org/python/tests/identity/IdentityTest.java trunk/sandbox/wierzbicki/test27/tests/java/org/python/tests/props/BeanPropertyTest.java trunk/sandbox/wierzbicki/test27/tests/java/org/python/tests/props/PropShadow.java trunk/sandbox/wierzbicki/test27/tests/java/org/python/tests/props/Readonly.java trunk/sandbox/wierzbicki/test27/tests/modjy/__init__.py trunk/sandbox/wierzbicki/test27/tests/modjy/build.xml trunk/sandbox/wierzbicki/test27/tests/modjy/empty.txt trunk/sandbox/wierzbicki/test27/tests/modjy/java/ trunk/sandbox/wierzbicki/test27/tests/modjy/java/com/ trunk/sandbox/wierzbicki/test27/tests/modjy/java/com/xhaus/ trunk/sandbox/wierzbicki/test27/tests/modjy/java/com/xhaus/modjy/ trunk/sandbox/wierzbicki/test27/tests/modjy/java/com/xhaus/modjy/ModjyTestAppInvocation.java trunk/sandbox/wierzbicki/test27/tests/modjy/java/com/xhaus/modjy/ModjyTestBase.java trunk/sandbox/wierzbicki/test27/tests/modjy/java/com/xhaus/modjy/ModjyTestContentHeaders.java trunk/sandbox/wierzbicki/test27/tests/modjy/java/com/xhaus/modjy/ModjyTestEnviron.java trunk/sandbox/wierzbicki/test27/tests/modjy/java/com/xhaus/modjy/ModjyTestHeaders.java trunk/sandbox/wierzbicki/test27/tests/modjy/java/com/xhaus/modjy/ModjyTestReturnIterable.java trunk/sandbox/wierzbicki/test27/tests/modjy/java/com/xhaus/modjy/ModjyTestWSGIStreams.java trunk/sandbox/wierzbicki/test27/tests/modjy/java/com/xhaus/modjy/ModjyTestWebInf.java trunk/sandbox/wierzbicki/test27/tests/modjy/java/com/xhaus/modjy/ModjyTestWriteCallable.java trunk/sandbox/wierzbicki/test27/tests/modjy/lib_python_folder/ trunk/sandbox/wierzbicki/test27/tests/modjy/lib_python_folder/__init__.py trunk/sandbox/wierzbicki/test27/tests/modjy/lib_python_folder/add_zips.pth trunk/sandbox/wierzbicki/test27/tests/modjy/lib_python_folder/do_import.pth trunk/sandbox/wierzbicki/test27/tests/modjy/lib_python_folder/mock_framework/ trunk/sandbox/wierzbicki/test27/tests/modjy/lib_python_folder/mock_framework/__init__.py trunk/sandbox/wierzbicki/test27/tests/modjy/lib_python_folder/mock_framework/web/ trunk/sandbox/wierzbicki/test27/tests/modjy/lib_python_folder/mock_framework/web/__init__.py trunk/sandbox/wierzbicki/test27/tests/modjy/lib_python_folder/mock_framework/web/handlers/ trunk/sandbox/wierzbicki/test27/tests/modjy/lib_python_folder/mock_framework/web/handlers/__init__.py trunk/sandbox/wierzbicki/test27/tests/modjy/lib_python_folder/mock_framework/web/handlers/wsgi_handlers.py trunk/sandbox/wierzbicki/test27/tests/modjy/lib_python_folder/script_name_path_info.py trunk/sandbox/wierzbicki/test27/tests/modjy/lib_python_folder/test_lib/ trunk/sandbox/wierzbicki/test27/tests/modjy/lib_python_folder/test_lib/__init__.py trunk/sandbox/wierzbicki/test27/tests/modjy/lib_python_folder/test_lib/some_libs.py trunk/sandbox/wierzbicki/test27/tests/modjy/lib_python_folder/test_modules.zip trunk/sandbox/wierzbicki/test27/tests/modjy/lines.txt trunk/sandbox/wierzbicki/test27/tests/modjy/readme.txt trunk/sandbox/wierzbicki/test27/tests/modjy/test_apps_dir/ trunk/sandbox/wierzbicki/test27/tests/modjy/test_apps_dir/__init__.py trunk/sandbox/wierzbicki/test27/tests/modjy/test_apps_dir/content_header_tests.py trunk/sandbox/wierzbicki/test27/tests/modjy/test_apps_dir/environ_tests.py trunk/sandbox/wierzbicki/test27/tests/modjy/test_apps_dir/header_tests.py trunk/sandbox/wierzbicki/test27/tests/modjy/test_apps_dir/return_tests.py trunk/sandbox/wierzbicki/test27/tests/modjy/test_apps_dir/simple_app.py trunk/sandbox/wierzbicki/test27/tests/modjy/test_apps_dir/stream_tests.py trunk/sandbox/wierzbicki/test27/tests/modjy/test_apps_dir/web_inf_tests.py trunk/sandbox/wierzbicki/test27/tests/policy/nowrite.policy trunk/sandbox/wierzbicki/test27/tests/policy/run.sh trunk/sandbox/wierzbicki/test27/tests/python/identity_test.py trunk/sandbox/wierzbicki/test27/tests/python/prop_test.py Property Changed: ---------------- trunk/sandbox/wierzbicki/test27/ Property changes on: trunk/sandbox/wierzbicki/test27 ___________________________________________________________________ Modified: svn:ignore - .externalToolBuilders .classpath .project *.ipr *.iws *.iml build dist ant.properties bin cachedir .settings + .externalToolBuilders .classpath .project *.ipr *.iws *.iml build dist ant.properties bin cachedir .settings profile.txt Modified: svnmerge-integrated - /branches/pbcvm:1-6045 /trunk/jython:1-6052 + /branches/pbcvm:1-6045 /trunk/jython:1-6483 Modified: trunk/sandbox/wierzbicki/test27/.classpath =================================================================== --- trunk/sandbox/wierzbicki/test27/.classpath 2009-07-07 19:08:37 UTC (rev 6523) +++ trunk/sandbox/wierzbicki/test27/.classpath 2009-07-07 19:31:47 UTC (rev 6524) @@ -6,16 +6,17 @@ <classpathentry kind="src" path="bugtests/classes"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/3"/> - <classpathentry kind="lib" path="extlibs/jline-0.9.94.jar"/> + <classpathentry kind="lib" path="extlibs/jline-0.9.95-SNAPSHOT.jar"/> <classpathentry kind="lib" path="extlibs/junit-3.8.2.jar"/> <classpathentry kind="lib" path="extlibs/libreadline-java-0.8.jar"/> <classpathentry kind="lib" path="extlibs/mysql-connector-java-5.1.6.jar"/> <classpathentry kind="lib" path="extlibs/postgresql-8.3-603.jdbc4.jar"/> <classpathentry kind="lib" path="extlibs/servlet-api-2.5.jar"/> <classpathentry kind="var" path="ANT_HOME/lib/ant.jar"/> - <classpathentry kind="lib" path="extlibs/antlr-3.1.1-runtime.jar"/> + <classpathentry kind="lib" path="extlibs/antlr-runtime-3.1.2.jar"/> <classpathentry kind="lib" path="extlibs/asm-3.1.jar"/> <classpathentry kind="lib" path="extlibs/asm-commons-3.1.jar"/> <classpathentry kind="lib" path="extlibs/constantine-0.4.jar"/> + <classpathentry kind="lib" path="extlibs/jna-posix.jar"/> <classpathentry kind="output" path="bugtests/classes"/> </classpath> Modified: trunk/sandbox/wierzbicki/test27/ACKNOWLEDGMENTS =================================================================== --- trunk/sandbox/wierzbicki/test27/ACKNOWLEDGMENTS 2009-07-07 19:08:37 UTC (rev 6523) +++ trunk/sandbox/wierzbicki/test27/ACKNOWLEDGMENTS 2009-07-07 19:31:47 UTC (rev 6524) @@ -31,6 +31,8 @@ Cyrille Morvan has written the code for the Jythonc ant task. + Alan Kennedy contributed modjy, which bridges WSGI to the Servlet API + A huge thanks goes to all the members of the jpython/jython mailing lists. Other folks who have contributed to JPython and Jython in ways large and small, in no particular order: @@ -66,6 +68,21 @@ Nathan Franzen Aleks Totic Randolph Brown + Geoffrey French + Tobias Ivarsson + Lino Mastrodomenico + S\xE9bastien Boisg\xE9rault + Jim Baker + Charlie Groves + Otmar Humbel + Philip Jenvey + Nicholas Riley + Frank Wierzbicki + Khalid Zuberi + Sean McGrath + Clark Updike + Leonardo Soto + James Robinson Local Variables: mode: indented-text Modified: trunk/sandbox/wierzbicki/test27/CPythonLib.includes =================================================================== --- trunk/sandbox/wierzbicki/test27/CPythonLib.includes 2009-07-07 19:08:37 UTC (rev 6523) +++ trunk/sandbox/wierzbicki/test27/CPythonLib.includes 2009-07-07 19:31:47 UTC (rev 6524) @@ -135,6 +135,7 @@ SimpleXMLRPCServer.py site.py site-packages/README +smtpd.py smtplib.py sndhdr.py SocketServer.py @@ -167,6 +168,7 @@ weakref.py whichdb.py whrandom.py +wsgiref.egg-info wsgiref/*.py xdrlib.py xmllib.py Modified: trunk/sandbox/wierzbicki/test27/CoreExposed.includes =================================================================== --- trunk/sandbox/wierzbicki/test27/CoreExposed.includes 2009-07-07 19:08:37 UTC (rev 6523) +++ trunk/sandbox/wierzbicki/test27/CoreExposed.includes 2009-07-07 19:31:47 UTC (rev 6524) @@ -6,6 +6,7 @@ org/python/core/PyBoolean.class org/python/core/PyBuiltinCallable.class org/python/core/PyCell.class +org/python/core/PyClass.class org/python/core/PyClassMethod.class org/python/core/PyClassMethodDescr.class org/python/core/PyComplex.class @@ -19,6 +20,7 @@ org/python/core/PyFrozenSet.class org/python/core/PyFunction.class org/python/core/PyGenerator.class +org/python/core/PyInstance.class org/python/core/PyInteger.class org/python/core/PyList.class org/python/core/PyLong.class Deleted: trunk/sandbox/wierzbicki/test27/Demo/modjy_webapp/WEB-INF/lib/readme.txt =================================================================== --- trunk/jython/Demo/modjy_webapp/WEB-INF/lib/readme.txt 2009-06-16 17:18:28 UTC (rev 6475) +++ trunk/sandbox/wierzbicki/test27/Demo/modjy_webapp/WEB-INF/lib/readme.txt 2009-07-07 19:31:47 UTC (rev 6524) @@ -1 +0,0 @@ -The jython.jar file should be placed in this directory. Copied: trunk/sandbox/wierzbicki/test27/Demo/modjy_webapp/WEB-INF/lib/readme.txt (from rev 6475, trunk/jython/Demo/modjy_webapp/WEB-INF/lib/readme.txt) =================================================================== --- trunk/sandbox/wierzbicki/test27/Demo/modjy_webapp/WEB-INF/lib/readme.txt (rev 0) +++ trunk/sandbox/wierzbicki/test27/Demo/modjy_webapp/WEB-INF/lib/readme.txt 2009-07-07 19:31:47 UTC (rev 6524) @@ -0,0 +1 @@ +The jython.jar file should be placed in this directory. Deleted: trunk/sandbox/wierzbicki/test27/Demo/modjy_webapp/WEB-INF/lib-python/readme.txt =================================================================== --- trunk/jython/Demo/modjy_webapp/WEB-INF/lib-python/readme.txt 2009-06-16 17:18:28 UTC (rev 6475) +++ trunk/sandbox/wierzbicki/test27/Demo/modjy_webapp/WEB-INF/lib-python/readme.txt 2009-07-07 19:31:47 UTC (rev 6524) @@ -1,11 +0,0 @@ -The WEB-INF/lib-python directory, if it exists, is automatically added -to sys.path. Adding jython modules into this directory will make them -available for import into your application. - -If you add your modules in a subdirectory, then be sure that that -subdirectory contains an __init__.py file, so that the subdirectory -is considered to be a package. - -See here for more details. -http://www.rexx.com/~dkuhlman/python_101/python_101.html#SECTION004540000000000000000 -http://www.python.org/doc/essays/packages.html Copied: trunk/sandbox/wierzbicki/test27/Demo/modjy_webapp/WEB-INF/lib-python/readme.txt (from rev 6475, trunk/jython/Demo/modjy_webapp/WEB-INF/lib-python/readme.txt) =================================================================== --- trunk/sandbox/wierzbicki/test27/Demo/modjy_webapp/WEB-INF/lib-python/readme.txt (rev 0) +++ trunk/sandbox/wierzbicki/test27/Demo/modjy_webapp/WEB-INF/lib-python/readme.txt 2009-07-07 19:31:47 UTC (rev 6524) @@ -0,0 +1,11 @@ +The WEB-INF/lib-python directory, if it exists, is automatically added +to sys.path. Adding jython modules into this directory will make them +available for import into your application. + +If you add your modules in a subdirectory, then be sure that that +subdirectory contains an __init__.py file, so that the subdirectory +is considered to be a package. + +See here for more details. +http://www.rexx.com/~dkuhlman/python_101/python_101.html#SECTION004540000000000000000 +http://www.python.org/doc/essays/packages.html Deleted: trunk/sandbox/wierzbicki/test27/Demo/modjy_webapp/WEB-INF/web.xml =================================================================== --- trunk/jython/Demo/modjy_webapp/WEB-INF/web.xml 2009-06-16 17:18:28 UTC (rev 6475) +++ trunk/sandbox/wierzbicki/test27/Demo/modjy_webapp/WEB-INF/web.xml 2009-07-07 19:31:47 UTC (rev 6524) @@ -1,85 +0,0 @@ -<?xml version="1.0" encoding="ISO-8859-1"?> -<!DOCTYPE web-app - PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" - "http://java.sun.com/dtd/web-app_2_3.dtd"> -<web-app> - - <display-name>modjy demo application</display-name> - <description> - modjy WSGI demo application - </description> - - <servlet> - <servlet-name>modjy</servlet-name> - <servlet-class>com.xhaus.modjy.ModjyJServlet</servlet-class> - <init-param> - <param-name>python.home</param-name> - <param-value>C:/jython2.5</param-value> - </init-param> -<!-- - There are two different ways you can specify an application to modjy - 1. Using the app_import_name mechanism - 2. Using a combination of app_directory/app_filename/app_callable_name - Examples of both are given below - See the documenation for more details. - http://modjy.xhaus.com/locating.html#locating_callables ---> -<!-- - This is the app_import_name mechanism. If you specify a value - for this variable, then it will take precedence over the other mechanism - <init-param> - <param-name>app_import_name</param-name> - <param-value>my_wsgi_module.my_handler_class().handler_method</param-value> - </init-param> ---> -<!-- - And this is the app_directory/app_filename/app_callable_name combo - The defaults for these three variables are ""/application.py/handler - So if you specify no values at all for any of app_* variables, then modjy - will by default look for "handler" in "application.py" in the servlet - context root. - <init-param> - <param-name>app_directory</param-name> - <param-value>some_sub_directory</param-value> - </init-param> ---> - <init-param> - <param-name>app_filename</param-name> - <param-value>demo_app.py</param-value> - </init-param> -<!-- - Supply a value for this parameter if you want your application - callable to have a different name than the default. - <init-param> - <param-name>app_callable_name</param-name> - <param-value>my_handler_func</param-value> - </init-param> ---> - <!-- Do you want application callables to be cached? --> - <init-param> - <param-name>cache_callables</param-name> - <param-value>1</param-value> - </init-param> - <!-- Should the application be reloaded if it's .py file changes? --> - <!-- Does not work with the app_import_name mechanism --> - <init-param> - <param-name>reload_on_mod</param-name> - <param-value>1</param-value> - </init-param> - <init-param> - <param-name>log_level</param-name> - <param-value>debug</param-value> -<!-- <param-value>info</param-value> --> -<!-- <param-value>warn</param-value> --> -<!-- <param-value>error</param-value> --> -<!-- <param-value>fatal</param-value> --> - </init-param> - <load-on-startup>1</load-on-startup> - </servlet> - - <servlet-mapping> - <servlet-name>modjy</servlet-name> - <url-pattern>/*</url-pattern> - </servlet-mapping> - -</web-app> Copied: trunk/sandbox/wierzbicki/test27/Demo/modjy_webapp/WEB-INF/web.xml (from rev 6475, trunk/jython/Demo/modjy_webapp/WEB-INF/web.xml) =================================================================== --- trunk/sandbox/wierzbicki/test27/Demo/modjy_webapp/WEB-INF/web.xml (rev 0) +++ trunk/sandbox/wierzbicki/test27/Demo/modjy_webapp/WEB-INF/web.xml 2009-07-07 19:31:47 UTC (rev 6524) @@ -0,0 +1,85 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE web-app + PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" + "http://java.sun.com/dtd/web-app_2_3.dtd"> +<web-app> + + <display-name>modjy demo application</display-name> + <description> + modjy WSGI demo application + </description> + + <servlet> + <servlet-name>modjy</servlet-name> + <servlet-class>com.xhaus.modjy.ModjyJServlet</servlet-class> + <init-param> + <param-name>python.home</param-name> + <param-value>C:/jython2.5</param-value> + </init-param> +<!-- + There are two different ways you can specify an application to modjy + 1. Using the app_import_name mechanism + 2. Using a combination of app_directory/app_filename/app_callable_name + Examples of both are given below + See the documenation for more details. + http://modjy.xhaus.com/locating.html#locating_callables +--> +<!-- + This is the app_import_name mechanism. If you specify a value + for this variable, then it will take precedence over the other mechanism + <init-param> + <param-name>app_import_name</param-name> + <param-value>my_wsgi_module.my_handler_class().handler_method</param-value> + </init-param> +--> +<!-- + And this is the app_directory/app_filename/app_callable_name combo + The defaults for these three variables are ""/application.py/handler + So if you specify no values at all for any of app_* variables, then modjy + will by default look for "handler" in "application.py" in the servlet + context root. + <init-param> + <param-name>app_directory</param-name> + <param-value>some_sub_directory</param-value> + </init-param> +--> + <init-param> + <param-name>app_filename</param-name> + <param-value>demo_app.py</param-value> + </init-param> +<!-- + Supply a value for this parameter if you want your application + callable to have a different name than the default. + <init-param> + <param-name>app_callable_name</param-name> + <param-value>my_handler_func</param-value> + </init-param> +--> + <!-- Do you want application callables to be cached? --> + <init-param> + <param-name>cache_callables</param-name> + <param-value>1</param-value> + </init-param> + <!-- Should the application be reloaded if it's .py file changes? --> + <!-- Does not work with the app_import_name mechanism --> + <init-param> + <param-name>reload_on_mod</param-name> + <param-value>1</param-value> + </init-param> + <init-param> + <param-name>log_level</param-name> + <param-value>debug</param-value> +<!-- <param-value>info</param-value> --> +<!-- <param-value>warn</param-value> --> +<!-- <param-value>error</param-value> --> +<!-- <param-value>fatal</param-value> --> + </init-param> + <load-on-startup>1</load-on-startup> + </servlet> + + <servlet-mapping> + <servlet-name>modjy</servlet-name> + <url-pattern>/*</... [truncated message content] |
From: <fwi...@us...> - 2009-07-07 19:08:40
|
Revision: 6523 http://jython.svn.sourceforge.net/jython/?rev=6523&view=rev Author: fwierzbicki Date: 2009-07-07 19:08:37 +0000 (Tue, 07 Jul 2009) Log Message: ----------- Creating a branch for experimentation with invokedynamic (jsr 292). Added Paths: ----------- branches/indy/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <am...@us...> - 2009-07-07 17:30:14
|
Revision: 6522 http://jython.svn.sourceforge.net/jython/?rev=6522&view=rev Author: amak Date: 2009-07-07 17:29:56 +0000 (Tue, 07 Jul 2009) Log Message: ----------- Fixing a previously unspotted bug in modjy's handling of imports in .pth files. Modified Paths: -------------- trunk/jython/src/com/xhaus/modjy/ModjyJServlet.java Modified: trunk/jython/src/com/xhaus/modjy/ModjyJServlet.java =================================================================== --- trunk/jython/src/com/xhaus/modjy/ModjyJServlet.java 2009-07-07 12:43:53 UTC (rev 6521) +++ trunk/jython/src/com/xhaus/modjy/ModjyJServlet.java 2009-07-07 17:29:56 UTC (rev 6522) @@ -189,7 +189,10 @@ if (line.startsWith("#")) continue; if (line.startsWith("import")) + { interp.exec(line); + continue; + } File archiveFile = new File(pythonLibPath, line); String archiveRealpath = archiveFile.getAbsolutePath(); systemState.path.append(new PyString(archiveRealpath)); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fwi...@us...> - 2009-07-07 14:21:18
|
Revision: 6521 http://jython.svn.sourceforge.net/jython/?rev=6521&view=rev Author: fwierzbicki Date: 2009-07-07 12:43:53 +0000 (Tue, 07 Jul 2009) Log Message: ----------- More whitespace cleanup and "diff shrinking" between all of the grammars. Modified Paths: -------------- trunk/jython/grammar/Base.g trunk/jython/grammar/Python.g trunk/jython/grammar/PythonPartial.g Modified: trunk/jython/grammar/Base.g =================================================================== --- trunk/jython/grammar/Base.g 2009-07-07 11:36:34 UTC (rev 6520) +++ trunk/jython/grammar/Base.g 2009-07-07 12:43:53 UTC (rev 6521) @@ -80,12 +80,7 @@ } @rulecatch { -catch (RecognitionException re) { - errorHandler.reportError(this, re); - errorHandler.recover(this, input,re); - retval.tree = (PythonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re); } -} @lexer::header { package org.python.antlr; @@ -739,7 +734,7 @@ (list_for | (options {greedy=true;}:COMMA test)* ) (COMMA)? - ; + ; //testlist_gexp: test ( gen_for | (',' test)* [','] ) testlist_gexp Modified: trunk/jython/grammar/Python.g =================================================================== --- trunk/jython/grammar/Python.g 2009-07-07 11:36:34 UTC (rev 6520) +++ trunk/jython/grammar/Python.g 2009-07-07 12:43:53 UTC (rev 6521) @@ -320,9 +320,10 @@ if ($stmt.stypes != null) {stypes.addAll($stmt.stypes);} } - )* EOF { - mtype = new Module($file_input.start, actions.castStmts(stypes)); - } + )* EOF + { + mtype = new Module($file_input.start, actions.castStmts(stypes)); + } ; //XXX: this block is duplicated in three places, how to extract? catch [RecognitionException re] { @@ -332,7 +333,6 @@ retval.tree = new ErrorMod(badNode); } - //eval_input: testlist NEWLINE* ENDMARKER eval_input @init { @@ -753,7 +753,8 @@ //yield_stmt: yield_expr yield_stmt - : yield_expr -> ^(YIELD<Expr>[$yield_expr.start, actions.castExpr($yield_expr.tree)]) + : yield_expr + -> ^(YIELD<Expr>[$yield_expr.start, actions.castExpr($yield_expr.tree)]) ; //raise_stmt: 'raise' [test [',' test [',' test]]] @@ -1896,10 +1897,11 @@ */ CONTINUED_LINE : '\\' ('\r')? '\n' (' '|'\t')* { $channel=HIDDEN; } - ( c1=COMMENT - | nl=NEWLINE { - emit(new CommonToken(NEWLINE,nl.getText())); - } + ( COMMENT + | nl=NEWLINE + { + emit(new CommonToken(NEWLINE,nl.getText())); + } | ) { if (input.LA(1) == -1) { Modified: trunk/jython/grammar/PythonPartial.g =================================================================== --- trunk/jython/grammar/PythonPartial.g 2009-07-07 11:36:34 UTC (rev 6520) +++ trunk/jython/grammar/PythonPartial.g 2009-07-07 12:43:53 UTC (rev 6521) @@ -307,6 +307,8 @@ | assert_stmt ; +//expr_stmt: testlist (augassign (yield_expr|testlist) | +// ('=' (yield_expr|testlist))*) expr_stmt : ((testlist augassign) => testlist ( (augassign yield_expr @@ -353,8 +355,11 @@ ; //not in CPython's Grammar file -printlist returns [boolean newline] - : test (options {k=2;}: COMMA test)* (COMMA)? +printlist + : (test COMMA) => + test (options {k=2;}: COMMA test)* + (COMMA)? + | test ; //del_stmt: 'del' exprlist @@ -392,7 +397,7 @@ (testlist | ) - ; + ; //yield_stmt: yield_expr yield_stmt @@ -459,8 +464,7 @@ //exec_stmt: 'exec' expr ['in' test [',' test]] exec_stmt - : EXEC expr (IN test - (COMMA test)?)? + : EXEC expr (IN test (COMMA test)?)? ; //assert_stmt: 'assert' test [',' test] @@ -1082,7 +1086,7 @@ */ CONTINUED_LINE : '\\' ('\r')? '\n' (' '|'\t')* { $channel=HIDDEN; } - ( c1=COMMENT + ( COMMENT | nl=NEWLINE | ) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <am...@us...> - 2009-07-07 11:36:36
|
Revision: 6520 http://jython.svn.sourceforge.net/jython/?rev=6520&view=rev Author: amak Date: 2009-07-07 11:36:34 +0000 (Tue, 07 Jul 2009) Log Message: ----------- Commenting out all AI_CANONNAME tests for now. Much further research needed; may never be cross-platform testable. Modified Paths: -------------- trunk/jython/Lib/test/test_socket.py Modified: trunk/jython/Lib/test/test_socket.py =================================================================== --- trunk/jython/Lib/test/test_socket.py 2009-07-07 11:05:16 UTC (rev 6519) +++ trunk/jython/Lib/test/test_socket.py 2009-07-07 11:36:34 UTC (rev 6520) @@ -1453,12 +1453,13 @@ (socket.AI_PASSIVE, "localhost", "", IPV4_LOOPBACK), (socket.AI_PASSIVE, local_hostname, "", local_ip_address), # Now passive flag AND canonname flag - (socket.AI_PASSIVE|socket.AI_CANONNAME, None, "127.0.0.1", "127.0.0.1"), - (socket.AI_PASSIVE|socket.AI_CANONNAME, "", local_hostname, local_ip_address), + # Commenting out all AI_CANONNAME tests, results too dependent on system config + #(socket.AI_PASSIVE|socket.AI_CANONNAME, None, "127.0.0.1", "127.0.0.1"), + #(socket.AI_PASSIVE|socket.AI_CANONNAME, "", local_hostname, local_ip_address), # The following gives varying results across platforms and configurations: commenting out for now. # Javadoc: http://java.sun.com/j2se/1.5.0/docs/api/java/net/InetAddress.html#getCanonicalHostName() #(socket.AI_PASSIVE|socket.AI_CANONNAME, "localhost", local_hostname, IPV4_LOOPBACK), - (socket.AI_PASSIVE|socket.AI_CANONNAME, local_hostname, local_hostname, local_ip_address), + #(socket.AI_PASSIVE|socket.AI_CANONNAME, local_hostname, local_hostname, local_ip_address), ]: addrinfos = socket.getaddrinfo(host_param, 0, socket.AF_INET, socket.SOCK_STREAM, 0, flags) for family, socktype, proto, canonname, sockaddr in addrinfos: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <am...@us...> - 2009-07-07 11:05:26
|
Revision: 6519 http://jython.svn.sourceforge.net/jython/?rev=6519&view=rev Author: amak Date: 2009-07-07 11:05:16 +0000 (Tue, 07 Jul 2009) Log Message: ----------- Commenting out a single test that gives varying results across platforms, and thus cannot be reliably tested. Also some whitespace cleanup. Modified Paths: -------------- trunk/jython/Lib/test/test_socket.py Modified: trunk/jython/Lib/test/test_socket.py =================================================================== --- trunk/jython/Lib/test/test_socket.py 2009-07-07 04:49:12 UTC (rev 6518) +++ trunk/jython/Lib/test/test_socket.py 2009-07-07 11:05:16 UTC (rev 6519) @@ -1448,18 +1448,17 @@ local_ip_address = java.net.InetAddress.getLocalHost().getHostAddress() for flags, host_param, expected_canonname, expected_sockaddr in [ # First passive flag - (socket.AI_PASSIVE, None, "", socket.INADDR_ANY), - (socket.AI_PASSIVE, "", "", local_ip_address), - (socket.AI_PASSIVE, "localhost", "", IPV4_LOOPBACK), - (socket.AI_PASSIVE, local_hostname, "", local_ip_address), - # Now passive flag AND canonname flag - (socket.AI_PASSIVE|socket.AI_CANONNAME, None, "127.0.0.1", "127.0.0.1"), - (socket.AI_PASSIVE|socket.AI_CANONNAME, "", local_hostname, local_ip_address), - # The following result seems peculiar to me, and may be to do with my local machine setup - # Also may be caused by a security permission failure. - # If you have problems with the following result, just comment it out. - (socket.AI_PASSIVE|socket.AI_CANONNAME, "localhost", IPV4_LOOPBACK, IPV4_LOOPBACK), - (socket.AI_PASSIVE|socket.AI_CANONNAME, local_hostname, local_hostname, local_ip_address), + (socket.AI_PASSIVE, None, "", socket.INADDR_ANY), + (socket.AI_PASSIVE, "", "", local_ip_address), + (socket.AI_PASSIVE, "localhost", "", IPV4_LOOPBACK), + (socket.AI_PASSIVE, local_hostname, "", local_ip_address), + # Now passive flag AND canonname flag + (socket.AI_PASSIVE|socket.AI_CANONNAME, None, "127.0.0.1", "127.0.0.1"), + (socket.AI_PASSIVE|socket.AI_CANONNAME, "", local_hostname, local_ip_address), + # The following gives varying results across platforms and configurations: commenting out for now. + # Javadoc: http://java.sun.com/j2se/1.5.0/docs/api/java/net/InetAddress.html#getCanonicalHostName() + #(socket.AI_PASSIVE|socket.AI_CANONNAME, "localhost", local_hostname, IPV4_LOOPBACK), + (socket.AI_PASSIVE|socket.AI_CANONNAME, local_hostname, local_hostname, local_ip_address), ]: addrinfos = socket.getaddrinfo(host_param, 0, socket.AF_INET, socket.SOCK_STREAM, 0, flags) for family, socktype, proto, canonname, sockaddr in addrinfos: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pj...@us...> - 2009-07-07 04:49:26
|
Revision: 6518 http://jython.svn.sourceforge.net/jython/?rev=6518&view=rev Author: pjenvey Date: 2009-07-07 04:49:12 +0000 (Tue, 07 Jul 2009) Log Message: ----------- unused method Modified Paths: -------------- trunk/jython/src/org/python/core/__builtin__.java Modified: trunk/jython/src/org/python/core/__builtin__.java =================================================================== --- trunk/jython/src/org/python/core/__builtin__.java 2009-07-07 03:41:42 UTC (rev 6517) +++ trunk/jython/src/org/python/core/__builtin__.java 2009-07-07 04:49:12 UTC (rev 6518) @@ -465,10 +465,6 @@ return x._divmod(y); } - public static PyEnumerate enumerate(PyObject seq) { - return new PyEnumerate(seq); - } - private static boolean PyMapping_check(PyObject o, boolean rw) { return o == null || o == Py.None || This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |