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: Finn B. <bc...@us...> - 2001-02-22 11:01:54
|
Update of /cvsroot/jython/jython/org/python/core In directory usw-pr-cvs1:/tmp/cvs-serv4155 Modified Files: PySystemState.java Py.java Log Message: Removed the initialization of string exceptions. Index: PySystemState.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/core/PySystemState.java,v retrieving revision 2.47 retrieving revision 2.48 diff -C2 -r2.47 -r2.48 *** PySystemState.java 2001/02/22 10:56:30 2.47 --- PySystemState.java 2001/02/22 11:02:55 2.48 *************** *** 75,78 **** --- 75,80 ---- public PyObject executable = Py.None; + private static PyJavaClass __builtin__class; + private ClassLoader classLoader = null; public ClassLoader getClassLoader() { *************** *** 183,188 **** // This isn't quite right... ! builtins = PyJavaClass.lookup(__builtin__.class). ! __getattr__("__dict__"); PyModule __builtin__ = new PyModule("__builtin__", builtins); modules.__setitem__("__builtin__", __builtin__); --- 185,189 ---- // This isn't quite right... ! builtins = __builtin__class.__getattr__("__dict__"); PyModule __builtin__ = new PyModule("__builtin__", builtins); modules.__setitem__("__builtin__", __builtin__); *************** *** 352,356 **** if (classLoader != null) Py.defaultSystemState.setClassLoader(classLoader); ! Py.initClassExceptions(); // Make sure that Exception classes have been loaded PySyntaxError dummy = new PySyntaxError("", 1,1,"", ""); --- 353,357 ---- if (classLoader != null) Py.defaultSystemState.setClassLoader(classLoader); ! Py.initClassExceptions(__builtin__class.__getattr__("__dict__")); // Make sure that Exception classes have been loaded PySyntaxError dummy = new PySyntaxError("", 1,1,"", ""); *************** *** 373,377 **** Py.Space = new PyString(" "); ! Py.initStringExceptions(); // Setup standard wrappers for stdout and stderr... --- 374,378 ---- Py.Space = new PyString(" "); ! __builtin__class = PyJavaClass.lookup(__builtin__.class); // Setup standard wrappers for stdout and stderr... Index: Py.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/core/Py.java,v retrieving revision 2.36 retrieving revision 2.37 diff -C2 -r2.36 -r2.37 *** Py.java 2001/02/14 22:27:32 2.36 --- Py.java 2001/02/22 11:02:55 2.37 *************** *** 378,539 **** } ! // This is just to save a reference, so the weak implementation ! // of internal tables does not remove it shortly after initialization. ! private static PyJavaClass __builtin__class; ! ! public static void setBuiltinExceptions() { ! __builtin__class = ! PyJavaClass.lookup(org.python.core.__builtin__.class); ! PyObject dict = __builtin__class.__getattr__("__dict__"); ! dict.__setitem__("Exception", Py.Exception); ! dict.__setitem__("TypeError", Py.TypeError); ! dict.__setitem__("LookupError", Py.LookupError); ! dict.__setitem__("IOError", Py.IOError); ! dict.__setitem__("ArithmeticError", Py.ArithmeticError); ! dict.__setitem__("NotImplementedError", Py.NotImplementedError); ! dict.__setitem__("OSError", Py.OSError); ! dict.__setitem__("SystemError", Py.SystemError); ! dict.__setitem__("RuntimeError", Py.RuntimeError); ! dict.__setitem__("AssertionError", Py.AssertionError); ! dict.__setitem__("FloatingPointError", Py.FloatingPointError); ! dict.__setitem__("ValueError", Py.ValueError); ! dict.__setitem__("UnicodeError", Py.UnicodeError); ! dict.__setitem__("NameError", Py.NameError); ! dict.__setitem__("UnboundLocalError", Py.UnboundLocalError); ! dict.__setitem__("EOFError", Py.EOFError); ! dict.__setitem__("KeyError", Py.KeyError); ! dict.__setitem__("MemoryError", Py.MemoryError); ! dict.__setitem__("SystemExit", Py.SystemExit); ! dict.__setitem__("KeyboardInterrupt", Py.KeyboardInterrupt); ! dict.__setitem__("OverflowError", Py.OverflowError); ! dict.__setitem__("ZeroDivisionError", Py.ZeroDivisionError); ! dict.__setitem__("StandardError", Py.StandardError); ! dict.__setitem__("IndexError", Py.IndexError); ! dict.__setitem__("ImportError", Py.ImportError); ! dict.__setitem__("EnvironmentError", Py.EnvironmentError); ! dict.__setitem__("AttributeError", Py.AttributeError); ! dict.__setitem__("SyntaxError", Py.SyntaxError); ! dict.__setitem__("IndentationError", Py.IndentationError); ! dict.__setitem__("TabError", Py.TabError); ! } ! ! ! static void initStringExceptions() { ! TypeError = new PyString("TypeError"); ! IOError = new PyString("IOError"); ! NotImplementedError = new PyString("NotImplementedError"); ! OSError = new PyString("OSError"); ! SystemError = new PyString("SystemError"); ! AssertionError = new PyString("AssertionError"); ! FloatingPointError = new PyString("FloatingPointError"); ! ValueError = new PyString("ValueError"); ! UnicodeError = new PyString("UnicodeError"); ! NameError = new PyString("NameError"); ! UnboundLocalError = new PyString("UnboundLocalError"); ! EOFError = new PyString("EOFError"); ! KeyError = new PyString("KeyError"); ! MemoryError = new PyString("MemoryError"); ! SystemExit = new PyString("SystemExit"); ! KeyboardInterrupt = new PyString("KeyboardInterrupt"); ! OverflowError = new PyString("OverflowError"); ! ZeroDivisionError = new PyString("ZeroDivisionError"); ! IndexError = new PyString("IndexError"); ! ImportError = new PyString("ImportError"); ! AttributeError = new PyString("AttributeError"); ! SyntaxError = new PyString("SyntaxError"); ! ! LookupError = new PyTuple(new PyObject[] ! {Py.IndexError, Py.KeyError}); ! ! ArithmeticError = new PyTuple(new PyObject[] ! {Py.ZeroDivisionError, Py.OverflowError, Py.FloatingPointError}); ! ! RuntimeError = new PyTuple(new PyObject[] ! {Py.NotImplementedError}); ! ! EnvironmentError = new PyTuple(new PyObject[] ! {Py.OSError, Py.IOError}); ! ! StandardError = new PyTuple(new PyObject[] ! {Py.ValueError, Py.TypeError, Py.NameError, ! Py.AssertionError, Py.LookupError, Py.SyntaxError, ! Py.SystemError, Py.KeyboardInterrupt, Py.AttributeError, ! Py.MemoryError, Py.EnvironmentError, Py.RuntimeError, ! Py.ImportError, Py.ArithmeticError, Py.EOFError, ! Py.UnicodeError, Py.UnboundLocalError, ! }); ! ! Exception = new PyTuple(new PyObject[] ! {Py.StandardError, Py.SystemExit}); ! ! JavaError = new PyString("JavaError"); ! setBuiltinExceptions(); } ! static void initClassExceptions() { ! PyObject exceptions = imp.load("exceptions"); ! PyObject tmp; ! tmp = exceptions.__findattr__("Exception"); ! if (tmp != null) Exception = tmp; ! tmp = exceptions.__findattr__("TypeError"); ! if (tmp != null) TypeError = tmp; ! tmp = exceptions.__findattr__("LookupError"); ! if (tmp != null) LookupError = tmp; ! tmp = exceptions.__findattr__("IOError"); ! if (tmp != null) IOError = tmp; ! tmp = exceptions.__findattr__("ArithmeticError"); ! if (tmp != null) ArithmeticError = tmp; ! tmp = exceptions.__findattr__("NotImplementedError"); ! if (tmp != null) NotImplementedError = tmp; ! tmp = exceptions.__findattr__("OSError"); ! if (tmp != null) OSError = tmp; ! tmp = exceptions.__findattr__("SystemError"); ! if (tmp != null) SystemError = tmp; ! tmp = exceptions.__findattr__("RuntimeError"); ! if (tmp != null) RuntimeError = tmp; ! tmp = exceptions.__findattr__("AssertionError"); ! if (tmp != null) AssertionError = tmp; ! tmp = exceptions.__findattr__("FloatingPointError"); ! if (tmp != null) FloatingPointError = tmp; ! tmp = exceptions.__findattr__("ValueError"); ! if (tmp != null) ValueError = tmp; ! tmp = exceptions.__findattr__("UnicodeError"); ! if (tmp != null) UnicodeError = tmp; ! tmp = exceptions.__findattr__("NameError"); ! if (tmp != null) NameError = tmp; ! tmp = exceptions.__findattr__("UnboundLocalError"); ! if (tmp != null) UnboundLocalError = tmp; ! tmp = exceptions.__findattr__("EOFError"); ! if (tmp != null) EOFError = tmp; ! tmp = exceptions.__findattr__("KeyError"); ! if (tmp != null) KeyError = tmp; ! tmp = exceptions.__findattr__("MemoryError"); ! if (tmp != null) MemoryError = tmp; ! tmp = exceptions.__findattr__("SystemExit"); ! if (tmp != null) SystemExit = tmp; ! tmp = exceptions.__findattr__("KeyboardInterrupt"); ! if (tmp != null) KeyboardInterrupt = tmp; ! tmp = exceptions.__findattr__("OverflowError"); ! if (tmp != null) OverflowError = tmp; ! tmp = exceptions.__findattr__("ZeroDivisionError"); ! if (tmp != null) ZeroDivisionError = tmp; ! tmp = exceptions.__findattr__("StandardError"); ! if (tmp != null) StandardError = tmp; ! tmp = exceptions.__findattr__("IndexError"); ! if (tmp != null) IndexError = tmp; ! tmp = exceptions.__findattr__("ImportError"); ! if (tmp != null) ImportError = tmp; ! tmp = exceptions.__findattr__("EnvironmentError"); ! if (tmp != null) EnvironmentError = tmp; ! tmp = exceptions.__findattr__("AttributeError"); ! if (tmp != null) AttributeError = tmp; ! tmp = exceptions.__findattr__("SyntaxError"); ! if (tmp != null) SyntaxError = tmp; ! tmp = exceptions.__findattr__("IndentationError"); ! if (tmp != null) IndentationError = tmp; ! tmp = exceptions.__findattr__("TabError"); ! if (tmp != null) TabError = tmp; ! setBuiltinExceptions(); } --- 378,421 ---- } ! private static PyObject initExc(String name, PyObject exceptions, ! PyObject dict) { ! PyObject tmp = exceptions.__getattr__(name); ! dict.__setitem__(name, tmp); ! return tmp; } ! static void initClassExceptions(PyObject dict) { ! PyObject exc = imp.load("exceptions"); ! Exception = initExc("Exception", exc, dict); ! SystemExit = initExc("SystemExit", exc, dict); ! StandardError = initExc("StandardError", exc, dict); ! KeyboardInterrupt = initExc("KeyboardInterrupt", exc, dict); ! ImportError = initExc("ImportError", exc, dict); ! EnvironmentError = initExc("EnvironmentError", exc, dict); ! IOError = initExc("IOError", exc, dict); ! OSError = initExc("OSError", exc, dict); ! EOFError = initExc("EOFError", exc, dict); ! RuntimeError = initExc("RuntimeError", exc, dict); ! NotImplementedError = initExc("NotImplementedError", exc, dict); ! NameError = initExc("NameError", exc, dict); ! UnboundLocalError = initExc("UnboundLocalError", exc, dict); ! AttributeError = initExc("AttributeError", exc, dict); ! SyntaxError = initExc("SyntaxError", exc, dict); ! IndentationError = initExc("IndentationError", exc, dict); ! TabError = initExc("TabError", exc, dict); ! TypeError = initExc("TypeError", exc, dict); ! AssertionError = initExc("AssertionError", exc, dict); ! LookupError = initExc("LookupError", exc, dict); ! IndexError = initExc("IndexError", exc, dict); ! KeyError = initExc("KeyError", exc, dict); ! ArithmeticError = initExc("ArithmeticError", exc, dict); ! OverflowError = initExc("OverflowError", exc, dict); ! ZeroDivisionError = initExc("ZeroDivisionError", exc, dict); ! FloatingPointError = initExc("FloatingPointError", exc, dict); ! ValueError = initExc("ValueError", exc, dict); ! UnicodeError = initExc("UnicodeError", exc, dict); ! SystemError = initExc("SystemError", exc, dict); ! MemoryError = initExc("MemoryError", exc, dict); } |
From: Finn B. <bc...@us...> - 2001-02-22 10:55:28
|
Update of /cvsroot/jython/jython/org/python/core In directory usw-pr-cvs1:/tmp/cvs-serv3147 Modified Files: PySystemState.java Log Message: Added sys._getframe() methods. Index: PySystemState.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/core/PySystemState.java,v retrieving revision 2.46 retrieving revision 2.47 diff -C2 -r2.46 -r2.47 *** PySystemState.java 2001/02/22 10:55:06 2.46 --- PySystemState.java 2001/02/22 10:56:30 2.47 *************** *** 91,94 **** --- 91,110 ---- } + public static PyFrame _getframe() { + return _getframe(-1); + } + + public static PyFrame _getframe(int depth) { + PyFrame f = Py.getFrame(); + + while (depth > 0 && f != null) { + f = f.f_back; + --depth; + } + if (f == null) + throw Py.ValueError("call stack is not deep enough"); + return f; + } + public PyObject stdout, stderr, stdin; public PyObject __stdout__, __stderr__, __stdin__; |
From: Finn B. <bc...@us...> - 2001-02-22 10:54:04
|
Update of /cvsroot/jython/jython/org/python/core In directory usw-pr-cvs1:/tmp/cvs-serv2761 Modified Files: PySystemState.java Log Message: Updated version number. Index: PySystemState.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/core/PySystemState.java,v retrieving revision 2.45 retrieving revision 2.46 diff -C2 -r2.45 -r2.46 *** PySystemState.java 2001/02/02 09:28:37 2.45 --- PySystemState.java 2001/02/22 10:55:06 2.46 *************** *** 14,18 **** * The current version of JPython. */ ! public static String version = "2.0"; /** --- 14,18 ---- * The current version of JPython. */ ! public static String version = "2.1pre-a1"; /** |
From: Finn B. <bc...@us...> - 2001-02-21 14:33:10
|
Update of /cvsroot/jython/jython/org/python/core In directory usw-pr-cvs1:/tmp/cvs-serv25342 Modified Files: PyList.java Log Message: docompare(): Compare using the rich-comp interface. Index: PyList.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/core/PyList.java,v retrieving revision 2.18 retrieving revision 2.19 diff -C2 -r2.18 -r2.19 *** PyList.java 2001/02/02 09:28:37 2.18 --- PyList.java 2001/02/21 14:34:09 2.19 *************** *** 409,415 **** * function is NULL. */ ! private static int docompare(PyObject x, PyObject y, PyObject compare) { ! if (compare == null) ! return x._cmp(y); PyObject ret = compare.__call__(new PyObject[] {x, y}); --- 409,425 ---- * function is NULL. */ ! private static int docompare(PyObject x, PyObject y, ! PyObject compare, String cmpop) { ! if (compare == null) { ! /* NOTE: we rely on the fact here that the sorting algorithm ! only ever checks whether k<0, i.e., whether x<y. So we ! invoke the rich comparison function with _lt ('<'), and ! return -1 when it returns true and 0 when it returns ! false. */ ! if (cmpop == "<") ! return x._lt(y).__nonzero__() ? -1 : 0; ! if (cmpop == "<=") ! return x._le(y).__nonzero__() ? -1 : 1; ! } PyObject ret = compare.__call__(new PyObject[] {x, y}); *************** *** 432,436 **** while (--j >= off) { PyObject q = array[j]; ! if (docompare(q, key, compare) <= 0) break; array[j+1] = q; --- 442,446 ---- while (--j >= off) { PyObject q = array[j]; ! if (docompare(q, key, compare, "<=") <= 0) break; array[j+1] = q; *************** *** 495,509 **** left = array[l]; right = array[lo]; ! if (docompare(left, right, compare) < 0) { array[lo] = left; array[l] = right; } left = array[r]; right = array[l]; ! if (docompare(left, right, compare) < 0) { array[r] = left; array[l] = right; } left = array[l]; right = array[lo]; ! if (docompare(left, right, compare) < 0) { array[lo] = left; array[l] = right; } --- 505,519 ---- left = array[l]; right = array[lo]; ! if (docompare(left, right, compare, "<") < 0) { array[lo] = left; array[l] = right; } left = array[r]; right = array[l]; ! if (docompare(left, right, compare, "<") < 0) { array[r] = left; array[l] = right; } left = array[l]; right = array[lo]; ! if (docompare(left, right, compare, "<") < 0) { array[lo] = left; array[l] = right; } *************** *** 516,520 **** /* Move left index to element > pivot */ while (l < hi) { ! if (docompare(array[l], pivot, compare) >= 0) break; l++; --- 526,530 ---- /* Move left index to element > pivot */ while (l < hi) { ! if (docompare(array[l], pivot, compare, "<") >= 0) break; l++; *************** *** 522,526 **** /* Move right index to element < pivot */ while (r >= lo) { ! if (docompare(pivot, array[r], compare) >= 0) break; r--; --- 532,536 ---- /* Move right index to element < pivot */ while (r >= lo) { ! if (docompare(pivot, array[r], compare, "<") >= 0) break; r--; |
From: Finn B. <bc...@us...> - 2001-02-21 14:31:51
|
Update of /cvsroot/jython/jython/org/python/core In directory usw-pr-cvs1:/tmp/cvs-serv25170 Modified Files: ArgParser.java Log Message: Added getList() which can retrive the remaining args as a list. Index: ArgParser.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/core/ArgParser.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** ArgParser.java 2001/02/01 16:41:10 1.2 --- ArgParser.java 2001/02/21 14:32:50 1.3 *************** *** 31,39 **** // A marker. private static Object required = new Object(); - private ArgParser(String funcname, PyObject[] args, String[] kws) { this.funcname = funcname; this.args = args; this.kws = kws; } --- 31,41 ---- // A marker. private static Object required = new Object(); + private static String[] emptyKws = new String[0]; private ArgParser(String funcname, PyObject[] args, String[] kws) { this.funcname = funcname; this.args = args; + if (kws == null) + kws = emptyKws; this.kws = kws; } *************** *** 100,103 **** --- 102,114 ---- } + public PyObject getList(int pos) { + int kws_start = args.length - kws.length; + if (pos < kws_start) { + PyObject[] ret = new PyObject[kws_start - pos]; + System.arraycopy(args, pos, ret, 0, kws_start - pos); + return new PyTuple(ret); + } + return Py.EmptyTuple; + } |
From: Finn B. <bc...@us...> - 2001-02-16 18:13:00
|
Update of /cvsroot/jython/jython/org/python/util In directory usw-pr-cvs1:/tmp/cvs-serv28216 Modified Files: PyServlet.java Log Message: Added missing import of HttpServlet in the example. Index: PyServlet.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/util/PyServlet.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** PyServlet.java 2001/02/14 22:31:05 1.6 --- PyServlet.java 2001/02/16 18:13:45 1.7 *************** *** 27,30 **** --- 27,31 ---- * e.g. http://localhost:8080/test/hello.py * + * from javax.servlet.http import HttpServlet * class hello(HttpServlet): * def doGet(self,req, res): |
From: Finn B. <bc...@us...> - 2001-02-16 18:11:57
|
Update of /cvsroot/jython/jython/org/python/core In directory usw-pr-cvs1:/tmp/cvs-serv27975 Modified Files: __builtin__.java Log Message: Added 3-arg getattr method. Index: __builtin__.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/core/__builtin__.java,v retrieving revision 2.28 retrieving revision 2.29 diff -C2 -r2.28 -r2.29 *** __builtin__.java 2001/02/14 22:19:38 2.28 --- __builtin__.java 2001/02/16 18:12:42 2.29 *************** *** 345,348 **** --- 345,355 ---- } + public static PyObject getattr(PyObject o, PyString n, PyObject def) { + PyObject val = o.__findattr__(n); + if (val != null) + return val; + return def; + } + public static PyObject globals() { return Py.getFrame().f_globals; |
From: Finn B. <bc...@us...> - 2001-02-16 18:11:17
|
Update of /cvsroot/jython/jython/org/python/core In directory usw-pr-cvs1:/tmp/cvs-serv27820 Modified Files: PyString.java Log Message: Speedup common string predicates: isspace(), isalpha() etc. Index: PyString.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/core/PyString.java,v retrieving revision 2.39 retrieving revision 2.40 diff -C2 -r2.39 -r2.40 *** PyString.java 2001/02/07 09:23:52 2.39 --- PyString.java 2001/02/16 18:12:02 2.40 *************** *** 50,53 **** --- 50,67 ---- case 3: return s.__repr__(); + case 4: + return Py.newBoolean(s.islower()); + case 5: + return Py.newBoolean(s.isalpha()); + case 6: + return Py.newBoolean(s.isdigit()); + case 7: + return Py.newBoolean(s.isupper()); + case 8: + return Py.newBoolean(s.isspace()); + case 9: + return Py.newBoolean(s.istitle()); + case 10: + return Py.newBoolean(s.isnumeric()); case 101: return new PyString(s.lower()); *************** *** 235,238 **** --- 249,259 ---- dict.__setitem__("__len__", new StringFuncs("__len__", 2, 0)); dict.__setitem__("__repr__", new StringFuncs("__repr__", 3, 0)); + dict.__setitem__("islower", new StringFuncs("islower", 4, 0)); + dict.__setitem__("isalpha", new StringFuncs("isalpha", 5, 0)); + dict.__setitem__("isdigit", new StringFuncs("isdigit", 6, 0)); + dict.__setitem__("isupper", new StringFuncs("isupper", 7, 0)); + dict.__setitem__("isspace", new StringFuncs("isspace", 8, 0)); + dict.__setitem__("istitle", new StringFuncs("istitle", 9, 0)); + dict.__setitem__("isnumeric", new StringFuncs("isnumeric", 10, 0)); dict.__setitem__("__cmp__", new StringFuncs("__cmp__", 11, 1)); dict.__setitem__("__add__", new StringFuncs("__add__", 12, 1)); |
From: Finn B. <bc...@us...> - 2001-02-16 18:09:34
|
Update of /cvsroot/jython/jython/org/python/core In directory usw-pr-cvs1:/tmp/cvs-serv27387 Modified Files: PyJavaClass.java Log Message: Fix bug #132462. Only use methods in public interfaces. Index: PyJavaClass.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/core/PyJavaClass.java,v retrieving revision 2.32 retrieving revision 2.33 diff -C2 -r2.32 -r2.33 *** PyJavaClass.java 2001/02/02 09:28:36 2.32 --- PyJavaClass.java 2001/02/16 18:10:19 2.33 *************** *** 163,167 **** if (__bases__ != null) return; ! Class interfaces[] = c.getInterfaces(); int nInterfaces = interfaces.length; int nBases = 0; --- 163,167 ---- if (__bases__ != null) return; ! Class interfaces[] = getAccessibleInterfaces(c); int nInterfaces = interfaces.length; int nBases = 0; *************** *** 206,209 **** --- 206,231 ---- proxyClass = c; __name__ = c.getName(); + } + + /** + * Return the list of all accessible interfaces for a class. This will + * only the public interfaces. Since we can't set accessibility on + * interfaces, the Options.respectJavaAccessibility is not honored. + */ + private static Class[] getAccessibleInterfaces(Class c) { + // can't modify accessibility of interfaces in Java2 + // thus get only public interfaces + Class[] in = c.getInterfaces(); + java.util.Vector v=new java.util.Vector(); + for (int i = 0; i < in.length; i++) { + if (!Modifier.isPublic(in[i].getModifiers())) + continue; + v.addElement(in[i]); + } + if (v.size() == in.length) + return in; + Class[] ret = new Class[v.size()]; + v.copyInto(ret); + return ret; } |
From: Finn B. <bc...@us...> - 2001-02-14 22:31:42
|
Update of /cvsroot/jython/jython/org/python/core In directory usw-pr-cvs1:/tmp/cvs-serv13394 Modified Files: imp.java Log Message: Removed trailing spaces. Index: imp.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/core/imp.java,v retrieving revision 2.38 retrieving revision 2.39 diff -C2 -r2.38 -r2.39 *** imp.java 2001/02/04 01:05:28 2.38 --- imp.java 2001/02/14 22:32:22 2.39 *************** *** 622,626 **** { PyObject __all__ = module.__findattr__("__all__"); ! if (__all__ != null) names = __all__; int i=0; PyObject name; --- 622,626 ---- { PyObject __all__ = module.__findattr__("__all__"); ! if (__all__ != null) names = __all__; int i=0; PyObject name; |
From: Finn B. <bc...@us...> - 2001-02-14 22:30:26
|
Update of /cvsroot/jython/jython/org/python/util In directory usw-pr-cvs1:/tmp/cvs-serv13236 Modified Files: PyServlet.java Log Message: Added destroyCache(). Called on reset and PyServlet destroy. Index: PyServlet.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/util/PyServlet.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** PyServlet.java 2001/02/14 09:17:21 1.5 --- PyServlet.java 2001/02/14 22:31:05 1.6 *************** *** 126,129 **** --- 126,130 ---- public void reset() { + destroyCache(); interp = new PythonInterpreter(null, new PySystemState()); cache.clear(); *************** *** 189,192 **** --- 190,206 ---- return servlet; } + + public void destroy() { + destroyCache(); + } + + + private void destroyCache() { + for (Enumeration e = cache.elements(); e.hasMoreElements(); ) { + CacheEntry entry = (CacheEntry) e.nextElement(); + entry.servlet.destroy(); + } + } + } |
From: Finn B. <bc...@us...> - 2001-02-14 22:29:43
|
Update of /cvsroot/jython/jython/Tools/jythonc In directory usw-pr-cvs1:/tmp/cvs-serv13056 Modified Files: proxies.py Log Message: addPyProxyInterface(): Moved call to Py.initProxy into __initProxy__ method and call __initProxy__ from proxy ctor. Index: proxies.py =================================================================== RCS file: /cvsroot/jython/jython/Tools/jythonc/proxies.py,v retrieving revision 2.8 retrieving revision 2.9 diff -C2 -r2.8 -r2.9 *** proxies.py 2001/01/07 09:11:10 2.8 --- proxies.py 2001/02/14 22:30:23 2.9 *************** *** 415,425 **** frozen = self.module.getFrozen() ! initargs = [this, jast.StringConstant(self.modname), ! jast.StringConstant(self.name), ! objects, self.packages, self.properties, ! frozen, jast.StringArray(self.modules)] - initproxy = jast.InvokeStatic("Py", "initProxy", initargs) - code = jast.Block([supercall, initproxy]) self.statements.append(jast.Constructor( --- 415,421 ---- frozen = self.module.getFrozen() ! initargs = [objects] ! initproxy = jast.InvokeLocal("__initProxy__", initargs) code = jast.Block([supercall, initproxy]) self.statements.append(jast.Constructor( *************** *** 450,453 **** --- 446,464 ---- self.statements.append(jast.Method("_getPySystemState", "public", ["PySystemState"], code)) + + + frozen = self.module.getFrozen() + this = jast.Identifier("this") + initargs = [this, jast.StringConstant(self.modname), + jast.StringConstant(self.name), + jast.Identifier("args"), self.packages, self.properties, + frozen, jast.StringArray(self.modules)] + + initproxy = jast.InvokeStatic("Py", "initProxy", initargs) + + + code = jast.Block([initproxy]) + self.statements.append(jast.Method("__initProxy__", "public", + ["void", ("Object[]", "args")], code)) self.interfaces.append(org.python.core.PyProxy) |
From: Finn B. <bc...@us...> - 2001-02-14 22:28:12
|
Update of /cvsroot/jython/jython In directory usw-pr-cvs1:/tmp/cvs-serv12987 Modified Files: build.xml Log Message: Better deafult value for debug property. Index: build.xml =================================================================== RCS file: /cvsroot/jython/jython/build.xml,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** build.xml 2001/02/07 09:17:03 1.7 --- build.xml 2001/02/14 22:28:52 1.8 *************** *** 5,9 **** <property name="sourceDir" value="." /> <property name="outputDir" value="build" /> ! <property name="debug" value="no" /> <available classname="java.util.List" property="java2" /> --- 5,9 ---- <property name="sourceDir" value="." /> <property name="outputDir" value="build" /> ! <property name="debug" value="off" /> <available classname="java.util.List" property="java2" /> |
From: Finn B. <bc...@us...> - 2001-02-14 22:26:52
|
Update of /cvsroot/jython/jython/org/python/core In directory usw-pr-cvs1:/tmp/cvs-serv12467 Modified Files: PyProxy.java Py.java Log Message: Call the instance ctor when the first access to a proxy meythod is issued. This help a little with bug #129363. The new __initProxy__ method can be called from the java superclass and that will help for the rest. More about this problem will be added to faq. Index: PyProxy.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/core/PyProxy.java,v retrieving revision 2.4 retrieving revision 2.5 diff -C2 -r2.4 -r2.5 *** PyProxy.java 2001/02/01 16:41:11 2.4 --- PyProxy.java 2001/02/14 22:27:32 2.5 *************** *** 11,13 **** --- 11,15 ---- abstract public void _setPySystemState(PySystemState ss); abstract public PySystemState _getPySystemState(); + + abstract public void __initProxy__(Object[] args); } Index: Py.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/core/Py.java,v retrieving revision 2.35 retrieving revision 2.36 diff -C2 -r2.35 -r2.36 *** Py.java 2001/02/04 15:07:32 2.35 --- Py.java 2001/02/14 22:27:32 2.36 *************** *** 276,281 **** public static PyObject jfindattr(PyProxy proxy, String name) { PyInstance o = proxy._getPyInstance(); ! if (o == null) ! return null; PyObject ret = o.__jfindattr__(name); if (ret == null) --- 276,283 ---- public static PyObject jfindattr(PyProxy proxy, String name) { PyInstance o = proxy._getPyInstance(); ! if (o == null) { ! proxy.__initProxy__(new Object[0]); ! o = proxy._getPyInstance(); ! } PyObject ret = o.__jfindattr__(name); if (ret == null) *************** *** 710,721 **** String[] modules) { - // System.out.println("initProxy"); - // frozen = false; initProperties(null, packages, props, frozenPackage, modules, proxy.getClass().getClassLoader()); ThreadState ts = getThreadState(); ! if (ts.getInitializingProxy() != null) { ! proxy._setPyInstance(ts.getInitializingProxy()); proxy._setPySystemState(ts.systemState); return; --- 712,728 ---- String[] modules) { initProperties(null, packages, props, frozenPackage, modules, proxy.getClass().getClassLoader()); + if (proxy._getPyInstance() != null) + return; + ThreadState ts = getThreadState(); ! PyInstance instance = ts.getInitializingProxy(); ! if (instance != null) { ! if (instance.javaProxy != null) ! throw Py.TypeError("Proxy instance reused"); ! instance.javaProxy = proxy; ! proxy._setPyInstance(instance); proxy._setPySystemState(ts.systemState); return; *************** *** 723,727 **** //System.out.println("path: "+sys.path.__str__()); - PyObject mod; // ??pending: findClass or should avoid sys.path loading? --- 730,733 ---- *************** *** 742,748 **** PyClass pyc = (PyClass)mod.__getattr__(pyclass.intern()); ! PyInstance instance = new PyInstance(pyc); instance.javaProxy = proxy; ! proxy._setPyInstance((PyInstance)instance); proxy._setPySystemState(ts.systemState); --- 748,754 ---- PyClass pyc = (PyClass)mod.__getattr__(pyclass.intern()); ! instance = new PyInstance(pyc); instance.javaProxy = proxy; ! proxy._setPyInstance(instance); proxy._setPySystemState(ts.systemState); |
From: Finn B. <bc...@us...> - 2001-02-14 22:23:00
|
Update of /cvsroot/jython/jython/org/python/compiler In directory usw-pr-cvs1:/tmp/cvs-serv12247 Modified Files: JavaMaker.java Log Message: addProxy(): Moved proxy init call into its own __initProxy__ method. Call this method from ctor. Index: JavaMaker.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/compiler/JavaMaker.java,v retrieving revision 2.7 retrieving revision 2.8 diff -C2 -r2.7 -r2.8 *** JavaMaker.java 2000/10/19 18:10:28 2.7 --- JavaMaker.java 2001/02/14 22:23:40 2.8 *************** *** 69,75 **** callSuper(code, "<init>", name, parameters, null, sig); code.aload(0); code.ldc(pythonModule); code.ldc(pythonClass); ! getArgs(code, parameters); makeStrings(code, packages); --- 69,93 ---- callSuper(code, "<init>", name, parameters, null, sig); code.aload(0); + getArgs(code, parameters); + + int initProxy = code.pool.Methodref( + classfile.name, "__initProxy__", + "([Ljava/lang/Object;)V"); + code.invokevirtual(initProxy); + code.return_(); + } + + public void addProxy() throws Exception { + if (methods != null) + super.addProxy(); + + // _initProxy method + Code code = classfile.addMethod("__initProxy__", "([Ljava/lang/Object;)V", Modifier.PUBLIC); + + code.aload(0); code.ldc(pythonModule); code.ldc(pythonClass); ! ! code.aload(1); makeStrings(code, packages); *************** *** 83,91 **** code.invokestatic(initProxy); code.return_(); - } - public void addProxy() throws Exception { - if (methods != null) - super.addProxy(); if (main) addMain(); --- 101,105 ---- |
From: Finn B. <bc...@us...> - 2001-02-14 22:21:18
|
Update of /cvsroot/jython/jython/org/python/core In directory usw-pr-cvs1:/tmp/cvs-serv11941 Modified Files: PyInstance.java Log Message: makeProxy(): Add some extra validate that the instance and proxy match paired correctly. Cleanup old code comments. Index: PyInstance.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/core/PyInstance.java,v retrieving revision 2.18 retrieving revision 2.19 diff -C2 -r2.18 -r2.19 *** PyInstance.java 2001/02/07 09:23:52 2.18 --- PyInstance.java 2001/02/14 22:21:58 2.19 *************** *** 58,68 **** public PyInstance(PyClass iclass, PyObject dict) { super(iclass); - //__class__ = iclass; __dict__ = dict; - //Prepare array of proxy classes to be possibly filled in in __init__ - /*if (__class__.proxyClass != null) { - //System.err.println("proxies: "+__class__.__name__); - //javaProxies = new Object[__class__.proxyClasses.length]; - }*/ } --- 58,62 ---- *************** *** 97,110 **** ts.popInitializingProxy(); } ! //proxy._setPyInstance(this); ! //proxy._setPySystemState(Py.getSystemState()); javaProxy = proxy; } - - /*protected void setProxy(PyProxy proxy, int index) { - proxy._setPyInstance(this); - proxy._setPySystemState(Py.getSystemState()); - javaProxies[index] = proxy; - }*/ public Object __tojava__(Class c) { --- 91,107 ---- ts.popInitializingProxy(); } ! ! if (javaProxy != null && javaProxy != proxy) { ! // The javaProxy can be initialized in Py.jfindattr() ! throw Py.TypeError("Proxy instance already initialized"); ! } ! PyInstance proxyInstance = proxy._getPyInstance(); ! if (proxyInstance != null && proxyInstance != this) { ! // The proxy was initialized to another instance!! ! throw Py.TypeError("Proxy initialization conflict"); ! } ! javaProxy = proxy; } public Object __tojava__(Class c) { |
From: Finn B. <bc...@us...> - 2001-02-14 22:18:58
|
Update of /cvsroot/jython/jython/org/python/core In directory usw-pr-cvs1:/tmp/cvs-serv11790 Modified Files: __builtin__.java Log Message: min(), max(): change exception type to match CPython. Index: __builtin__.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/core/__builtin__.java,v retrieving revision 2.27 retrieving revision 2.28 diff -C2 -r2.27 -r2.28 *** __builtin__.java 2001/02/02 09:28:37 2.27 --- __builtin__.java 2001/02/14 22:19:38 2.28 *************** *** 525,529 **** PyObject max = o.__finditem__(0); if (max == null) ! throw Py.TypeError("max of empty sequence"); PyObject element; int i=1; --- 525,529 ---- PyObject max = o.__finditem__(0); if (max == null) ! throw Py.ValueError("max of empty sequence"); PyObject element; int i=1; *************** *** 544,548 **** PyObject min = o.__finditem__(0); if (min == null) ! throw Py.TypeError("min of empty sequence"); PyObject element; int i=1; --- 544,548 ---- PyObject min = o.__finditem__(0); if (min == null) ! throw Py.ValueError("min of empty sequence"); PyObject element; int i=1; |
From: Finn B. <bc...@us...> - 2001-02-14 22:17:15
|
Update of /cvsroot/jython/jython/org/python/core In directory usw-pr-cvs1:/tmp/cvs-serv11453 Modified Files: MakeProxies.java PyClass.java Log Message: Fix a so far undetected bug where .newInstance() on the proxy class failes to find the python module and python class. The bug was introduced when I renamed the proxyname class name to include the both <module>$<class>. Index: MakeProxies.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/core/MakeProxies.java,v retrieving revision 2.15 retrieving revision 2.16 diff -C2 -r2.15 -r2.16 *** MakeProxies.java 2001/02/02 09:28:36 2.15 --- MakeProxies.java 2001/02/14 22:17:54 2.16 *************** *** 55,59 **** public static synchronized Class makeProxy(Class superclass, Vector vinterfaces, ! String name, PyObject dict) { --- 55,60 ---- public static synchronized Class makeProxy(Class superclass, Vector vinterfaces, ! String className, ! String proxyName, PyObject dict) { *************** *** 63,67 **** interfaces[i] = (Class)vinterfaces.elementAt(i); } ! String proxyName = proxyPrefix + name + "$" + proxyNumber++; String pythonModuleName; PyObject mn=dict.__finditem__("__module__"); --- 64,68 ---- interfaces[i] = (Class)vinterfaces.elementAt(i); } ! String fullProxyName = proxyPrefix + proxyName + "$" + proxyNumber++; String pythonModuleName; PyObject mn=dict.__finditem__("__module__"); *************** *** 70,81 **** else pythonModuleName = (String)mn.__tojava__(String.class); ! ! JavaMaker jm = new JavaMaker(superclass, interfaces, name, ! pythonModuleName, proxyName, dict); try { jm.build(); ByteArrayOutputStream bytes = new ByteArrayOutputStream(); jm.classfile.write(bytes); ! Py.saveClassFile(proxyName, bytes); return makeClass(superclass, vinterfaces, jm.myClass, bytes); --- 71,81 ---- else pythonModuleName = (String)mn.__tojava__(String.class); ! JavaMaker jm = new JavaMaker(superclass, interfaces, className, ! pythonModuleName, fullProxyName, dict); try { jm.build(); ByteArrayOutputStream bytes = new ByteArrayOutputStream(); jm.classfile.write(bytes); ! Py.saveClassFile(fullProxyName, bytes); return makeClass(superclass, vinterfaces, jm.myClass, bytes); Index: PyClass.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/core/PyClass.java,v retrieving revision 2.19 retrieving revision 2.20 diff -C2 -r2.19 -r2.20 *** PyClass.java 2001/02/07 09:23:52 2.19 --- PyClass.java 2001/02/14 22:17:54 2.20 *************** *** 91,95 **** proxyName = module.toString() + "$" + __name__; proxyClass = MakeProxies.makeProxy(baseClass, interfaces, ! proxyName, __dict__); } } --- 91,96 ---- proxyName = module.toString() + "$" + __name__; proxyClass = MakeProxies.makeProxy(baseClass, interfaces, ! __name__, proxyName, ! __dict__); } } |
From: Finn B. <bc...@us...> - 2001-02-14 09:16:44
|
Update of /cvsroot/jython/jython/org/python/util In directory usw-pr-cvs1:/tmp/cvs-serv29529 Modified Files: PyServlet.java Log Message: Search the <context>/WEB-INF/lib & classes for java packages independent of python.home. Index: PyServlet.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/util/PyServlet.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** PyServlet.java 2001/02/13 09:58:03 1.4 --- PyServlet.java 2001/02/14 09:17:21 1.5 *************** *** 79,98 **** "WEB-INF" + File.separator + "lib"); ! props.setProperty("python.packages.directories", ! "java.ext.dirs,pyservlet.lib"); ! props.setProperty("pyservlet.lib", ! rootPath + File.separator + ! "WEB-INF" + File.separator + ! "lib"); ! props.setProperty("python.packages.paths", ! "java.class.path,sun.boot.class.path,"+ ! "pyservlet.classes"); ! props.setProperty("pyservlet.classes", ! rootPath + File.separator + ! "WEB-INF" + File.separator + ! "classes"); ! } PythonInterpreter.initialize(System.getProperties(), props, new String[0]); reset(); --- 79,99 ---- "WEB-INF" + File.separator + "lib"); + } ! props.setProperty("python.packages.directories", ! "java.ext.dirs,pyservlet.lib"); ! props.setProperty("pyservlet.lib", ! rootPath + File.separator + ! "WEB-INF" + File.separator + ! "lib"); ! props.setProperty("python.packages.paths", ! "java.class.path,sun.boot.class.path,"+ ! "pyservlet.classes"); ! props.setProperty("pyservlet.classes", ! rootPath + File.separator + ! "WEB-INF" + File.separator + ! "classes"); ! PythonInterpreter.initialize(System.getProperties(), props, new String[0]); reset(); |
From: Finn B. <bc...@us...> - 2001-02-13 09:57:28
|
Update of /cvsroot/jython/jython/org/python/util In directory usw-pr-cvs1:/tmp/cvs-serv7239 Modified Files: PyServlet.java Log Message: Added search of <context>/WEB-INF/lib and <context>/WEB-INF/classes for java packages. Index: PyServlet.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/util/PyServlet.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** PyServlet.java 2001/02/10 11:12:13 1.3 --- PyServlet.java 2001/02/13 09:58:03 1.4 *************** *** 79,82 **** --- 79,97 ---- "WEB-INF" + File.separator + "lib"); + + props.setProperty("python.packages.directories", + "java.ext.dirs,pyservlet.lib"); + props.setProperty("pyservlet.lib", + rootPath + File.separator + + "WEB-INF" + File.separator + + "lib"); + + props.setProperty("python.packages.paths", + "java.class.path,sun.boot.class.path,"+ + "pyservlet.classes"); + props.setProperty("pyservlet.classes", + rootPath + File.separator + + "WEB-INF" + File.separator + + "classes"); } PythonInterpreter.initialize(System.getProperties(), props, new String[0]); *************** *** 149,157 **** end = path.length(); String name = path.substring(start, end); - - // PyString dir = new PyString(file.getParent()); - // PySystemState sys = Py.getSystemState(); - // if (!sys.path.__contains__(dir)) - // sys.path.append(dir); try { --- 164,167 ---- |
From: Finn B. <bc...@us...> - 2001-02-10 11:11:46
|
Update of /cvsroot/jython/jython/org/python/util In directory usw-pr-cvs1:/tmp/cvs-serv11418 Modified Files: PyServlet.java Log Message: - Added a reset() call. - Added <context>/WEB-INF/jython to sys.path - Added experimental support for the "javax.servlet.include.servlet_path" attribute Index: PyServlet.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/util/PyServlet.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** PyServlet.java 2001/02/07 09:27:43 1.2 --- PyServlet.java 2001/02/10 11:12:13 1.3 *************** *** 61,69 **** public class PyServlet extends HttpServlet { private PythonInterpreter interp; - private Hashtable cache = new Hashtable(); public void init() { ! String rootPath = getServletContext().getRealPath("/"); Properties props = new Properties(); --- 61,70 ---- public class PyServlet extends HttpServlet { private PythonInterpreter interp; private Hashtable cache = new Hashtable(); + private String rootPath; + public void init() { ! rootPath = getServletContext().getRealPath("/"); Properties props = new Properties(); *************** *** 80,84 **** } PythonInterpreter.initialize(System.getProperties(), props, new String[0]); ! interp = new PythonInterpreter(); PySystemState sys = Py.getSystemState(); --- 81,85 ---- } PythonInterpreter.initialize(System.getProperties(), props, new String[0]); ! reset(); PySystemState sys = Py.getSystemState(); *************** *** 87,92 **** sys.add_package("javax.servlet.jsp"); sys.add_package("javax.servlet.jsp.tagext"); - - sys.path.append(new PyString(rootPath)); } --- 88,91 ---- *************** *** 94,98 **** throws ServletException, IOException { ! String spath = ((HttpServletRequest) req).getServletPath(); String rpath = getServletContext().getRealPath(spath); --- 93,101 ---- throws ServletException, IOException { ! req.setAttribute("pyservlet", this); ! ! String spath = (String)req.getAttribute("javax.servlet.include.servlet_path"); ! if (spath == null) ! spath = ((HttpServletRequest) req).getServletPath(); String rpath = getServletContext().getRealPath(spath); *************** *** 105,110 **** throw new ServletException("No python servlet found at:" + spath); } ! private HttpServlet getServlet(String path) throws ServletException, IOException { --- 108,125 ---- throw new ServletException("No python servlet found at:" + spath); } + + public void reset() { + interp = new PythonInterpreter(null, new PySystemState()); + cache.clear(); + PySystemState sys = Py.getSystemState(); + sys.path.append(new PyString(rootPath)); + + String modulesDir = rootPath + File.separator + + "WEB-INF" + File.separator + + "jython"; + sys.path.append(new PyString(modulesDir)); + } ! private synchronized HttpServlet getServlet(String path) throws ServletException, IOException { |
From: Finn B. <bc...@us...> - 2001-02-07 16:52:37
|
Update of /cvsroot/jython/jython/Tools/jythonc In directory usw-pr-cvs1:/tmp/cvs-serv29697 Modified Files: javac.py Log Message: compile(): Put quotes around the classpath value. Help if the classpath contains spaces. Index: javac.py =================================================================== RCS file: /cvsroot/jython/jython/Tools/jythonc/javac.py,v retrieving revision 2.11 retrieving revision 2.12 diff -C2 -r2.11 -r2.12 *** javac.py 2000/11/17 12:44:21 2.11 --- javac.py 2001/02/07 16:52:42 2.12 *************** *** 77,81 **** cpath.append(sourcedir) cpath.extend(sys.path) ! cpath = sep.join(cpath) cmd.extend([cpathopt, cpath]) cmd.extend(files) --- 77,81 ---- cpath.append(sourcedir) cpath.extend(sys.path) ! cpath = '"%s"' % sep.join(cpath) cmd.extend([cpathopt, cpath]) cmd.extend(files) |
From: Finn B. <bc...@us...> - 2001-02-07 09:32:50
|
Update of /cvsroot/jython/jython In directory usw-pr-cvs1:/tmp/cvs-serv22720 Modified Files: NEWS Log Message: More 2.1 news. Index: NEWS =================================================================== RCS file: /cvsroot/jython/jython/NEWS,v retrieving revision 2.27 retrieving revision 2.28 diff -C2 -r2.27 -r2.28 *** NEWS 2001/02/04 15:04:21 2.27 --- NEWS 2001/02/07 09:33:07 2.28 *************** *** 20,23 **** --- 20,26 ---- tables. - Added workaround for a reader bug in MRJ22Jitc.01. + - Fixes #127340 where serializable parameter received a PyObject + instead of the wrapped java object. + - Include a LineNumberTable in the compiled class files. 17-Jan-2001 Jython 2.0 final release |
From: Finn B. <bc...@us...> - 2001-02-07 09:31:54
|
Update of /cvsroot/jython/jython/Doc In directory usw-pr-cvs1:/tmp/cvs-serv22486 Modified Files: compile.ht Log Message: Added more infor about tools and our build process. Index: compile.ht =================================================================== RCS file: /cvsroot/jython/jython/Doc/compile.ht,v retrieving revision 2.1 retrieving revision 2.2 diff -C2 -r2.1 -r2.2 *** compile.ht 2000/11/12 22:22:06 2.1 --- compile.ht 2001/02/07 09:32:11 2.2 *************** *** 12,25 **** mind.</P> ! <P>Some of the sources in the org.python.parser package are generated from python.jtt file by the JavaCC parser generator. If you need to make changes to the grammar file you will need to download this ! <A HREF="http://www.metamata.com/javacc/">JavaCC</A> too. The generated ! files are also in the distribution, so usually this is not necessary. <P>To regenerate the parser from the grammar, run jjtree on python.jjt, and then run javacc on the resulting python.jj. This should produce all of the required source files to build the org.python.parser package. <P>If you have further interest in the Jython source and Jython's continued development, you can read the archives for the --- 12,52 ---- mind.</P> ! <ul> ! <li>The source directories from CVS or the nightly buils contain both ! makefiles and a build.xml file. Only the build.xml is updated at this time. ! We are using ant-1.2 to compile the sources and create the .jar file. ! <p> ! ! <li>Some of the sources in the org.python.parser package are generated from python.jtt file by the JavaCC parser generator. If you need to make changes to the grammar file you will need to download this ! JavaCC. The generated files are also in the distribution, so usually ! this is not necessary. <P>To regenerate the parser from the grammar, run jjtree on python.jjt, and then run javacc on the resulting python.jj. This should produce all of the required source files to build the org.python.parser package. + The build.xml file already contain the needed entries to run the JavaCC + program when the python.jjt is modified. + <p> + + <li>The source directories contain several files that require Java2. These + files are normally easily recoqnizable because they have the number "2" + in their name. + + <P>When compiling jython with Java1 compiler (like the JDK1.1), these + java2 files can be safely ignored. Jython will work even when these classes + files are missing. + The build.xml file have a conditional check and will not try to compile + the Java2 sources when using a Java1 compiler. + <p> + + <li>One of the sources depends on the servlet classes and can only compile + when servlet.jar is included on the classpath. Again, the build.xml have + a conditional check and will not compile the PyServlet class if the + servlet classes isn't available during compilation. + </ul> + <P>If you have further interest in the Jython source and Jython's continued development, you can read the archives for the *************** *** 32,35 **** <hr> ! <sup>1</sup>JavaCC version 2.0 is used to create the generated sources ! included with the distribution. --- 59,68 ---- <hr> ! ! Suggested tools and support software: ! ! <ul> ! <li> <A HREF="http://www.metamata.com/javacc/">JavaCC 2.0</A> ! <li> <A HREF="http://jakarta.apache.org/ant/">Ant 1.2</A> ! <li> <A HREF="http://java.sun.com/products/servlet/index.html">Servlet classes</A> ! </ul> \ No newline at end of file |
From: Finn B. <bc...@us...> - 2001-02-07 09:27:26
|
Update of /cvsroot/jython/jython/org/python/util In directory usw-pr-cvs1:/tmp/cvs-serv21597 Modified Files: PyServlet.java Log Message: - Set a deafult python.home unless specified as properties. - Set a fake __file__ attribute before running any python code. - Add the servlet root path to sys.path. Index: PyServlet.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/util/PyServlet.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** PyServlet.java 2001/02/03 19:31:08 1.1 --- PyServlet.java 2001/02/07 09:27:43 1.2 *************** *** 27,31 **** * e.g. http://localhost:8080/test/hello.py * ! * class test(HttpServlet): * def doGet(self,req, res): * res.setContentType("text/html"); --- 27,31 ---- * e.g. http://localhost:8080/test/hello.py * ! * class hello(HttpServlet): * def doGet(self,req, res): * res.setContentType("text/html"); *************** *** 65,68 **** --- 65,70 ---- public void init() { + String rootPath = getServletContext().getRealPath("/"); + Properties props = new Properties(); Enumeration e = getInitParameterNames(); *************** *** 70,75 **** String name = (String) e.nextElement(); props.setProperty(name, getInitParameter(name)); } - PythonInterpreter.initialize(System.getProperties(), props, new String[0]); interp = new PythonInterpreter(); --- 72,82 ---- String name = (String) e.nextElement(); props.setProperty(name, getInitParameter(name)); + } + if (props.getProperty("python.home") == null && + System.getProperty("python.home") == null) { + props.setProperty("python.home", rootPath + File.separator + + "WEB-INF" + File.separator + + "lib"); } PythonInterpreter.initialize(System.getProperties(), props, new String[0]); interp = new PythonInterpreter(); *************** *** 80,83 **** --- 87,92 ---- sys.add_package("javax.servlet.jsp"); sys.add_package("javax.servlet.jsp.tagext"); + + sys.path.append(new PyString(rootPath)); } *************** *** 87,90 **** --- 96,102 ---- String spath = ((HttpServletRequest) req).getServletPath(); String rpath = getServletContext().getRealPath(spath); + + interp.set("__file__", rpath); + HttpServlet servlet = getServlet(rpath); if (servlet != null) |