From: Finn B. <bc...@us...> - 2001-11-27 13:51:41
|
Update of /cvsroot/jython/jython/org/python/util In directory usw-pr-cvs1:/tmp/cvs-serv9040/util Modified Files: InteractiveConsole.java InteractiveInterpreter.java PyServlet.java PythonInterpreter.java PythonObjectInputStream.java ReadlineConsole.java jython.java Log Message: Whitespace normalization. Index: InteractiveConsole.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/util/InteractiveConsole.java,v retrieving revision 2.8 retrieving revision 2.9 diff -C2 -d -r2.8 -r2.9 *** InteractiveConsole.java 2001/10/28 17:13:44 2.8 --- InteractiveConsole.java 2001/11/27 13:51:38 2.9 *************** *** 34,38 **** public static String getDefaultBanner() { String compiler = System.getProperty("java.compiler"); ! return "Jython " + PySystemState.version + " on " + PySystemState.platform + " (JIT: " + --- 34,38 ---- public static String getDefaultBanner() { String compiler = System.getProperty("java.compiler"); ! return "Jython " + PySystemState.version + " on " + PySystemState.platform + " (JIT: " + Index: InteractiveInterpreter.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/util/InteractiveInterpreter.java,v retrieving revision 2.6 retrieving revision 2.7 diff -C2 -d -r2.6 -r2.7 *** InteractiveInterpreter.java 2001/10/28 17:13:44 2.6 --- InteractiveInterpreter.java 2001/11/27 13:51:38 2.7 *************** *** 110,114 **** buffer.setLength(0); } ! /** Pause the current code, sneak an exception raiser into * sys.trace_func, and then continue the code hoping that JPython will --- 110,114 ---- buffer.setLength(0); } ! /** Pause the current code, sneak an exception raiser into * sys.trace_func, and then continue the code hoping that JPython will *************** *** 123,127 **** ts.systemState.tracefunc = oldTrace; //ts.thread.join(); ! } } --- 123,127 ---- ts.systemState.tracefunc = oldTrace; //ts.thread.join(); ! } } Index: PyServlet.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/util/PyServlet.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** PyServlet.java 2001/07/18 15:53:56 1.11 --- PyServlet.java 2001/11/27 13:51:38 1.12 *************** *** 9,13 **** ! /** * This servlet is used to re-serve JPython servlets. It stores * bytecode for JPython servlets and re-uses it if the underlying .py --- 9,13 ---- ! /** * This servlet is used to re-serve JPython servlets. It stores * bytecode for JPython servlets and re-uses it if the underlying .py *************** *** 20,24 **** * <li>Finn Bock * </ul> ! * If somebody is missing from this list, let us know. * <p> * --- 20,24 ---- * <li>Finn Bock * </ul> ! * If somebody is missing from this list, let us know. * <p> * *************** *** 77,81 **** props.put(name, getInitParameter(name)); } ! if (props.getProperty("python.home") == null && System.getProperty("python.home") == null) { props.put("python.home", rootPath + "WEB-INF" + --- 77,81 ---- props.put(name, getInitParameter(name)); } ! if (props.getProperty("python.home") == null && System.getProperty("python.home") == null) { props.put("python.home", rootPath + "WEB-INF" + *************** *** 123,127 **** interp.set("__file__", rpath); ! HttpServlet servlet = getServlet(rpath); if (servlet != null) --- 123,127 ---- interp.set("__file__", rpath); ! HttpServlet servlet = getServlet(rpath); if (servlet != null) *************** *** 178,186 **** throw new ServletException("No callable (class or function) "+ "named " + name + " in " + path); ! PyObject pyServlet = cls.__call__(); Object o = pyServlet.__tojava__(HttpServlet.class); if (o == Py.NoConversion) ! throw new ServletException("The value from " + name + "must extend HttpServlet"); servlet = (HttpServlet)o; --- 178,186 ---- throw new ServletException("No callable (class or function) "+ "named " + name + " in " + path); ! PyObject pyServlet = cls.__call__(); Object o = pyServlet.__tojava__(HttpServlet.class); if (o == Py.NoConversion) ! throw new ServletException("The value from " + name + "must extend HttpServlet"); servlet = (HttpServlet)o; Index: PythonInterpreter.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/util/PythonInterpreter.java,v retrieving revision 2.9 retrieving revision 2.10 diff -C2 -d -r2.9 -r2.10 *** PythonInterpreter.java 2001/11/03 19:26:02 2.9 --- PythonInterpreter.java 2001/11/27 13:51:38 2.10 *************** *** 18,24 **** protected CompilerFlags cflags = null; ! /** ! * Initialize the jython runtime. This method should only be * called once, and should be call before any other python objects * are created (included a PythonInterpreter). --- 18,24 ---- protected CompilerFlags cflags = null; ! /** ! * Initialize the jython runtime. This method should only be * called once, and should be call before any other python objects * are created (included a PythonInterpreter). *************** *** 32,39 **** * will override system properties and * registry properties. ! * @param argv Command line argument. These values will * assigned to sys.argv. */ ! public static void initialize(Properties preProperties, Properties postProperties, String[] argv) { --- 32,39 ---- * will override system properties and * registry properties. ! * @param argv Command line argument. These values will * assigned to sys.argv. */ ! public static void initialize(Properties preProperties, Properties postProperties, String[] argv) { *************** *** 59,63 **** this(dict, null); } ! public PythonInterpreter(PyObject dict, PySystemState systemState) { PySystemState.initialize(); --- 59,63 ---- this(dict, null); } ! public PythonInterpreter(PyObject dict, PySystemState systemState) { PySystemState.initialize(); *************** *** 74,82 **** setState(); } ! protected void setState() { Py.setSystemState(systemState); } ! /** * Set the Python object to use for the standard output stream --- 74,82 ---- setState(); } ! protected void setState() { Py.setSystemState(systemState); } ! /** * Set the Python object to use for the standard output stream *************** *** 87,96 **** systemState.stdout = outStream; } ! /** * Set a java.io.Writer to use for the standard output stream * * @param outStream Writer to use as output stream ! */ public void setOut(java.io.Writer outStream) { setOut(new PyFile(outStream)); --- 87,96 ---- systemState.stdout = outStream; } ! /** * Set a java.io.Writer to use for the standard output stream * * @param outStream Writer to use as output stream ! */ public void setOut(java.io.Writer outStream) { setOut(new PyFile(outStream)); *************** *** 101,121 **** * * @param outStream OutputStream to use as output stream ! */ public void setOut(java.io.OutputStream outStream) { setOut(new PyFile(outStream)); } ! public void setErr(PyObject outStream) { systemState.stderr = outStream; } ! public void setErr(java.io.Writer outStream) { setErr(new PyFile(outStream)); } ! public void setErr(java.io.OutputStream outStream) { setErr(new PyFile(outStream)); } ! /** * Evaluate a string as Python source and return the result --- 101,121 ---- * * @param outStream OutputStream to use as output stream ! */ public void setOut(java.io.OutputStream outStream) { setOut(new PyFile(outStream)); } ! public void setErr(PyObject outStream) { systemState.stderr = outStream; } ! public void setErr(java.io.Writer outStream) { setErr(new PyFile(outStream)); } ! public void setErr(java.io.OutputStream outStream) { setErr(new PyFile(outStream)); } ! /** * Evaluate a string as Python source and return the result *************** *** 137,141 **** Py.exec(Py.compile_flags(s, "<string>", "exec",cflags), locals, locals); } ! /** * Execute a Python code object in the local namespace --- 137,141 ---- Py.exec(Py.compile_flags(s, "<string>", "exec",cflags), locals, locals); } ! /** * Execute a Python code object in the local namespace *************** *** 161,165 **** execfile(s, "<iostream>"); } ! public void execfile(java.io.InputStream s, String name) { setState(); --- 161,165 ---- execfile(s, "<iostream>"); } ! public void execfile(java.io.InputStream s, String name) { setState(); *************** *** 180,184 **** * * @param name the name of the variable ! * @param value the value to set the variable to. Will be automatically converted to an appropriate Python object. */ --- 180,184 ---- * * @param name the name of the variable ! * @param value the value to set the variable to. Will be automatically converted to an appropriate Python object. */ *************** *** 206,210 **** return locals.__finditem__(name.intern()); } ! /** * Get the value of a variable in the local namespace Value will be --- 206,210 ---- return locals.__finditem__(name.intern()); } ! /** * Get the value of a variable in the local namespace Value will be *************** *** 215,219 **** * @param name the name of the variable * @param javaclass the class of object to return ! */ public Object get(String name, Class javaclass) { return Py.tojava(locals.__finditem__(name.intern()), javaclass); --- 215,219 ---- * @param name the name of the variable * @param javaclass the class of object to return ! */ public Object get(String name, Class javaclass) { return Py.tojava(locals.__finditem__(name.intern()), javaclass); Index: PythonObjectInputStream.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/util/PythonObjectInputStream.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** PythonObjectInputStream.java 2001/02/01 13:23:41 1.7 --- PythonObjectInputStream.java 2001/11/27 13:51:38 1.8 *************** *** 38,44 **** } catch (ClassNotFoundException exc) { PyObject m = importModule(clsName); ! //System.out.println("m:" + m); Object cls = m.__tojava__(Class.class); ! //System.out.println("cls:" + cls); if (cls != null && cls != Py.NoConversion) return (Class) cls; --- 38,44 ---- } catch (ClassNotFoundException exc) { PyObject m = importModule(clsName); ! //System.out.println("m:" + m); Object cls = m.__tojava__(Class.class); ! //System.out.println("cls:" + cls); if (cls != null && cls != Py.NoConversion) return (Class) cls; *************** *** 49,53 **** private static PyObject importModule(String name) { ! PyObject silly_list = new PyTuple(new PyString[] { Py.newString("__doc__"), }); --- 49,53 ---- private static PyObject importModule(String name) { ! PyObject silly_list = new PyTuple(new PyString[] { Py.newString("__doc__"), }); Index: ReadlineConsole.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/util/ReadlineConsole.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ReadlineConsole.java 2001/11/27 13:04:56 1.3 --- ReadlineConsole.java 2001/11/27 13:51:38 1.4 *************** *** 18,22 **** public ReadlineConsole(PyObject locals, String filename) { super(locals,filename); ! Readline.initReadline("jpython"); } --- 18,22 ---- public ReadlineConsole(PyObject locals, String filename) { super(locals,filename); ! Readline.initReadline("jpython"); } Index: jython.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/util/jython.java,v retrieving revision 2.21 retrieving revision 2.22 diff -C2 -d -r2.21 -r2.22 *** jython.java 2001/11/03 19:26:02 2.21 --- jython.java 2001/11/27 13:51:38 2.22 *************** *** 30,34 **** // TBD: this is kind of gross because a local called `zipfile' just // magically shows up in the module's globals. Either `zipfile' ! // should be called `__zipfile__' or (preferrably, IMO), __run__.py // should be imported and a main() function extracted. This // function should be called passing zipfile in as an argument. --- 30,34 ---- // TBD: this is kind of gross because a local called `zipfile' just // magically shows up in the module's globals. Either `zipfile' ! // should be called `__zipfile__' or (preferrably, IMO), __run__.py // should be imported and a main() function extracted. This // function should be called passing zipfile in as an argument. *************** *** 72,84 **** System.exit(exitcode); } ! // Setup the basic python system state from these options PySystemState.initialize(System.getProperties(), opts.properties, opts.argv); ! if (opts.notice) { System.err.println(InteractiveConsole.getDefaultBanner()); } ! // Now create an interpreter InteractiveConsole interp = null; --- 72,84 ---- System.exit(exitcode); } ! // Setup the basic python system state from these options PySystemState.initialize(System.getProperties(), opts.properties, opts.argv); ! if (opts.notice) { System.err.println(InteractiveConsole.getDefaultBanner()); } ! // Now create an interpreter InteractiveConsole interp = null; *************** *** 138,142 **** } } ! if (opts.command != null) { try { --- 138,142 ---- } } ! if (opts.command != null) { try { *************** *** 146,150 **** } } ! // was there a filename on the command line? if (opts.filename != null) { --- 146,150 ---- } } ! // was there a filename on the command line? if (opts.filename != null) { *************** *** 272,276 **** else if (arg.equals("-c")) { command = args[++index]; ! if (!fixInteractive) interactive = false; break; } --- 272,276 ---- else if (arg.equals("-c")) { command = args[++index]; ! if (!fixInteractive) interactive = false; break; } *************** *** 282,286 **** } else if (arg.startsWith("-D")) { ! String key = null; String value = null; int equals = arg.indexOf("="); --- 282,286 ---- } else if (arg.startsWith("-D")) { ! String key = null; String value = null; int equals = arg.indexOf("="); |