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...> - 2000-12-11 18:46:32
|
Update of /cvsroot/jython/jython/org/python/modules In directory slayer.i.sourceforge.net:/tmp/cvs-serv31209 Modified Files: cPickle.java Log Message: Use the __import__ API in __builtin__. Index: cPickle.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/modules/cPickle.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -r1.12 -r1.13 *** cPickle.java 2000/11/29 18:57:09 1.12 --- cPickle.java 2000/12/11 18:46:30 1.13 *************** *** 1991,2017 **** private static PyObject importModule(String name) { - PyFrame frame = Py.getFrame(); - if (frame == null) - return null; - PyObject globals = frame.f_globals; - - PyObject builtins = frame.f_builtins; - if (builtins == null) - builtins = Py.getSystemState().builtins; - PyObject silly_list = new PyTuple(new PyString[] { Py.newString("__doc__"), }); ! ! PyObject __import__ = builtins.__finditem__("__import__"); ! if (__import__ == null) ! return null; ! ! PyObject module = __import__.__call__(new PyObject[] { ! Py.newString(name), ! globals, ! globals, ! silly_list } ); ! return module; } } --- 1991,1998 ---- private static PyObject importModule(String name) { PyObject silly_list = new PyTuple(new PyString[] { Py.newString("__doc__"), }); ! return __builtin__.__import__(name, null, null, silly_list); } } |
From: Finn B. <bc...@us...> - 2000-12-11 18:45:28
|
Update of /cvsroot/jython/jython/org/python/core In directory slayer.i.sourceforge.net:/tmp/cvs-serv31118 Modified Files: codecs.java imp.java Log Message: Use the __import__ API in __builtin__. Index: codecs.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/core/codecs.java,v retrieving revision 2.2 retrieving revision 2.3 diff -C2 -r2.2 -r2.3 *** codecs.java 2000/10/17 19:14:19 2.2 --- codecs.java 2000/12/11 18:45:25 2.3 *************** *** 78,82 **** import_encodings_called = true; try { ! imp.importName("encodings", true); } catch (PyException exc) { if (exc.type != Py.ImportError) --- 78,82 ---- import_encodings_called = true; try { ! __builtin__.__import__("encodings"); } catch (PyException exc) { if (exc.type != Py.ImportError) Index: imp.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/core/imp.java,v retrieving revision 2.31 retrieving revision 2.32 diff -C2 -r2.31 -r2.32 *** imp.java 2000/11/20 21:57:37 2.31 --- imp.java 2000/12/11 18:45:25 2.32 *************** *** 494,505 **** public static void importOne(String mod, PyFrame frame) { //System.out.println("importOne(" + mod + ")"); ! PyObject module = getImportFunc(frame).__call__( ! new PyObject[] { ! Py.newString(mod), ! frame.f_globals, ! frame.f_locals, ! Py.EmptyTuple ! }); ! int dot = mod.indexOf('.'); if (dot != -1) { --- 494,501 ---- public static void importOne(String mod, PyFrame frame) { //System.out.println("importOne(" + mod + ")"); ! PyObject module = __builtin__.__import__(mod, ! frame.f_globals, ! frame.f_locals, ! Py.EmptyTuple); int dot = mod.indexOf('.'); if (dot != -1) { *************** *** 516,527 **** public static void importOneAs(String mod, String asname, PyFrame frame) { //System.out.println("importOne(" + mod + ")"); ! PyObject module = getImportFunc(frame).__call__( ! new PyObject[] { ! Py.newString(mod), ! frame.f_globals, ! frame.f_locals, ! getStarArg() ! }); ! frame.setlocal(asname, module); } --- 512,519 ---- public static void importOneAs(String mod, String asname, PyFrame frame) { //System.out.println("importOne(" + mod + ")"); ! PyObject module = __builtin__.__import__(mod, ! frame.f_globals, ! frame.f_locals, ! getStarArg()); frame.setlocal(asname, module); } *************** *** 550,560 **** pynames[i] = Py.newString(names[i]); ! PyObject module = getImportFunc(frame).__call__( ! new PyObject[] { ! Py.newString(mod), ! frame.f_globals, ! frame.f_locals, ! new PyTuple(pynames) ! }); for (int i=0; i<names.length; i++) { PyObject submod = module.__findattr__(names[i]); --- 542,549 ---- pynames[i] = Py.newString(names[i]); ! PyObject module = __builtin__.__import__(mod, ! frame.f_globals, ! frame.f_locals, ! new PyTuple(pynames)); for (int i=0; i<names.length; i++) { PyObject submod = module.__findattr__(names[i]); *************** *** 579,587 **** public static void importAll(String mod, PyFrame frame) { //System.out.println("importAll(" + mod + ")"); ! PyObject module = getImportFunc(frame).__call__(new PyObject[] { ! Py.newString(mod), ! frame.f_globals, ! frame.f_locals, ! getStarArg() } ); PyObject names; if (module instanceof PyJavaPackage) names = ((PyJavaPackage)module).fillDir(); --- 568,575 ---- public static void importAll(String mod, PyFrame frame) { //System.out.println("importAll(" + mod + ")"); ! PyObject module = __builtin__.__import__(mod, ! frame.f_globals, ! frame.f_locals, ! getStarArg()); PyObject names; if (module instanceof PyJavaPackage) names = ((PyJavaPackage)module).fillDir(); *************** *** 591,595 **** } ! // if __all__ is present, things work properly under the assumption that names is sorted (__*__ names come first) private static void loadNames(PyObject names, PyObject module, PyObject locals) --- 579,584 ---- } ! // if __all__ is present, things work properly under the assumption ! // that names is sorted (__*__ names come first) private static void loadNames(PyObject names, PyObject module, PyObject locals) *************** *** 651,666 **** modules.__setitem__(modName, ret); return ret; - } - - private static PyObject __import__ = null; - - private static PyObject getImportFunc(PyFrame frame) { - if (__import__ == null) - __import__ = Py.newString("__import__"); - // Set up f_builtins if not already set - PyObject builtins = frame.f_builtins; - if (builtins == null) - builtins = Py.getSystemState().builtins; - return builtins.__getitem__(__import__); } } --- 640,643 ---- |
From: Finn B. <bc...@us...> - 2000-12-11 18:43:18
|
Update of /cvsroot/jython/jython/org/python/core In directory slayer.i.sourceforge.net:/tmp/cvs-serv30862 Modified Files: __builtin__.java Log Message: __import__(): Added 4 argument __import__ API. Calling these methods will call the __import__ hook function. Index: __builtin__.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/core/__builtin__.java,v retrieving revision 2.21 retrieving revision 2.22 diff -C2 -r2.21 -r2.22 *** __builtin__.java 2000/10/09 14:45:14 2.21 --- __builtin__.java 2000/12/11 18:43:15 2.22 *************** *** 886,893 **** } ! public static synchronized PyObject __import__(PyString name) { ! return imp.importName(name.internedString(), true); } private static PyObject[] make_array(PyObject o) { if (o instanceof PyTuple) --- 886,925 ---- } ! public static PyObject __import__(String name) { ! return __import__(name, null, null, null); } + public static PyObject __import__(String name, PyObject globals) { + return __import__(name, globals, null, null); + } + + public static PyObject __import__(String name, PyObject globals, + PyObject locals) { + return __import__(name, globals, locals, null); + } + + public static PyObject __import__(String name, PyObject globals, + PyObject locals,PyObject fromlist) + { + PyFrame frame = Py.getFrame(); + if (frame == null) + return null; + + PyObject builtins = frame.f_builtins; + if (builtins == null) + builtins = Py.getSystemState().builtins; + + PyObject __import__ = builtins.__finditem__("__import__"); + if (__import__ == null) + return null; + + PyObject module = __import__.__call__(new PyObject[] { + Py.newString(name), + globals, + locals, + fromlist } ); + return module; + } + private static PyObject[] make_array(PyObject o) { if (o instanceof PyTuple) *************** *** 920,924 **** ? args[2] : __builtin__.locals(); PyObject fromlist = (argc > 3 && args[3] != null) ! ? args[3] : new PyList(); return load(module, globals, locals, fromlist); --- 952,956 ---- ? args[2] : __builtin__.locals(); PyObject fromlist = (argc > 3 && args[3] != null) ! ? args[3] : Py.EmptyTuple; return load(module, globals, locals, fromlist); |
From: Finn B. <bc...@us...> - 2000-12-11 18:39:48
|
Update of /cvsroot/jython/jython/org/python/core In directory slayer.i.sourceforge.net:/tmp/cvs-serv30534 Modified Files: PyFloat.java PyInteger.java PyLong.java Log Message: __pow__(): Fixed differences with CPython. Allow the test_pow test suite to run with jython. Index: PyFloat.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/core/PyFloat.java,v retrieving revision 2.2 retrieving revision 2.3 diff -C2 -r2.2 -r2.3 *** PyFloat.java 1999/10/04 22:21:46 2.2 --- PyFloat.java 2000/12/11 18:39:45 2.3 *************** *** 135,139 **** public PyObject __pow__(PyObject right, PyObject modulo) { // Rely completely on Java's pow function ! double ret = Math.pow(value, ((PyFloat)right).value); if (modulo == null) { return new PyFloat(ret); --- 135,152 ---- public PyObject __pow__(PyObject right, PyObject modulo) { // Rely completely on Java's pow function ! ! double iw = ((PyFloat)right).value; ! if (iw == 0) { ! if (modulo != null) ! return new PyFloat(modulo(1.0, ((PyFloat)modulo).value)); ! return new PyFloat(1.0); ! } ! if (value == 0.0) { ! if (iw < 0.0) ! throw Py.ZeroDivisionError("0.0 cannot be raised to a negative power"); ! return new PyFloat(0); ! } ! ! double ret = Math.pow(value, iw); if (modulo == null) { return new PyFloat(ret); Index: PyInteger.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/core/PyInteger.java,v retrieving revision 2.4 retrieving revision 2.5 diff -C2 -r2.4 -r2.5 *** PyInteger.java 2000/11/30 09:01:43 2.4 --- PyInteger.java 2000/12/11 18:39:45 2.5 *************** *** 145,149 **** if (pow < 0) { ! throw Py.ValueError("integer to the negative power"); } --- 145,152 ---- if (pow < 0) { ! if (value != 0) ! throw Py.ValueError("cannot raise integer to a negative power"); ! else ! throw Py.ZeroDivisionError("cannot raise 0 to a negative power"); } Index: PyLong.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/core/PyLong.java,v retrieving revision 2.4 retrieving revision 2.5 diff -C2 -r2.4 -r2.5 *** PyLong.java 2000/09/30 13:32:02 2.4 --- PyLong.java 2000/12/11 18:39:45 2.5 *************** *** 163,167 **** BigInteger y = ((PyLong)right).value; if (y.compareTo(BigInteger.valueOf(0)) < 0) { ! throw Py.ValueError("long to negative power"); } if (modulo == null) --- 163,170 ---- BigInteger y = ((PyLong)right).value; if (y.compareTo(BigInteger.valueOf(0)) < 0) { ! if (value.compareTo(BigInteger.valueOf(0)) != 0) ! throw Py.ValueError("long integer to a negative power"); ! else ! throw Py.ZeroDivisionError("zero to a negative power"); } if (modulo == null) |
From: Finn B. <bc...@us...> - 2000-12-10 19:05:35
|
Update of /cvsroot/jython/htdocs In directory slayer.i.sourceforge.net:/tmp/cvs-serv10887 Modified Files: index.ht Log Message: Improved the grammar. Index: index.ht =================================================================== RCS file: /cvsroot/jython/htdocs/index.ht,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** index.ht 2000/12/08 22:22:28 1.6 --- index.ht 2000/12/10 19:05:31 1.7 *************** *** 37,47 **** <dl> <dt><b>8-dec-2000</b> ! <dd>Bruce Eckel have release a new revision of his <a href="http://www.mindview.net/TIPatterns/index.html"> ! Thinking in Patterns with Java</a> book and chapter 9 have been updated to cover Jython. <p><dt><b>5-dec-2000</b> ! <dd>David Mertz have done an <a href="http://gnosis.cx/publish/programming/charming_python_10.txt">interview</a> with some of the jython developers --- 37,47 ---- <dl> <dt><b>8-dec-2000</b> ! <dd>Bruce Eckel has release a new revision of his <a href="http://www.mindview.net/TIPatterns/index.html"> ! Thinking in Patterns with Java</a> book and chapter 9 has been updated to cover Jython. <p><dt><b>5-dec-2000</b> ! <dd>David Mertz has written an <a href="http://gnosis.cx/publish/programming/charming_python_10.txt">interview</a> with some of the jython developers |
From: Finn B. <bc...@us...> - 2000-12-08 22:22:32
|
Update of /cvsroot/jython/htdocs In directory slayer.i.sourceforge.net:/tmp/cvs-serv30906 Modified Files: index.ht Log Message: Added Bruce Eckel's Thinking in Patterns with Java. Index: index.ht =================================================================== RCS file: /cvsroot/jython/htdocs/index.ht,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** index.ht 2000/12/05 18:50:09 1.5 --- index.ht 2000/12/08 22:22:28 1.6 *************** *** 36,40 **** <dl> ! <dt><b>5-dec-2000</b> <dd>David Mertz have done an <a href="http://gnosis.cx/publish/programming/charming_python_10.txt">interview</a> --- 36,46 ---- <dl> ! <dt><b>8-dec-2000</b> ! <dd>Bruce Eckel have release a new revision of his ! <a href="http://www.mindview.net/TIPatterns/index.html"> ! Thinking in Patterns with Java</a> book and chapter 9 have been updated to ! cover Jython. ! ! <p><dt><b>5-dec-2000</b> <dd>David Mertz have done an <a href="http://gnosis.cx/publish/programming/charming_python_10.txt">interview</a> *************** *** 45,51 **** <a href="http://www.javasoft.com/features/2000/11/dotnetvsms.html?frontpage-banner"> article</a> that compares the Java platform with MicroSoft's .NET </dl> ! <font size=-1> last updated 5-dec-2000 </font> --- 51,59 ---- <a href="http://www.javasoft.com/features/2000/11/dotnetvsms.html?frontpage-banner"> article</a> that compares the Java platform with MicroSoft's .NET + + </dl> ! <font size=-1> last updated 8-dec-2000 </font> |
From: Finn B. <bc...@us...> - 2000-12-06 21:27:52
|
Update of /cvsroot/jython/jython/installer In directory slayer.i.sourceforge.net:/tmp/cvs-serv5446 Modified Files: mklist.py Log Message: Special handling of site.py. It is taken from Lib, but is not installed in the core package but in the Library package. Index: mklist.py =================================================================== RCS file: /cvsroot/jython/jython/installer/mklist.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** mklist.py 2000/11/27 21:39:22 1.4 --- mklist.py 2000/12/06 21:27:49 1.5 *************** *** 162,166 **** comment("special library modules") ! listfiles(None, "Lib", '*.py', 'pawt/*.py') comment("Docs") --- 162,166 ---- comment("special library modules") ! listfiles(None, "Lib", '*.py', 'pawt/*.py', exclude=["site.py"]) comment("Docs") *************** *** 196,199 **** --- 196,200 ---- comment("Library modules from CPython2.0") print "t Lib/LICENSE %s\LICENSE.txt" % PYTHONDIR + listfiles(None, "Lib", 'site.py') listfiles(PYTHONDIR, "Lib", "pstats.py", "code.py", "codecs.py") listfiles(PYTHONDIR, "Lib", "sre*.py") |
From: Finn B. <bc...@us...> - 2000-12-06 21:26:32
|
Update of /cvsroot/jython/jython/installer In directory slayer.i.sourceforge.net:/tmp/cvs-serv5319 Modified Files: liftoff.filelist Log Message: Added new ucnhash file. Include site.py from Lib when installing the standard python modules. Index: liftoff.filelist =================================================================== RCS file: /cvsroot/jython/jython/installer/liftoff.filelist,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** liftoff.filelist 2000/11/27 21:39:22 1.4 --- liftoff.filelist 2000/12/06 21:26:27 1.5 *************** *** 238,241 **** --- 238,242 ---- t org/python/core/ThreadState.java ..\org\python\core\ThreadState.java t org/python/core/TraceFunction.java ..\org\python\core\TraceFunction.java + t org/python/core/ucnhashAPI.java ..\org\python\core\ucnhashAPI.java t org/python/core/__builtin__.java ..\org\python\core\__builtin__.java t org/python/core/Makefile ..\org\python\core\Makefile *************** *** 267,271 **** t org/python/modules/time.java ..\org\python\modules\time.java t org/python/modules/types.java ..\org\python\modules\types.java ! t org/python/modules/ucnhashAPI.java ..\org\python\modules\ucnhashAPI.java t org/python/modules/_codecs.java ..\org\python\modules\_codecs.java t org/python/modules/_sre.java ..\org\python\modules\_sre.java --- 268,272 ---- t org/python/modules/time.java ..\org\python\modules\time.java t org/python/modules/types.java ..\org\python\modules\types.java ! t org/python/modules/ucnhash.java ..\org\python\modules\ucnhash.java t org/python/modules/_codecs.java ..\org\python\modules\_codecs.java t org/python/modules/_sre.java ..\org\python\modules\_sre.java *************** *** 389,392 **** --- 390,394 ---- # t Lib/LICENSE d:/Python20\LICENSE.txt + t Lib/site.py ..\Lib\site.py t Lib/pstats.py d:\Python20\Lib\pstats.py t Lib/code.py d:\Python20\Lib\code.py |
From: Finn B. <bc...@us...> - 2000-12-06 21:21:06
|
Update of /cvsroot/jython/jython/Lib In directory slayer.i.sourceforge.net:/tmp/cvs-serv4643 Added Files: site.py Log Message: A copy of site.py from CPython 2.0. Modified to print a different credit text. --- NEW FILE --- """Append module search paths for third-party packages to sys.path. **************************************************************** * This module is automatically imported during initialization. * **************************************************************** In earlier versions of Python (up to 1.5a3), scripts or modules that needed to use site-specific modules would place ``import site'' somewhere near the top of their code. Because of the automatic import, this is no longer necessary (but code that does it still works). This will append site-specific paths to to the module search path. On Unix, it starts with sys.prefix and sys.exec_prefix (if different) and appends lib/python<version>/site-packages as well as lib/site-python. On other platforms (mainly Mac and Windows), it uses just sys.prefix (and sys.exec_prefix, if different, but this is unlikely). The resulting directories, if they exist, are appended to sys.path, and also inspected for path configuration files. A path configuration file is a file whose name has the form <package>.pth; its contents are additional directories (one per line) to be added to sys.path. Non-existing directories (or non-directories) are never added to sys.path; no directory is added to sys.path more than once. Blank lines and lines beginning with \code{#} are skipped. For example, suppose sys.prefix and sys.exec_prefix are set to /usr/local and there is a directory /usr/local/lib/python1.5/site-packages with three subdirectories, foo, bar and spam, and two path configuration files, foo.pth and bar.pth. Assume foo.pth contains the following: # foo package configuration foo bar bletch and bar.pth contains: # bar package configuration bar Then the following directories are added to sys.path, in this order: /usr/local/lib/python1.5/site-packages/bar /usr/local/lib/python1.5/site-packages/foo Note that bletch is omitted because it doesn't exist; bar precedes foo because bar.pth comes alphabetically before foo.pth; and spam is omitted because it is not mentioned in either path configuration file. After these path manipulations, an attempt is made to import a module named sitecustomize, which can perform arbitrary additional site-specific customizations. If this import fails with an ImportError exception, it is silently ignored. """ import sys, os def makepath(*paths): dir = os.path.join(*paths) return os.path.normcase(os.path.abspath(dir)) L = sys.modules.values() for m in L: if hasattr(m, "__file__"): m.__file__ = makepath(m.__file__) del m, L # This ensures that the initial path provided by the interpreter contains # only absolute pathnames, even if we're running from the build directory. L = [] for dir in sys.path: dir = makepath(dir) if dir not in L: L.append(dir) sys.path[:] = L del dir, L def addsitedir(sitedir): sitedir = makepath(sitedir) if sitedir not in sys.path: sys.path.append(sitedir) # Add path component try: names = os.listdir(sitedir) except os.error: return names = map(os.path.normcase, names) names.sort() for name in names: if name[-4:] == ".pth": addpackage(sitedir, name) def addpackage(sitedir, name): fullname = os.path.join(sitedir, name) try: f = open(fullname) except IOError: return while 1: dir = f.readline() if not dir: break if dir[0] == '#': continue if dir[-1] == '\n': dir = dir[:-1] dir = makepath(sitedir, dir) if dir not in sys.path and os.path.exists(dir): sys.path.append(dir) prefixes = [sys.prefix] if sys.exec_prefix != sys.prefix: prefixes.append(sys.exec_prefix) for prefix in prefixes: if prefix: if os.sep == '/': sitedirs = [makepath(prefix, "lib", "python" + sys.version[:3], "site-packages"), makepath(prefix, "lib", "site-python")] else: sitedirs = [prefix] for sitedir in sitedirs: if os.path.isdir(sitedir): addsitedir(sitedir) # Define new built-ins 'quit' and 'exit'. # These are simply strings that display a hint on how to exit. if os.sep == ':': exit = 'Use Cmd-Q to quit.' elif os.sep == '\\': exit = 'Use Ctrl-Z plus Return to exit.' else: exit = 'Use Ctrl-D (i.e. EOF) to exit.' import __builtin__ __builtin__.quit = __builtin__.exit = exit del exit # interactive prompt objects for printing the license text, a list of # contributors and the copyright notice. class _Printer: MAXLINES = 23 def __init__(self, name, data, files=(), dirs=()): self.__name = name self.__data = data self.__files = files self.__dirs = dirs self.__lines = None def __setup(self): if self.__lines: return data = None for dir in self.__dirs: for file in self.__files: file = os.path.join(dir, file) try: fp = open(file) data = fp.read() fp.close() break except IOError: pass if data: break if not data: data = self.__data self.__lines = data.split('\n') self.__linecnt = len(self.__lines) def __repr__(self): self.__setup() if len(self.__lines) <= self.MAXLINES: return "\n".join(self.__lines) else: return "Type %s() to see the full %s text" % ((self.__name,)*2) def __call__(self): self.__setup() prompt = 'Hit Return for more, or q (and Return) to quit: ' lineno = 0 while 1: try: for i in range(lineno, lineno + self.MAXLINES): print self.__lines[i] except IndexError: break else: lineno += self.MAXLINES key = None while key is None: key = raw_input(prompt) if key not in ('', 'q'): key = None if key == 'q': break __builtin__.copyright = _Printer("copyright", sys.copyright) if sys.platform[:4] == 'java': __builtin__.credits = _Printer("credits", "Jython is maintained by the Jython developers (www.jython.org).") else: __builtin__.credits = _Printer("credits", "Python development is led by BeOpen PythonLabs (www.pythonlabs.com).") here = sys.prefix + "/Lib" # os.path.dirname(os.__file__) __builtin__.license = _Printer( "license", "See http://www.pythonlabs.com/products/python2.0/license.html", ["LICENSE.txt", "LICENSE"], [here, os.path.join(here, os.pardir), os.curdir]) # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() if 0: # Enable to support locale aware default string encodings. import locale loc = locale.getdefaultlocale() if loc[1]: encoding = loc[1] if 0: # Enable to switch off string to Unicode coercion and implicit # Unicode to string conversion. encoding = "undefined" if encoding != "ascii": sys.setdefaultencoding(encoding) # # Run custom site specific code, if available. # try: import sitecustomize except ImportError: pass # # Remove sys.setdefaultencoding() so that users cannot change the # encoding after initialization. The test for presence is needed when # this module is run as a script, becuase this code is executed twice. # if hasattr(sys, "setdefaultencoding"): del sys.setdefaultencoding def _test(): print "sys.path = [" for dir in sys.path: print " %s," % `dir` print "]" if __name__ == '__main__': _test() |
From: Finn B. <bc...@us...> - 2000-12-06 21:09:25
|
Update of /cvsroot/jython/jython In directory slayer.i.sourceforge.net:/tmp/cvs-serv2874 Modified Files: registry Log Message: Renamed jpython -> jython. Index: registry =================================================================== RCS file: /cvsroot/jython/jython/registry,v retrieving revision 2.7 retrieving revision 2.8 diff -C2 -r2.7 -r2.8 *** registry 2000/11/10 15:12:51 2.7 --- registry 2000/12/06 21:09:23 2.8 *************** *** 4,8 **** # This is how Jim sets his path on his Windows development machine ! #python.path=.;c:\\jpython\\Lib;d:\\Python-1.5.2\\Lib # This is how Barry sets his path on his Unix development machine #python.path = /home/bwarsaw/projects/python/Lib --- 4,8 ---- # This is how Jim sets his path on his Windows development machine ! #python.path=.;c:\\Jython\\Lib;d:\\Python-1.5.2\\Lib # This is how Barry sets his path on his Unix development machine #python.path = /home/bwarsaw/projects/python/Lib *************** *** 21,29 **** python.packages.directories = java.ext.dirs ! # To force JIT compilation of JPython code -- should be unnecessary # Setting this to true will cause jdk1.2rc1 to core dump on Windows python.options.compileClass = false ! # Allow JPython's classloader to find and load .class files on # sys.path. This only happens for anonymous inner classes, but may # have unintended side-effects. This option is temporary. --- 21,29 ---- python.packages.directories = java.ext.dirs ! # To force JIT compilation of Jython code -- should be unnecessary # Setting this to true will cause jdk1.2rc1 to core dump on Windows python.options.compileClass = false ! # Allow Jython's classloader to find and load .class files on # sys.path. This only happens for anonymous inner classes, but may # have unintended side-effects. This option is temporary. *************** *** 31,35 **** # Set verbosity to error, warning, message, comment, or debug ! # for varying levels of informative messages from JPython python.verbose = message --- 31,35 ---- # Set verbosity to error, warning, message, comment, or debug ! # for varying levels of informative messages from Jython python.verbose = message *************** *** 42,46 **** python.console.poll = false ! # Setting this to false will allow JPython to provide access to # non-public fields, methods, and constructors of Java objects. python.security.respectJavaAccessibility = true --- 42,46 ---- python.console.poll = false ! # Setting this to false will allow Jython to provide access to # non-public fields, methods, and constructors of Java objects. python.security.respectJavaAccessibility = true *************** *** 69,72 **** # code, along with the complete classpath to use. # python.jythonc.compiler = /depot/java/plat/bin/jikes ! # python.jythonc.classpath = /usr/java1.2/jre/lib/rt.jar:/jpython/dist:. # python.jythonc.compileropts = +E +D -g --- 69,72 ---- # code, along with the complete classpath to use. # python.jythonc.compiler = /depot/java/plat/bin/jikes ! # python.jythonc.classpath = /usr/java1.2/jre/lib/rt.jar:/Jython/dist:. # python.jythonc.compileropts = +E +D -g |
From: Finn B. <bc...@us...> - 2000-12-06 21:06:56
|
Update of /cvsroot/jython/jython/Doc In directory slayer.i.sourceforge.net:/tmp/cvs-serv2489 Removed Files: compile.html differences.html embedding.html faq.html index.html interpreter.html jarray.html jythonc.html properties.html registry.html subclassing.html usejava.html whatis.html Log Message: The .html files are generated from the .ht file and should not be in CVS. --- compile.html DELETED --- --- differences.html DELETED --- --- embedding.html DELETED --- --- faq.html DELETED --- --- index.html DELETED --- --- interpreter.html DELETED --- --- jarray.html DELETED --- --- jythonc.html DELETED --- --- properties.html DELETED --- --- registry.html DELETED --- --- subclassing.html DELETED --- --- usejava.html DELETED --- --- whatis.html DELETED --- |
From: Finn B. <bc...@us...> - 2000-12-06 21:04:34
|
Update of /cvsroot/jython/jython/org/python/util In directory slayer.i.sourceforge.net:/tmp/cvs-serv2046 Modified Files: jython.java Log Message: main(): Only print the 'Type "copyright", ...' line when importing site and the "copyright", "credits" or "license" strings actually exists in the builtins. This also works when using -S or using a site.py from CPython 1.5.2 Index: jython.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/util/jython.java,v retrieving revision 2.14 retrieving revision 2.15 diff -C2 -r2.14 -r2.15 *** jython.java 2000/10/16 18:34:09 2.14 --- jython.java 2000/12/06 21:04:30 2.15 *************** *** 96,102 **** --- 96,126 ---- //System.err.println("imp"); + String msg = ""; if (Options.importSite) { try { imp.load("site"); + + if (opts.notice) { + PyObject builtins = Py.getSystemState().builtins; + boolean copyright = builtins.__finditem__("copyright") != null; + boolean credits = builtins.__finditem__("credits") != null; + boolean license = builtins.__finditem__("license") != null; + if (copyright) { + msg += "\"copyright\""; + if (credits && license) + msg += ", "; + else if (credits || license) + msg += " or "; + } + if (credits) { + msg += "\"credits\""; + if (license) + msg += " or "; + } + if (license) + msg += "\"license\""; + if (msg.length() > 0) + System.err.println("Type " + msg + " for more information."); + } } catch (PyException pye) { if (!Py.matchException(pye, Py.ImportError)) { |
From: Finn B. <bc...@us...> - 2000-12-06 21:01:02
|
Update of /cvsroot/jython/jython/org/python/util In directory slayer.i.sourceforge.net:/tmp/cvs-serv1709 Modified Files: InteractiveConsole.java Log Message: getDefaultBanner(): Removed copyright message from default banner. The copyright message is instead written by org.python.util.jython. Index: InteractiveConsole.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/util/InteractiveConsole.java,v retrieving revision 2.6 retrieving revision 2.7 diff -C2 -r2.6 -r2.7 *** InteractiveConsole.java 2000/09/29 17:31:46 2.6 --- InteractiveConsole.java 2000/12/06 21:00:51 2.7 *************** *** 37,42 **** return "Jython " + PySystemState.version + " on " + PySystemState.platform + " (JIT: " + ! ((compiler == null) ? "null" : compiler) + ")" + ! "\n" + PySystemState.copyright; } --- 37,41 ---- return "Jython " + PySystemState.version + " on " + PySystemState.platform + " (JIT: " + ! ((compiler == null) ? "null" : compiler) + ")"; } |
From: Finn B. <bc...@us...> - 2000-12-06 20:58:58
|
Update of /cvsroot/jython/jython/org/python/core In directory slayer.i.sourceforge.net:/tmp/cvs-serv1543 Modified Files: PySystemState.java Log Message: copyright: Added the list of real copyright holders instead of the message 'Type "copyright" ...' Index: PySystemState.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/core/PySystemState.java,v retrieving revision 2.34 retrieving revision 2.35 diff -C2 -r2.34 -r2.35 *** PySystemState.java 2000/11/29 19:04:24 2.34 --- PySystemState.java 2000/12/06 20:58:56 2.35 *************** *** 21,25 **** // TBD: should we use \u00a9 Unicode c-inside-circle? public static String copyright = ! "Type \"copyright\", \"credits\" or \"license\" for more information."; /** --- 21,38 ---- // TBD: should we use \u00a9 Unicode c-inside-circle? public static String copyright = ! "Copyright (c) 2000, Jython Developers\n" + ! "All rights reserved.\n\n" + ! ! "Copyright (c) 2000 BeOpen.com.\n" + ! "All Rights Reserved.\n\n"+ ! ! "Copyright (c) 2000 The Apache Software Foundation. All rights\n" + ! "reserved.\n\n" + ! ! "Copyright (c) 1995-2000 Corporation for National Research Initiatives.\n" + ! "All Rights Reserved.\n\n" + ! ! "Copyright (c) 1991-1995 Stichting Mathematisch Centrum, Amsterdam.\n" + ! "All Rights Reserved.\n\n"; /** |
From: Finn B. <bc...@us...> - 2000-12-06 20:55:34
|
Update of /cvsroot/jython/jython/org/python/compiler In directory slayer.i.sourceforge.net:/tmp/cvs-serv1023 Modified Files: LocalsCompiler.java CodeCompiler.java Log Message: Fixed bug 122834 by detecting when ImportAll or ExecStmt are used in a function. Such use will disable the fast getglobal() call and use the slower getname() instead. Index: LocalsCompiler.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/compiler/LocalsCompiler.java,v retrieving revision 2.4 retrieving revision 2.5 diff -C2 -r2.4 -r2.5 *** LocalsCompiler.java 2000/10/13 20:00:25 2.4 --- LocalsCompiler.java 2000/12/06 20:55:30 2.5 *************** *** 14,17 **** --- 14,18 ---- static final int SET = 1; static final int DEL = 2; + boolean optimizeGlobals = true; public LocalsCompiler() { *************** *** 128,131 **** --- 129,138 ---- public Object ImportFrom(SimpleNode node) throws Exception { int n = node.getNumChildren(); + if (n == 1) { + // ImportAll + optimizeGlobals = false; + return null; + } + for (int i=1; i<n; i++) { SimpleNode cnode = node.getChild(i); *************** *** 151,154 **** --- 158,162 ---- public Object exec_stmt(SimpleNode node) throws Exception { //Disable locals somehow here? + optimizeGlobals = false; return null; } Index: CodeCompiler.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/compiler/CodeCompiler.java,v retrieving revision 2.7 retrieving revision 2.8 diff -C2 -r2.7 -r2.8 *** CodeCompiler.java 2000/10/18 13:01:11 2.7 --- CodeCompiler.java 2000/12/06 20:55:30 2.8 *************** *** 33,36 **** --- 33,37 ---- public Hashtable locals; public Hashtable globals; + boolean optimizeGlobals = true; public Vector names; public String className; *************** *** 179,182 **** --- 180,184 ---- locals = lc.locals; globals = lc.globals; + optimizeGlobals = lc.optimizeGlobals; mode = GET; *************** *** 2163,2180 **** case GET: loadFrame(); ! Integer i=null; ! if (fast_locals) ! i = (Integer)locals.get(name); ! ! if (!fast_locals || i != null) { ! if (i == null) { code.ldc(name); ! if (mrefs.getlocal1 == 0) { ! mrefs.getlocal1 = code.pool.Methodref( ! "org/python/core/PyFrame", "getname", "(Ljava/lang/String;)Lorg/python/core/PyObject;"); } ! code.invokevirtual(mrefs.getlocal1); ! } else { code.iconst(i.intValue()); if (mrefs.getlocal2 == 0) { --- 2165,2181 ---- case GET: loadFrame(); ! if (fast_locals) { ! Integer i = (Integer)locals.get(name); ! if (i == null && optimizeGlobals) { code.ldc(name); ! if (mrefs.getglobal == 0) { ! mrefs.getglobal = code.pool.Methodref( ! "org/python/core/PyFrame", "getglobal", "(Ljava/lang/String;)Lorg/python/core/PyObject;"); } ! code.invokevirtual(mrefs.getglobal); ! return null; ! } ! if (i != null) { code.iconst(i.intValue()); if (mrefs.getlocal2 == 0) { *************** *** 2184,2198 **** } code.invokevirtual(mrefs.getlocal2); } - } else { - code.ldc(name); - if (mrefs.getglobal == 0) { - mrefs.getglobal = code.pool.Methodref( - "org/python/core/PyFrame", "getglobal", - "(Ljava/lang/String;)Lorg/python/core/PyObject;"); - } - code.invokevirtual(mrefs.getglobal); } return null; case SET: loadFrame(); --- 2185,2200 ---- } code.invokevirtual(mrefs.getlocal2); + return null; } } + code.ldc(name); + if (mrefs.getlocal1 == 0) { + mrefs.getlocal1 = code.pool.Methodref( + "org/python/core/PyFrame", "getname", + "(Ljava/lang/String;)Lorg/python/core/PyObject;"); + } + code.invokevirtual(mrefs.getlocal1); return null; + case SET: loadFrame(); *************** *** 2217,2221 **** code.invokevirtual(mrefs.setlocal1); } else { ! i = (Integer)locals.get(name); if (i == null) { System.err.println("internal compiler error: "+node); --- 2219,2223 ---- code.invokevirtual(mrefs.setlocal1); } else { ! Integer i = (Integer)locals.get(name); if (i == null) { System.err.println("internal compiler error: "+node); *************** *** 2252,2256 **** code.invokevirtual(mrefs.dellocal1); } else { ! i = (Integer)locals.get(name); code.iconst(i.intValue()); if (mrefs.dellocal2 == 0) { --- 2254,2258 ---- code.invokevirtual(mrefs.dellocal1); } else { ! Integer i = (Integer)locals.get(name); code.iconst(i.intValue()); if (mrefs.dellocal2 == 0) { |
From: Finn B. <bc...@us...> - 2000-12-06 20:51:14
|
Update of /cvsroot/jython/jython In directory slayer.i.sourceforge.net:/tmp/cvs-serv607 Modified Files: NEWS Log Message: More news. Index: NEWS =================================================================== RCS file: /cvsroot/jython/jython/NEWS,v retrieving revision 2.10 retrieving revision 2.11 diff -C2 -r2.10 -r2.11 *** NEWS 2000/12/05 19:30:45 2.10 --- NEWS 2000/12/06 20:51:11 2.11 *************** *** 21,24 **** --- 21,25 ---- - Avoided a duplicate call to Class.getMethods(). This will improve performance. + - Allow from import * to modify the locals in a function (bug 122834). |
From: Finn B. <bc...@us...> - 2000-12-06 20:49:32
|
Update of /cvsroot/jython/jython/Tools/jythonc In directory slayer.i.sourceforge.net:/tmp/cvs-serv32545 Modified Files: SimpleCompiler.py Log Message: LocalFrame.__init__(): Allow ImportAll and ExecStmt to modify the locals. This is done by letting the global access use the slower getname instead of getglobal. This should in principle only be done when the function contain ImportAll or ExecStmt statements, but right now we always use the slow version. Index: SimpleCompiler.py =================================================================== RCS file: /cvsroot/jython/jython/Tools/jythonc/SimpleCompiler.py,v retrieving revision 2.10 retrieving revision 2.11 diff -C2 -r2.10 -r2.11 *** SimpleCompiler.py 2000/11/30 08:54:55 2.10 --- SimpleCompiler.py 2000/12/06 20:49:28 2.11 *************** *** 75,78 **** --- 75,86 ---- (self.ivalue, value.asAny())) + class DynamicStringReference2(DynamicStringReference): + def setCode(self, value): + return jast.Invoke(self.iframe, "setglobal", + (self.ivalue, value.asAny())) + + def noValue(self): + # Reference to builtin + return self.frame.parent.factory.makePyObject(self.getCode()) *************** *** 100,104 **** def __init__(self, parent, newReference=DynamicIntReference): self.frame = jast.Identifier("frame") ! self.globalNamespace = parent.globalNamespace self.parent = parent self.newReference = newReference --- 108,119 ---- def __init__(self, parent, newReference=DynamicIntReference): self.frame = jast.Identifier("frame") ! ! # This should only use SlowGlobals if the function uses ! # ImportAll or ExecStmt. If not it should use ! # parent.globalNamespace. ! ! self.globalNamespace = SlowGlobals(parent) ! #self.globalNamespace = parent.globalNamespace ! self.parent = parent self.newReference = newReference *************** *** 201,204 **** --- 216,220 ---- def __init__(self, parent): LocalFrame.__init__(self, parent) + self.globalNamespace = parent.globalNamespace def getReference(self, name): *************** *** 231,234 **** --- 247,256 ---- self.names[name] = ret return ret + + class SlowGlobals(BasicGlobals): + def __init__(self, parent, newReference=DynamicStringReference2): + self.names = {} + self.newReference = newReference + self.parent = parent |
From: Finn B. <bc...@us...> - 2000-12-05 20:06:48
|
Update of /cvsroot/jython/jython In directory slayer.i.sourceforge.net:/tmp/cvs-serv23457 Modified Files: README.txt Log Message: Added the \x backward incompatible change. Index: README.txt =================================================================== RCS file: /cvsroot/jython/jython/README.txt,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** README.txt 2000/11/24 17:08:49 1.1 --- README.txt 2000/12/05 20:06:25 1.2 *************** *** 28,29 **** --- 28,32 ---- is searched for python modules before the CLASSPATH and sys.path is searched for java class and java packages. + + - The \x escape have changed, now it will eat two hex characters + but never more. The behaviour matches CPython2.0 |
From: Finn B. <bc...@us...> - 2000-12-05 19:30:54
|
Update of /cvsroot/jython/jython In directory slayer.i.sourceforge.net:/tmp/cvs-serv17001 Modified Files: NEWS Log Message: More news while I still remember it. Index: NEWS =================================================================== RCS file: /cvsroot/jython/jython/NEWS,v retrieving revision 2.9 retrieving revision 2.10 diff -C2 -r2.9 -r2.10 *** NEWS 2000/12/04 21:39:40 2.9 --- NEWS 2000/12/05 19:30:45 2.10 *************** *** 3,7 **** XX-Dec-2000 Jython 2.0 alpha 2 ! CPython2.0 compatibility - Added support for formatting of long values in "%d %x %X %o". The support does not match CPython2.0 exactly, but matches --- 3,7 ---- XX-Dec-2000 Jython 2.0 alpha 2 ! CPython-2.0 compatibility - Added support for formatting of long values in "%d %x %X %o". The support does not match CPython2.0 exactly, but matches *************** *** 16,21 **** match the directory structure. - Fixed oct(0) to return "0" ! - Add a os.__file__ attribute. CPython's site.py expects that. ! 26-Nov-2000 Jython 2.0 alpha 1 --- 16,26 ---- match the directory structure. - Fixed oct(0) to return "0" ! - Added a os.__file__ attribute. CPython's site.py expects that. ! - Fixed a exception when calling int("0", 16) ! - Delay closing a socket until all sock.makefile() files are closed. ! - Avoided a duplicate call to Class.getMethods(). This will improve ! performance. ! ! 26-Nov-2000 Jython 2.0 alpha 1 |
From: Finn B. <bc...@us...> - 2000-12-05 19:29:23
|
Update of /cvsroot/jython/jython/Tools/jythonc In directory slayer.i.sourceforge.net:/tmp/cvs-serv16655 Modified Files: depend.py Log Message: ResourceEntry.getZipName(): Store the resource name without the leading slash. Index: depend.py =================================================================== RCS file: /cvsroot/jython/jython/Tools/jythonc/depend.py,v retrieving revision 2.5 retrieving revision 2.6 diff -C2 -r2.5 -r2.6 *** depend.py 2000/12/04 21:43:18 2.5 --- depend.py 2000/12/05 19:29:20 2.6 *************** *** 149,153 **** def getZipName(self): ! return self.name --- 149,153 ---- def getZipName(self): ! return self.name[1:] |
From: Finn B. <bc...@us...> - 2000-12-05 19:25:51
|
Update of /cvsroot/jython/jython/Lib In directory slayer.i.sourceforge.net:/tmp/cvs-serv16081 Modified Files: socket.py Log Message: Fix bug 122816. A socket now keeps track of the number of makefile() calls and only closes the connection when noth the socket and the last makefile() file is closed. Index: socket.py =================================================================== RCS file: /cvsroot/jython/jython/Lib/socket.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** socket.py 2000/11/26 16:18:40 1.7 --- socket.py 2000/12/05 19:25:48 1.8 *************** *** 57,60 **** --- 57,61 ---- addr = None server = 0 + file_count = 0 def bind(self, addr, port=None): *************** *** 143,157 **** def makefile(self, mode="r", bufsize=-1): if self.istream: if self.ostream: ! return org.python.core.PyFile(self.istream, self.ostream, "<socket>", mode) else: ! return org.python.core.PyFile(self.istream, "<socket>", mode) elif self.ostream: ! return org.python.core.PyFile(self.ostream, "<socket>", mode) else: raise IOError, "both istream and ostream have been shut down" def shutdown(self, how): assert how in (0, 1, 2) --- 144,198 ---- def makefile(self, mode="r", bufsize=-1): + file = None if self.istream: if self.ostream: ! file = org.python.core.PyFile(self.istream, self.ostream, "<socket>", mode) else: ! file = org.python.core.PyFile(self.istream, "<socket>", mode) elif self.ostream: ! file = org.python.core.PyFile(self.ostream, "<socket>", mode) else: raise IOError, "both istream and ostream have been shut down" + if file: + return _tcpsocket.FileWrapper(self, file) + class FileWrapper: + def __init__(self, socket, file): + self.socket = socket + self.sock = socket.sock + self.istream = socket.istream + self.ostream = socket.ostream + + self.file = file + self.read = file.read + self.readline = file.readline + self.readlines = file.readlines + self.write = file.write + self.writelines = file.writelines + self.flush = file.flush + self.seek = file.seek + self.tell = file.tell + + self.socket.file_count += 1 + + def close(self): + if self.file.closed: + # Already closed + return + + self.socket.file_count -= 1 + self.file.close() + + if self.socket.file_count == 0 and self.socket.sock == 0: + # This is the last file Only close the socket and streams + # if there are no outstanding files left. + if self.sock: + self.sock.close() + if self.istream: + self.istream.close() + if self.ostream: + self.ostream.close() + def shutdown(self, how): assert how in (0, 1, 2) *************** *** 169,178 **** self.istream = 0 self.ostream = 0 ! if istream: ! istream.close() ! if ostream: ! ostream.close() ! if sock: ! sock.close() --- 210,222 ---- self.istream = 0 self.ostream = 0 ! # Only close the socket and streams if there are no ! # outstanding files left. ! if self.file_count == 0: ! if istream: ! istream.close() ! if ostream: ! ostream.close() ! if sock: ! sock.close() |
From: Finn B. <bc...@us...> - 2000-12-05 19:01:40
|
Update of /cvsroot/jython/jython/Doc In directory slayer.i.sourceforge.net:/tmp/cvs-serv12828 Modified Files: usejava.ht Log Message: Added string -> char[] convertion. Index: usejava.ht =================================================================== RCS file: /cvsroot/jython/jython/Doc/usejava.ht,v retrieving revision 2.2 retrieving revision 2.3 diff -C2 -r2.2 -r2.3 *** usejava.ht 2000/11/12 22:22:06 2.2 --- usejava.ht 2000/12/05 19:01:37 2.3 *************** *** 99,103 **** </TR> <TR> ! <TD>java.lang.String, byte[]</TD> <TD>String </TD> </TR> --- 99,103 ---- </TR> <TR> ! <TD>java.lang.String,<br>byte[], char[]</TD> <TD>String </TD> </TR> |
From: Finn B. <bc...@us...> - 2000-12-05 18:58:58
|
Update of /cvsroot/jython/jython/org/python/core In directory slayer.i.sourceforge.net:/tmp/cvs-serv11959 Modified Files: PyString.java Log Message: __tojava__(): Allow a string to be coerced to char array. Index: PyString.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/core/PyString.java,v retrieving revision 2.30 retrieving revision 2.31 diff -C2 -r2.30 -r2.31 *** PyString.java 2000/12/04 21:47:21 2.30 --- PyString.java 2000/12/05 18:58:40 2.31 *************** *** 578,583 **** return new Character(string.charAt(0)); ! if (c.isArray() && c.getComponentType() == Byte.TYPE) ! return getBytes(); if (c.isInstance(this)) --- 578,587 ---- return new Character(string.charAt(0)); ! if (c.isArray()) { ! if (c.getComponentType() == Byte.TYPE) ! return getBytes(); ! if (c.getComponentType() == Character.TYPE) ! return string.toCharArray(); ! } if (c.isInstance(this)) |
From: Finn B. <bc...@us...> - 2000-12-05 18:56:04
|
Update of /cvsroot/jython/jython/org/python/core In directory slayer.i.sourceforge.net:/tmp/cvs-serv11427 Modified Files: PyJavaInstance.java Log Message: __init__(): Always check for abstract and interface. This gives a sensible error message when trying to create instances of a class like: public abstract class test265j { public test265j() { } } Index: PyJavaInstance.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/core/PyJavaInstance.java,v retrieving revision 2.1 retrieving revision 2.2 diff -C2 -r2.1 -r2.2 *** PyJavaInstance.java 1999/05/17 19:59:39 2.1 --- PyJavaInstance.java 2000/12/05 18:56:02 2.2 *************** *** 39,57 **** public void __init__(PyObject[] args, String[] keywords) { - PyReflectedConstructor init = ((PyJavaClass)__class__).__init__; //javaProxies = new Object[1]; ! if (init == null) { ! Class pc = __class__.proxyClass; ! if (pc != null) { ! int mods = pc.getModifiers(); ! if (Modifier.isInterface(mods)) { ! throw Py.TypeError("can't instantiate interface ("+ ! __class__.__name__+")"); ! } ! else if (Modifier.isAbstract(mods)) { ! throw Py.TypeError("can't instantiate abstract class ("+ ! __class__.__name__+")"); ! } } throw Py.TypeError("no public constructors for "+ __class__.__name__); --- 39,59 ---- public void __init__(PyObject[] args, String[] keywords) { //javaProxies = new Object[1]; ! ! Class pc = __class__.proxyClass; ! if (pc != null) { ! int mods = pc.getModifiers(); ! if (Modifier.isInterface(mods)) { ! throw Py.TypeError("can't instantiate interface ("+ ! __class__.__name__+")"); } + else if (Modifier.isAbstract(mods)) { + throw Py.TypeError("can't instantiate abstract class ("+ + __class__.__name__+")"); + } + } + + PyReflectedConstructor init = ((PyJavaClass)__class__).__init__; + if (init == null) { throw Py.TypeError("no public constructors for "+ __class__.__name__); |
From: Finn B. <bc...@us...> - 2000-12-05 18:52:53
|
Update of /cvsroot/jython/jython/org/python/core In directory slayer.i.sourceforge.net:/tmp/cvs-serv10973 Modified Files: PyJavaClass.java Log Message: Only call Class.getMethods() once (in this class), and pass the result down into setBeanInfoCustom() and setMethods(). This improves performance. Index: PyJavaClass.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/core/PyJavaClass.java,v retrieving revision 2.25 retrieving revision 2.26 diff -C2 -r2.25 -r2.26 *** PyJavaClass.java 2000/11/17 21:22:15 2.25 --- PyJavaClass.java 2000/12/05 18:52:48 2.26 *************** *** 103,109 **** __dict__ = d; try { ! setBeanInfoCustom(proxyClass); setFields(proxyClass); ! setMethods(proxyClass); } catch (SecurityException se) {} } --- 103,110 ---- __dict__ = d; try { ! Method[] methods = getAccessibleMethods(proxyClass); ! setBeanInfoCustom(proxyClass, methods); setFields(proxyClass); ! setMethods(proxyClass, methods); } catch (SecurityException se) {} } *************** *** 341,372 **** // returns just the public methods return c.getMethods(); ! // from here on out we know we must be using at least Java 1.2. ! // Note that an ArrayList would be better here because we don't ! // need access to be synchronized, but that would prevent this file ! // from being compiled on Java 1.1 (as opposed to being compilable, ! // but not having the feature available). ! java.util.Vector methods = new java.util.Vector(); ! while (c != null) { ! // get all declared methods for this class, mutate their ! // accessibility and pop it into the array for later ! Method[] declared = c.getDeclaredMethods(); ! for (int i=0; i < declared.length; i++) { ! // TBD: this is a permanent change. Should we provide a way to ! // restore the original accessibility flag? ! JavaAccessibility.setAccessible(declared[i], true); ! methods.addElement(declared[i]); ! } ! // walk down superclass chain ! c = c.getSuperclass(); } ! // return (Method[])methods.toArray(new Method[methods.size()]); ! Method[] ret = new Method[methods.size()]; ! methods.copyInto(ret); ! return ret; } /* Add all methods declared by this class */ ! private void setMethods(Class c) { ! Method[] methods = getAccessibleMethods(c); for (int i=0; i<methods.length; i++) { Method method = methods[i]; --- 342,356 ---- // returns just the public methods return c.getMethods(); ! Method[] declared = c.getDeclaredMethods(); ! for (int i=0; i < declared.length; i++) { ! // TBD: this is a permanent change. Should we provide a way to ! // restore the original accessibility flag? ! JavaAccessibility.setAccessible(declared[i], true); } ! return declared; } /* Add all methods declared by this class */ ! private void setMethods(Class c, Method[] methods) { for (int i=0; i<methods.length; i++) { Method method = methods[i]; *************** *** 475,482 **** // This method is a workaround for Netscape's stupid security bug! ! private void setBeanInfoCustom(Class c) { //try { - Method[] meths = c.getMethods(); - int i; int n = meths.length; --- 459,464 ---- // This method is a workaround for Netscape's stupid security bug! ! private void setBeanInfoCustom(Class c, Method[] meths) { //try { int i; int n = meths.length; *************** *** 598,602 **** return c.getConstructors(); // return all constructors ! return c.getDeclaredConstructors(); } --- 580,592 ---- return c.getConstructors(); // return all constructors ! ! ! Constructor[] declared = c.getDeclaredConstructors(); ! for (int i=0; i < declared.length; i++) { ! // TBD: this is a permanent change. Should we provide a way to ! // restore the original accessibility flag? ! JavaAccessibility.setAccessible(declared[i], true); ! } ! return declared; } |