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: Kevin J. B. <kev...@us...> - 2001-11-28 17:40:56
|
Update of /cvsroot/jython/jython In directory usw-pr-cvs1:/tmp/cvs-serv14456 Modified Files: registry Log Message: clarify comments about os and environment Index: registry =================================================================== RCS file: /cvsroot/jython/jython/registry,v retrieving revision 2.16 retrieving revision 2.17 diff -C2 -d -r2.16 -r2.17 *** registry 2001/11/14 16:26:40 2.16 --- registry 2001/11/28 17:40:54 2.17 *************** *** 96,113 **** # python.jythonc.compileropts = +E +D -g ! # python.environment controls the type of environment ! # support provided by the os module. Currently supported are: ! # ! # shell (default) ! # Generate the environment by executing shell commands ! # appropriate to the os environment. ! # ! # None ! # Do not provide any environment or system() support. ! #python.environment=shell ! # python.os controls the commands used to generate the environment. ! # default is to choose commands based on the Java property "os.name". ! # Some generic values are also supported: 'nt', 'dos', 'mac' and 'unix'. #python.os=None --- 96,111 ---- # python.jythonc.compileropts = +E +D -g ! # python.environment controls the type of environment support provided ! # by the os module. Default behavior for known operating systems is to ! # generate the environment by executing shell commands appropriate to ! # the operating system. For unknown operating systems, provide an ! # empty environment. Uncomment this line for an empty environment ! # on all operating systems. ! #python.environment=None ! # python.os determines operating-specific features, similar to and overriding the ! # Java property "os.name". ! # Some generic values are also supported: 'nt', 'dos', 'mac' and 'posix'. ! # Uncomment the following line for the most generic OS behavior available. #python.os=None |
From: Kevin J. B. <kev...@us...> - 2001-11-28 17:31:52
|
Update of /cvsroot/jython/jython/Lib In directory usw-pr-cvs1:/tmp/cvs-serv12072 Modified Files: javaos.py Log Message: General cleanup of os & shell selection code, added Mac curdir/pardir, warn if cannot get environment, separate tests into separate methods Index: javaos.py =================================================================== RCS file: /cvsroot/jython/jython/Lib/javaos.py,v retrieving revision 2.11 retrieving revision 2.12 diff -C2 -d -r2.11 -r2.12 *** javaos.py 2001/11/15 08:17:17 2.11 --- javaos.py 2001/11/28 17:31:50 2.12 *************** *** 1,3 **** ! r"""OS routines for Mac, DOS, NT, or Posix depending on what system we're on. This exports: --- 1,4 ---- ! r"""OS routines for Java, with some attempts to support DOS, NT, and ! Posix functionality. This exports: *************** *** 24,28 **** import java ! from java.io import File, BufferedReader, InputStreamReader import javapath as path from UserDict import UserDict --- 25,29 ---- import java ! from java.io import File, BufferedReader, InputStreamReader, IOException import javapath as path from UserDict import UserDict *************** *** 36,43 **** error = OSError ! name = 'java' # descriminate based on JDK version? ! curdir = '.' ! pardir = '..' #This might not be right... ! #curdir, pardir?? sep = java.io.File.separator altsep = None --- 37,43 ---- error = OSError ! name = 'java' # discriminate based on JDK version? ! curdir = '.' # default to Posix for directory behavior, override below ! pardir = '..' sep = java.io.File.separator altsep = None *************** *** 105,125 **** Lazy initialization is not thread-safe. """ ! ! def __init__( self, dict=None, populate=lambda: {}, keyTransform=None ): ! """dict is the starting dictionary of values ! populate is a function that returns the populated dictionary ! keyTransform is a function to transform the environment keys ! (e.g., upper or identity) """ UserDict.__init__( self, dict ) self._populated = 0 ! self.__populateFunc = populate self._keyTransform = keyTransform or (lambda key: key) def __populate( self ): if not self._populated: - # store as self.data so any 'set' sets in original as well self.data = self.__populateFunc() ! self._populated = 1 # not thread-safe! ########## extend methods from UserDict by pre-populating --- 105,125 ---- Lazy initialization is not thread-safe. """ ! def __init__( self, ! dict=None, ! populate=None, ! keyTransform=None ): ! """dict: starting dictionary of values ! populate: function that returns the populated dictionary ! keyTransform: function to normalize the keys (e.g., toupper/None) """ UserDict.__init__( self, dict ) self._populated = 0 ! self.__populateFunc = populate or (lambda: {}) self._keyTransform = keyTransform or (lambda key: key) def __populate( self ): if not self._populated: self.data = self.__populateFunc() ! self._populated = 1 # race condition ########## extend methods from UserDict by pre-populating *************** *** 174,205 **** - class _NullEnv: - """Placeholder Environment for platforms w/o shell or environment - functionality, like Mac""" - def __init__( self ): - self.environment = LazyDict() - - # note that this won't pass __test() - def execute( self, cmd ): - return None - - def system( self, cmd ): - raise OSError( 0, "os.system not implemented. " - "Try setting python.environment=shell.", cmd ) - return -1 - - def readLines( self, cmd ): - return [] - class _ShellEnv: ! """Environment derived by spawning a subshell and parsing its environment. ! Also supports current directory and system functions. """ ! def __init__( self, cmd, getEnv, keyTransform=None ): ! """cmd is a list of arguments to come before the command in the ! Runtime.exec() call. ! getEnv is the string system command to list the environment variables ! envKeyTransform is a function to transform the environment keys ! (usually toupper or identity) """ self.cmd = cmd --- 174,187 ---- class _ShellEnv: ! """Provide environment derived by spawning a subshell and parsing its ! environment. Also supports system functions and provides empty ! environment support for platforms with unknown shell ! functionality. """ ! def __init__( self, cmd=None, getEnv=None, keyTransform=None ): ! """cmd: list of exec() arguments to run command in subshell, or None ! getEnv: shell command to list environment variables, or None ! keyTransform: normalization function for environment keys, or None """ self.cmd = cmd *************** *** 211,233 **** ########## system def system( self, cmd ): ! """Act like the standard library 'system' call. ! Execute a command in a shell, and send output to stdout. """ p = self.execute( cmd ) - # we want intermediate output while process runs, so call - # _readLines( ... println ) def println( arg, write=sys.stdout.write ): write( arg + "\n" ) ! # read stderr in secondary thread thread.start_new_thread( self._readLines, ! ( p.getErrorStream(), println )) # read stdin in main thread self._readLines( p.getInputStream(), println ) return p.waitFor() - def execute( self, cmd ): ! """Execute cmd in a shell, and then return the process instance""" shellCmd = self._formatCmd( cmd ) if self.environment._populated: --- 193,216 ---- ########## system def system( self, cmd ): ! """Imitate the standard library 'system' call. ! Execute 'cmd' in a shell, and send output to stdout & stderr. """ p = self.execute( cmd ) def println( arg, write=sys.stdout.write ): write( arg + "\n" ) ! def printlnStdErr( arg, write=sys.stderr.write ): ! write( arg + "\n" ) ! ! # read stderr in new thread thread.start_new_thread( self._readLines, ! ( p.getErrorStream(), printlnStdErr )) # read stdin in main thread self._readLines( p.getInputStream(), println ) + return p.waitFor() def execute( self, cmd ): ! """Execute cmd in a shell, and return the process instance""" shellCmd = self._formatCmd( cmd ) if self.environment._populated: *************** *** 235,240 **** else: env = None ! p = java.lang.Runtime.getRuntime().exec( shellCmd, env ) ! return p ########## utility methods --- 218,229 ---- else: env = None ! try: ! p = java.lang.Runtime.getRuntime().exec( shellCmd, env ) ! return p ! except IOException, ex: ! raise OSError( ! 0, ! "Failed to execute command (%s): %s" % ( shellCmd, ex ) ! ) ########## utility methods *************** *** 254,259 **** def _formatCmd( self, cmd ): ! """Format a command for execution in a shell. ! """ return self.cmd + [cmd] --- 243,253 ---- def _formatCmd( self, cmd ): ! """Format a command for execution in a shell.""" ! if self.cmd is None: ! msgFmt = "Unable to execute commands in subshell because shell" \ ! " functionality not implemented for OS %s with shell" \ ! " setting %s. Failed command=%s""" ! raise OSError( 0, msgFmt % ( _osType, _envType, cmd )) ! return self.cmd + [cmd] *************** *** 270,328 **** not have '=' signs. """ - p = self.execute( self.getEnv ) env = {} ! key = 'firstLine' # in case first line had no '=' ! for line in self._readLines( p.getInputStream() ): try: ! i = line.index( '=' ) ! key = self._keyTransform(line[:i]) ! value = line[i+1:] ! except ValueError: ! # found no '=', so this line is part of previous value ! value = '%s\n%s' % ( value, line ) ! env[ key ] = value return env def _getOsType( os=None ): os = os or sys.registry.getProperty( "python.os" ) or \ java.lang.System.getProperty( "os.name" ) _osTypeMap = ( ! ( "nt", r"(nt|Windows NT)|(Windows NT 4.0)|(WindowsNT)|" r"(Windows 2000)|(Windows XP)|(Windows CE)" ), ! ( "dos", r"(dos|Windows 95)|(Windows 98)|(Windows ME)" ), ! ( "mac", r"(mac|MacOS.*)|(Darwin)" ), ! ( "None", r"None" ), ! ( "unix", r".*" ), # last is default, even if doesn't match ) for osType, pattern in _osTypeMap: if re.match( pattern, os ): break - return osType ! def _getShellEnv( os = None ): ! """Select the type of environment handling we want to provide. ! os is None to auto-detect, or something recognized by _getOsType() ! could add 'java' """ ! if os == "shell": ! os = None ! osType = _getOsType( os ) ! if osType == "nt": ! return _ShellEnv( ["cmd", "/c"], "set", string.upper ) ! elif osType == "dos": ! return _ShellEnv( ["command", "/c"], "set", string.upper ) ! elif osType == "mac": ! return _NullEnv() ! else: # osType == "unix": ! return _ShellEnv( ["sh", "-c"], "env" ) ! _envType = sys.registry.getProperty("python.environment", "shell") - if _envType == "shell": - _shellEnv = _getShellEnv() - else: - _shellEnv = _NullEnv() # provide environ, putenv, getenv environ = _shellEnv.environment --- 264,354 ---- not have '=' signs. """ env = {} ! if self.getEnv: try: ! p = self.execute( self.getEnv ) ! lines = self._readLines( p.getInputStream() ) ! if '=' not in lines[0]: ! print "getEnv command (%s) did not print environment.\n" \ ! "Output=%s" % ( ! self.getEnv, '\n'.join( lines ) ! ) ! return env ! ! for line in lines: ! try: ! i = line.index( '=' ) ! key = self._keyTransform(line[:i]) ! value = line[i+1:] ! except ValueError: ! # found no '=', so line is part of previous value ! value = '%s\n%s' % ( value, line ) ! env[ key ] = value ! except OSError, ex: ! print "Failed to get environment, environ will be empty:", ex return env def _getOsType( os=None ): + """Select the OS behavior based on os argument, 'python.os' registry + setting and 'os.name' Java property. + os: explicitly select desired OS. os=None to autodetect, os='None' to + disable + """ os = os or sys.registry.getProperty( "python.os" ) or \ java.lang.System.getProperty( "os.name" ) _osTypeMap = ( ! ( "nt", r"(nt)|(Windows NT)|(Windows NT 4.0)|(WindowsNT)|" r"(Windows 2000)|(Windows XP)|(Windows CE)" ), ! ( "dos", r"(dos)|(Windows 95)|(Windows 98)|(Windows ME)" ), ! ( "mac", r"(mac)|(MacOS.*)|(Darwin)" ), ! ( "None", r"(None)" ), ! ( "posix", r"(.*)" ), # default - posix seems to vary mast widely ) for osType, pattern in _osTypeMap: if re.match( pattern, os ): break return osType ! def _getShellEnv( envType, shellCmd, envCmd, envTransform ): ! """Create the desired environment type. ! envType: 'shell' or None """ ! if envType == "shell": ! return _ShellEnv( shellCmd, envCmd, envTransform ) ! else: ! return _ShellEnv() ! ! _osType = _getOsType() _envType = sys.registry.getProperty("python.environment", "shell") + # default to None/empty for shell and environment behavior + _shellCmd = None + _envCmd = None + _envTransform = None + + # override defaults based on _osType + if _osType == "nt": + _shellCmd = ["cmd", "/c"] + _envCmd = "set" + _envTransform = string.upper + elif _osType == "dos": + _shellCmd = ["command.com", "/c"] + _envCmd = "set" + _envTransform = string.upper + elif _osType == "posix": + _shellCmd = ["sh", "-c"] + _envCmd = "env" + elif _osType == "mac": + curdir = ':' # override Posix directories + pardir = '::' + elif _osType == "None": + pass + # else: + # # may want a warning, but only at high verbosity: + # warn( "Unknown os type '%s', using default behavior." % _osType ) + + _shellEnv = _getShellEnv( _envType, _shellCmd, _envCmd, _envTransform ) + # provide environ, putenv, getenv environ = _shellEnv.environment *************** *** 333,338 **** ########## test code ! def __test( shellEnv=_shellEnv ): ! # tests system and environment functionality key, value = "testKey", "testValue" org = environ --- 359,394 ---- ########## test code ! def _testGetOsType(): ! testVals = { ! "Windows NT": "nt", ! "Windows 95": "dos", ! "MacOS": "mac", ! "Solaris": "posix", ! "Linux": "posix", ! "None": "None" ! } ! ! msgFmt = "_getOsType( '%s' ) should return '%s', not '%s'" ! # test basic mappings ! for key, val in testVals.items(): ! got = _getOsType( key ) ! assert got == val, msgFmt % ( key, val, got ) ! ! def _testCmds( _shellEnv, testCmds, whichEnv ): ! # test commands (key) and compare output to expected output (value). ! # this actually executes all the commands twice, testing the return ! # code by calling system(), and testing some of the output by calling ! # execute() ! for cmd, pattern in testCmds: ! print "\nExecuting '%s' with %s environment" % (cmd, whichEnv) ! assert not _shellEnv.system( cmd ), \ ! "%s failed with %s environment" % (cmd, whichEnv) ! line = _shellEnv._readLines( ! _shellEnv.execute(cmd).getInputStream())[0] ! assert re.match( pattern, line ), \ ! "expected match for %s, got %s" % ( pattern, line ) ! ! def _testSystem( shellEnv=_shellEnv ): ! # test system and environment functionality key, value = "testKey", "testValue" org = environ *************** *** 349,355 **** ("echo PATH=%PATH%", "(PATH=.*;.*)|(PATH=%PATH%)"), # should print 'testKey=%testKey%' on NT before initialization, # and 'testKey=testValue' after ("echo %s=%%%s%%" % (key,key), ! "(%s=%%%s%%)|(%s=%s)" % (key, key, key, value)), # should print PATH (on Unix) ( "echo PATH=$PATH", "PATH=.*" ), --- 405,412 ---- ("echo PATH=%PATH%", "(PATH=.*;.*)|(PATH=%PATH%)"), # should print 'testKey=%testKey%' on NT before initialization, + # should print 'testKey=' on 95 before initialization, # and 'testKey=testValue' after ("echo %s=%%%s%%" % (key,key), ! "(%s=)" % (key,)), # should print PATH (on Unix) ( "echo PATH=$PATH", "PATH=.*" ), *************** *** 360,368 **** ( 'echo "hello there"', '"?hello there"?' ), # should print 'why' to stdout. ! ( r'''python -c "import sys;sys.stdout.write( 'why\n' )"''', "why" ), # should print 'why' to stderr, but it won't right now. Have # to add the print to give some output...empty string matches every # thing... ! ( r'''python -c "import sys;sys.stderr.write('why\n');print " ''', "" ) ] --- 417,426 ---- ( 'echo "hello there"', '"?hello there"?' ), # should print 'why' to stdout. ! ( r'''jython -c "import sys;sys.stdout.write( 'why\n' )"''', "why" ), # should print 'why' to stderr, but it won't right now. Have # to add the print to give some output...empty string matches every # thing... ! ( r'''jython -c "import sys;sys.stderr.write('why\n');print " ''', ! "" ) ] *************** *** 370,382 **** "before population, environ._populated should be false" ! # test system - we should really grab the output of the system ! # command, but we aren't ! for cmd, pattern in testCmds: ! print "\nExecuting %s with default environment" % cmd ! assert not _shellEnv.system( cmd ), \ ! "%s failed with default environment" % cmd ! line = _shellEnv._readLines(_shellEnv.execute(cmd).getInputStream())[0] ! assert re.match( pattern, line ), \ ! "expected match for %s, got %s" % ( pattern, line ) # trigger initialization of environment --- 428,432 ---- "before population, environ._populated should be false" ! _testCmds( _shellEnv, testCmds, "default" ) # trigger initialization of environment *************** *** 390,402 **** "expected real environment to have %s set" % key ! # test system using the non-default environment - should really grab ! # output, but oh, well. ! for cmd, pattern in testCmds: ! print "\nExecuting %s with initialized environment" % cmd ! assert not _shellEnv.system( cmd ), \ ! "%s failed with default environment" % cmd ! line = _shellEnv._readLines(_shellEnv.execute(cmd).getInputStream())[0] ! assert re.match( pattern, line ), \ ! "expected match for %s, got %s" % ( pattern, line ) assert environ.has_key( "PATH" ), \ --- 440,445 ---- "expected real environment to have %s set" % key ! # test system using the non-default environment ! _testCmds( _shellEnv, testCmds, "initialized" ) assert environ.has_key( "PATH" ), \ *************** *** 404,405 **** --- 447,467 ---- "(this may not apply to all platforms!)" + def _testBadShell(): + # attempt to get an environment with a shell that is not startable + se2 = _ShellEnv( ["badshell", "-c"], "set" ) + str(se2.environment) # trigger initialization + assert not se2.environment.items(), "environment should be empty" + + def _testBadGetEnv(): + # attempt to get an environment with a command that does not print an environment + se2 = _getShellEnv( "shell", _shellCmd, _envCmd, _envTransform ) + se2.getEnv="echo This command does not print environment" + str(se2.environment) # trigger initialization + assert not se2.environment.items(), "environment should be empty" + + def _test(): + _testGetOsType() + _testBadShell() + _testBadGetEnv() + _testSystem() + |
From: Finn B. <bc...@us...> - 2001-11-27 19:34:19
|
Update of /cvsroot/jython/jython/installer In directory usw-pr-cvs1:/tmp/cvs-serv8016 Modified Files: liftoff.filelist mklist.py Log Message: Make ucnhash.dat part of the source distribution. Index: liftoff.filelist =================================================================== RCS file: /cvsroot/jython/jython/installer/liftoff.filelist,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** liftoff.filelist 2001/11/27 19:13:15 1.22 --- liftoff.filelist 2001/11/27 19:34:16 1.23 *************** *** 414,417 **** --- 414,418 ---- t org/python/modules/_weakref.java ..\org\python\modules\_weakref.java t org/python/modules/Makefile ..\org\python\modules\Makefile + b org/python/modules/ucnhash.dat ..\org/python/modules/ucnhash.dat t org/python/modules/sre/MatchObject.java ..\org\python\modules\sre\MatchObject.java t org/python/modules/sre/PatternObject.java ..\org\python\modules\sre\PatternObject.java Index: mklist.py =================================================================== RCS file: /cvsroot/jython/jython/installer/mklist.py,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** mklist.py 2001/11/27 11:02:28 1.27 --- mklist.py 2001/11/27 19:34:17 1.28 *************** *** 216,219 **** --- 216,220 ---- listfiles(None, "org/python/core", *javafiles) listfiles(None, "org/python/modules", *javafiles) + binary("org/python/modules/ucnhash.dat") listfiles(None, "org/python/modules/sre", *javafiles) listfiles(None, "org/python/parser", exclude=["python.java"], *javafiles) |
From: Finn B. <bc...@us...> - 2001-11-27 19:13:18
|
Update of /cvsroot/jython/jython/installer In directory usw-pr-cvs1:/tmp/cvs-serv1528 Modified Files: liftoff.filelist Log Message: New java file and correct case of zxjdbc.html Index: liftoff.filelist =================================================================== RCS file: /cvsroot/jython/jython/installer/liftoff.filelist,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** liftoff.filelist 2001/11/27 11:03:19 1.21 --- liftoff.filelist 2001/11/27 19:13:15 1.22 *************** *** 82,86 **** t Doc/usejava.html ..\Doc\usejava.html t Doc/whatis.html ..\Doc\whatis.html ! t Doc/zxJDBC.html ..\Doc\zxJDBC.html b Doc/images/jython-new-small.gif ..\Doc/images/jython-new-small.gif b Doc/images/PythonPoweredSmall.gif ..\Doc/images/PythonPoweredSmall.gif --- 82,86 ---- t Doc/usejava.html ..\Doc\usejava.html t Doc/whatis.html ..\Doc\whatis.html ! t Doc/zxjdbc.html ..\Doc\zxjdbc.html b Doc/images/jython-new-small.gif ..\Doc/images/jython-new-small.gif b Doc/images/PythonPoweredSmall.gif ..\Doc/images/PythonPoweredSmall.gif *************** *** 269,272 **** --- 269,273 ---- t org/python/compiler/ArgListCompiler.java ..\org\python\compiler\ArgListCompiler.java t org/python/compiler/Attribute.java ..\org\python\compiler\Attribute.java + t org/python/compiler/ClassConstants.java ..\org\python\compiler\ClassConstants.java t org/python/compiler/ClassFile.java ..\org\python\compiler\ClassFile.java t org/python/compiler/Code.java ..\org\python\compiler\Code.java |
From: Finn B. <bc...@us...> - 2001-11-27 19:12:19
|
Update of /cvsroot/jython/jython/org/python/compiler In directory usw-pr-cvs1:/tmp/cvs-serv1312 Added Files: ClassConstants.java Log Message: Initial version. --- NEW FILE: ClassConstants.java --- package org.python.compiler; public interface ClassConstants { final static String $pyObj = "Lorg/python/core/PyObject;"; final static String $pyObjArr = "[Lorg/python/core/PyObject;"; final static String $pyStr = "Lorg/python/core/PyString;"; final static String $pyExc = "Lorg/python/core/PyException;"; final static String $pyFrame = "Lorg/python/core/PyFrame;"; final static String $pyCode = "Lorg/python/core/PyCode;"; final static String $pyInteger = "Lorg/python/core/PyInteger;"; final static String $pyLong = "Lorg/python/core/PyLong;"; final static String $pyFloat = "Lorg/python/core/PyFloat;"; final static String $pyComplex = "Lorg/python/core/PyComplex;"; final static String $pyRunnable = "Lorg/python/core/PyRunnable;"; final static String $pyFuncTbl = "Lorg/python/core/PyFunctionTable;"; final static String $pyProxy = "Lorg/python/core/PyProxy;"; final static String $obj = "Ljava/lang/Object;"; final static String $objArr = "[Ljava/lang/Object;"; final static String $clss = "Ljava/lang/Class;"; final static String $str = "Ljava/lang/String;"; final static String $strArr = "[Ljava/lang/String;"; final static String $throwable = "Ljava/lang/Throwable;"; } |
From: Finn B. <bc...@us...> - 2001-11-27 19:07:25
|
Update of /cvsroot/jython/jython/org/python/util In directory usw-pr-cvs1:/tmp/cvs-serv31804/util Modified Files: PyServlet.java PythonInterpreter.java jython.java Log Message: Long line normalization. Index: PyServlet.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/util/PyServlet.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** PyServlet.java 2001/11/27 13:51:38 1.12 --- PyServlet.java 2001/11/27 19:07:22 1.13 *************** *** 78,87 **** } if (props.getProperty("python.home") == null && ! System.getProperty("python.home") == null) { props.put("python.home", rootPath + "WEB-INF" + File.separator + "lib"); } ! PythonInterpreter.initialize(System.getProperties(), props, new String[0]); reset(); --- 78,88 ---- } if (props.getProperty("python.home") == null && ! System.getProperty("python.home") == null) { props.put("python.home", rootPath + "WEB-INF" + File.separator + "lib"); } ! PythonInterpreter.initialize(System.getProperties(), props, ! new String[0]); reset(); *************** *** 111,115 **** req.setAttribute("pyservlet", this); ! String spath = (String)req.getAttribute("javax.servlet.include.servlet_path"); if (spath == null) { spath = ((HttpServletRequest) req).getServletPath(); --- 112,117 ---- req.setAttribute("pyservlet", this); ! String spath = (String)req.getAttribute( ! "javax.servlet.include.servlet_path"); if (spath == null) { spath = ((HttpServletRequest) req).getServletPath(); Index: PythonInterpreter.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/util/PythonInterpreter.java,v retrieving revision 2.10 retrieving revision 2.11 diff -C2 -d -r2.10 -r2.11 *** PythonInterpreter.java 2001/11/27 13:51:38 2.10 --- PythonInterpreter.java 2001/11/27 19:07:22 2.11 *************** *** 135,139 **** public void exec(String s) { setState(); ! Py.exec(Py.compile_flags(s, "<string>", "exec",cflags), locals, locals); } --- 135,140 ---- public void exec(String s) { setState(); ! Py.exec(Py.compile_flags(s, "<string>", "exec",cflags), ! locals, locals); } Index: jython.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/util/jython.java,v retrieving revision 2.22 retrieving revision 2.23 diff -C2 -d -r2.22 -r2.23 *** jython.java 2001/11/27 13:51:38 2.22 --- jython.java 2001/11/27 19:07:22 2.23 *************** *** 12,16 **** "Options and arguments:\n"+ "-i : inspect interactively after running script, and force\n"+ ! " prompts, even if stdin does not appear to be a terminal\n"+ "-S : don't imply `import site' on initialization\n"+ "-v : verbose (trace import statements)\n"+ --- 12,17 ---- "Options and arguments:\n"+ "-i : inspect interactively after running script, and force\n"+ ! " prompts, even if stdin does not appear to be a "+ ! "terminal\n"+ "-S : don't imply `import site' on initialization\n"+ "-v : verbose (trace import statements)\n"+ *************** *** 18,22 **** "-jar jar : program read from __run__.py in jar file\n"+ "-c cmd : program passed in as string (terminates option list)\n"+ ! "-W arg : warning control (arg is action:message:category:module:lineno)\n"+ "-E codec : Use a different codec the reading from the console.\n"+ "file : program read from script file\n"+ --- 19,24 ---- "-jar jar : program read from __run__.py in jar file\n"+ "-c cmd : program passed in as string (terminates option list)\n"+ ! "-W arg : warning control (arg is action:message:category:module:"+ ! "lineno)\n"+ "-E codec : Use a different codec the reading from the console.\n"+ "file : program read from script file\n"+ *************** *** 110,116 **** 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\""; --- 112,121 ---- 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\""; *************** *** 128,132 **** msg += "\"license\""; if (msg.length() > 0) ! System.err.println("Type " + msg + " for more information."); } } catch (PyException pye) { --- 133,138 ---- msg += "\"license\""; if (msg.length() > 0) ! System.err.println("Type " + msg + ! " for more information."); } } catch (PyException pye) { |
From: Finn B. <bc...@us...> - 2001-11-27 19:07:25
|
Update of /cvsroot/jython/jython/org/python/modules/sre In directory usw-pr-cvs1:/tmp/cvs-serv31804/modules/sre Modified Files: MatchObject.java PatternObject.java SRE_STATE.java Log Message: Long line normalization. Index: MatchObject.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/modules/sre/MatchObject.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** MatchObject.java 2001/11/27 13:51:37 1.5 --- MatchObject.java 2001/11/27 19:07:22 1.6 *************** *** 128,132 **** PyTuple _pair(int i1, int i2) { ! return new PyTuple(new PyObject[] { Py.newInteger(i1), Py.newInteger(i2) }); } --- 128,134 ---- PyTuple _pair(int i1, int i2) { ! return new PyTuple(new PyObject[] { ! Py.newInteger(i1), Py.newInteger(i2) ! }); } *************** *** 158,162 **** int end = mark[index+1]; ! //System.out.println("group:" + index + " " + start + " " + end + " l:" + string.length()); if (string == null || start < 0) --- 160,165 ---- int end = mark[index+1]; ! //System.out.println("group:" + index + " " + start + " " + ! // end + " l:" + string.length()); if (string == null || start < 0) Index: PatternObject.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/modules/sre/PatternObject.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** PatternObject.java 2001/11/27 13:51:37 1.6 --- PatternObject.java 2001/11/27 19:07:22 1.7 *************** *** 61,65 **** public MatchObject search(PyObject[] args, String[] kws) { ! ArgParser ap = new ArgParser("search", args, kws, "pattern", "pos", "endpos"); String string = ap.getString(0); int start = ap.getInt(1, 0); --- 61,66 ---- public MatchObject search(PyObject[] args, String[] kws) { ! ArgParser ap = new ArgParser("search", args, kws, ! "pattern", "pos", "endpos"); String string = ap.getString(0); int start = ap.getInt(1, 0); *************** *** 75,79 **** public PyObject sub(PyObject[] args, String[] kws) { ! ArgParser ap = new ArgParser("sub", args, kws, "repl", "string", "count"); PyObject template = ap.getPyObject(0); String string = ap.getString(1); --- 76,81 ---- public PyObject sub(PyObject[] args, String[] kws) { ! ArgParser ap = new ArgParser("sub", args, kws, ! "repl", "string", "count"); PyObject template = ap.getPyObject(0); String string = ap.getString(1); *************** *** 89,93 **** public PyObject subn(PyObject[] args, String[] kws) { ! ArgParser ap = new ArgParser("subn", args, kws, "repl", "string", "count"); PyObject template = ap.getPyObject(0); String string = ap.getString(1); --- 91,96 ---- public PyObject subn(PyObject[] args, String[] kws) { ! ArgParser ap = new ArgParser("subn", args, kws, ! "repl", "string", "count"); PyObject template = ap.getPyObject(0); String string = ap.getString(1); *************** *** 103,107 **** public PyObject split(PyObject[] args, String[] kws) { ! ArgParser ap = new ArgParser("split", args, kws, "source", "maxsplit"); String string = ap.getString(0); int count = ap.getInt(1, 0); --- 106,111 ---- public PyObject split(PyObject[] args, String[] kws) { ! ArgParser ap = new ArgParser("split", args, kws, ! "source", "maxsplit"); String string = ap.getString(0); int count = ap.getInt(1, 0); *************** *** 121,125 **** public PyObject findall(PyObject[] args, String[] kws) { ! ArgParser ap = new ArgParser("findall", args, kws, "source", "pos", "endpos"); String string = ap.getString(0); int start = ap.getInt(1, 0); --- 125,130 ---- public PyObject findall(PyObject[] args, String[] kws) { ! ArgParser ap = new ArgParser("findall", args, kws, ! "source", "pos", "endpos"); String string = ap.getString(0); int start = ap.getInt(1, 0); *************** *** 140,144 **** switch (groups) { case 0: ! item = Py.newString(string.substring(state.start, state.ptr)); break; case 1: --- 145,150 ---- switch (groups) { case 0: ! item = Py.newString( ! string.substring(state.start, state.ptr)); break; case 1: *************** *** 196,204 **** ! MatchObject _pattern_new_match(SRE_STATE state, String string, int status) { ! /* create match object (from state object) */ - //System.out.println("status = " + status + " " + string); --- 202,210 ---- ! MatchObject _pattern_new_match(SRE_STATE state, String string, ! int status) ! { /* create match object (from state object) */ //System.out.println("status = " + status + " " + string); *************** *** 220,224 **** int i, j; for (i = j = 0; i < groups; i++, j+=2) { ! if (j+1 <= state.lastmark && state.mark[j] != -1 && state.mark[j+1] != -1) { match.mark[j+2] = state.mark[j] - base; match.mark[j+3] = state.mark[j+1] - base; --- 226,231 ---- int i, j; for (i = j = 0; i < groups; i++, j+=2) { ! if (j+1 <= state.lastmark && state.mark[j] != -1 && ! state.mark[j+1] != -1) { match.mark[j+2] = state.mark[j] - base; match.mark[j+3] = state.mark[j+1] - base; Index: SRE_STATE.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/modules/sre/SRE_STATE.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** SRE_STATE.java 2001/11/27 13:51:37 1.6 --- SRE_STATE.java 2001/11/27 19:07:22 1.7 *************** *** 21,28 **** public class SRE_STATE { ! public static final int SRE_ERROR_ILLEGAL = -1; /* illegal opcode */ ! public static final int SRE_ERROR_STATE = -2; /* illegal state */ ! public static final int SRE_ERROR_RECURSION_LIMIT = -3; /* runaway recursion */ public static final int SRE_OP_FAILURE = 0; public static final int SRE_OP_SUCCESS = 1; --- 21,33 ---- public class SRE_STATE { ! /* illegal opcode */ ! public static final int SRE_ERROR_ILLEGAL = -1; ! ! /* illegal state */ ! public static final int SRE_ERROR_STATE = -2; + /* runaway recursion */ + public static final int SRE_ERROR_RECURSION_LIMIT = -3; + public static final int SRE_OP_FAILURE = 0; public static final int SRE_OP_SUCCESS = 1; *************** *** 120,124 **** int lastindex; int lastmark; ! int[] mark = new int[200]; /* FIXME: <fl> should be dynamically allocated! */ /* dynamically allocated stuff */ --- 125,131 ---- int lastindex; int lastmark; ! ! /* FIXME: <fl> should be dynamically allocated! */ ! int[] mark = new int[200]; /* dynamically allocated stuff */ *************** *** 316,320 **** case SRE_OP_CHARSET: /* <CHARSET> <bitmap> (16 bits per code word) */ ! if (ch < 256 && (set[setidx + (ch >> 4)] & (1 << (ch & 15))) != 0) return ok; setidx += 16; --- 323,328 ---- case SRE_OP_CHARSET: /* <CHARSET> <bitmap> (16 bits per code word) */ ! if (ch < 256 && ! (set[setidx + (ch >> 4)] & (1 << (ch & 15))) != 0) return ok; setidx += 16; *************** *** 591,595 **** case SRE_OP_IN_IGNORE: //TRACE(pidx, ptr, "IN_IGNORE"); ! if (ptr >= end || !SRE_CHARSET(pattern, pidx + 1, lower(str[ptr]))) return 0; pidx += (int)pattern[pidx]; --- 599,604 ---- case SRE_OP_IN_IGNORE: //TRACE(pidx, ptr, "IN_IGNORE"); ! if (ptr >= end || ! !SRE_CHARSET(pattern, pidx + 1, lower(str[ptr]))) return 0; pidx += (int)pattern[pidx]; *************** *** 656,661 **** (ptr >= end || str[ptr] != pattern[pidx+2])) continue; ! if (pattern[pidx+1] == SRE_OP_IN && ! (ptr >= end || !SRE_CHARSET(pattern, pidx + 3, str[ptr]))) continue; this.ptr = ptr; --- 665,670 ---- (ptr >= end || str[ptr] != pattern[pidx+2])) continue; ! if (pattern[pidx+1] == SRE_OP_IN && (ptr >= end || ! !SRE_CHARSET(pattern, pidx + 3, str[ptr]))) continue; this.ptr = ptr; *************** *** 687,691 **** this.ptr = ptr; ! count = SRE_COUNT(pattern, pidx + 3, pattern[pidx+2], level + 1); if (count < 0) return count; --- 696,701 ---- this.ptr = ptr; ! count = SRE_COUNT(pattern, pidx + 3, pattern[pidx+2], ! level + 1); if (count < 0) return count; *************** *** 719,723 **** break; this.ptr = ptr; ! i = SRE_MATCH(pattern, pidx + pattern[pidx], level + 1); if (i != 0) return 1; --- 729,734 ---- break; this.ptr = ptr; ! i = SRE_MATCH(pattern, pidx + pattern[pidx], ! level + 1); if (i != 0) return 1; *************** *** 731,735 **** while (count >= mincount) { this.ptr = ptr; ! i = SRE_MATCH(pattern, pidx + pattern[pidx], level + 1); if (i != 0) return i; --- 742,747 ---- while (count >= mincount) { this.ptr = ptr; ! i = SRE_MATCH(pattern, pidx + pattern[pidx], ! level + 1); if (i != 0) return i; *************** *** 792,796 **** } ! if (count < pattern[rp.pidx+2] || pattern[rp.pidx+2] == 65535) { /* we may have enough matches, but if we can match another item, do so */ --- 804,809 ---- } ! if (count < pattern[rp.pidx+2] || ! pattern[rp.pidx+2] == 65535) { /* we may have enough matches, but if we can match another item, do so */ *************** *** 862,866 **** this.repeat = rp; ! if (count >= pattern[rp.pidx+2] && pattern[rp.pidx+2] != 65535) return 0; --- 875,880 ---- this.repeat = rp; ! if (count >= pattern[rp.pidx+2] && ! pattern[rp.pidx+2] != 65535) return 0; *************** *** 949,953 **** if ((flags & SRE_INFO_LITERAL) != 0) return 1; /* we got all of it */ ! status = SRE_MATCH(pattern, pidx + 2*prefix_skip, 1); if (status != 0) return status; --- 963,968 ---- if ((flags & SRE_INFO_LITERAL) != 0) return 1; /* we got all of it */ ! status = SRE_MATCH(pattern, ! pidx + 2*prefix_skip, 1); if (status != 0) return status; *************** *** 1079,1083 **** static final int SRE_WORD_MASK = 16; ! static byte[] sre_char_info = new byte[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 6, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25, 25, 25, 25, 25, 25, 25, 25, --- 1094,1099 ---- static final int SRE_WORD_MASK = 16; ! static byte[] sre_char_info = new byte[] { ! 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 6, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25, 25, 25, 25, 25, 25, 25, 25, *************** *** 1087,1091 **** 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 0, 0, 0, 0, 0 }; ! static byte[] sre_char_lower = new byte[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, --- 1103,1108 ---- 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 0, 0, 0, 0, 0 }; ! static byte[] sre_char_lower = new byte[] { ! 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, *************** *** 1098,1110 **** final boolean SRE_IS_DIGIT(char ch) { ! return ((ch) < 128 ? (sre_char_info[(ch)] & SRE_DIGIT_MASK) != 0 : false); } final boolean SRE_IS_SPACE(char ch) { ! return ((ch) < 128 ? (sre_char_info[(ch)] & SRE_SPACE_MASK) != 0 : false); } final boolean SRE_IS_WORD(char ch) { ! return ((ch) < 128 ? (sre_char_info[(ch)] & SRE_WORD_MASK) != 0 : false); } --- 1115,1130 ---- final boolean SRE_IS_DIGIT(char ch) { ! return ((ch) < 128 ? ! (sre_char_info[(ch)] & SRE_DIGIT_MASK) != 0 : false); } final boolean SRE_IS_SPACE(char ch) { ! return ((ch) < 128 ? ! (sre_char_info[(ch)] & SRE_SPACE_MASK) != 0 : false); } final boolean SRE_IS_WORD(char ch) { ! return ((ch) < 128 ? ! (sre_char_info[(ch)] & SRE_WORD_MASK) != 0 : false); } |
Update of /cvsroot/jython/jython/org/python/modules In directory usw-pr-cvs1:/tmp/cvs-serv31804/modules Modified Files: MD5Module.java _weakref.java cPickle.java codeop.java operator.java thread.java time.java types.java Log Message: Long line normalization. Index: MD5Module.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/modules/MD5Module.java,v retrieving revision 2.9 retrieving revision 2.10 diff -C2 -d -r2.9 -r2.10 *** MD5Module.java 2001/10/28 17:13:44 2.9 --- MD5Module.java 2001/11/27 19:07:22 2.10 *************** *** 44,56 **** "This module implements the interface to RSA's MD5 message digest\n"+ "algorithm (see also Internet RFC 1321). Its use is quite\n"+ ! "straightforward: use the new() to create an md5 object. You can now\n"+ ! "feed this object with arbitrary strings using the update() method, and\n"+ ! "at any point you can ask it for the digest (a strong kind of 128-bit\n"+ ! "checksum, a.k.a. ``fingerprint'') of the concatenation of the strings\n"+ "fed to it so far using the digest() method.\n"+ "\n"+ "Functions:\n"+ "\n"+ ! "new([arg]) -- return a new md5 object, initialized with arg if provided\n"+ "md5([arg]) -- DEPRECATED, same as new, but for compatibility\n"+ "\n"+ --- 44,61 ---- "This module implements the interface to RSA's MD5 message digest\n"+ "algorithm (see also Internet RFC 1321). Its use is quite\n"+ ! "straightforward: use the new() to create an md5 object. "+ ! "You can now\n"+ ! "feed this object with arbitrary strings using the update() method, "+ ! "and\n"+ ! "at any point you can ask it for the digest (a strong kind of "+ ! "128-bit\n"+ ! "checksum, a.k.a. ``fingerprint'') of the concatenation of the "+ ! "strings\n"+ "fed to it so far using the digest() method.\n"+ "\n"+ "Functions:\n"+ "\n"+ ! "new([arg]) -- return a new md5 object, initialized with arg if "+ ! "provided\n"+ "md5([arg]) -- DEPRECATED, same as new, but for compatibility\n"+ "\n"+ Index: _weakref.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/modules/_weakref.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** _weakref.java 2001/11/27 13:51:37 1.2 --- _weakref.java 2001/11/27 19:07:22 1.3 *************** *** 240,244 **** if (o == null) { throw new PyException(ReferenceError, ! "weakly-referenced object no longer exists"); } return o; --- 240,244 ---- if (o == null) { throw new PyException(ReferenceError, ! "weakly-referenced object no longer exists"); } return o; *************** *** 253,257 **** return null; PyObject pythis = (PyObject) gref.get(); ! PyObject pyother = (PyObject) ((AbstractReference) other).gref.get(); if (pythis == null || pyother == null) return this == other ? Py.One : Py.Zero; --- 253,258 ---- return null; PyObject pythis = (PyObject) gref.get(); ! PyObject pyother = (PyObject) ((AbstractReference) other). ! gref.get(); if (pythis == null || pyother == null) return this == other ? Py.One : Py.Zero; Index: cPickle.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/modules/cPickle.java,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** cPickle.java 2001/11/27 13:51:37 1.20 --- cPickle.java 2001/11/27 19:07:22 1.21 *************** *** 499,508 **** public static PyObject _UnpickleableError(PyObject[] arg, String[] kws) { PyObject dict = _empty__init__(arg, kws); ! dict.__setitem__("__init__", getJavaFunc("_UnpickleableError__init__")); ! dict.__setitem__("__str__", getJavaFunc("_UnpickleableError__str__")); return dict; } ! public static void _UnpickleableError__init__(PyObject[] arg, String[] kws) { ArgParser ap = new ArgParser("__init__", arg, kws, "self", "args"); PyObject self = ap.getPyObject(0); --- 499,512 ---- public static PyObject _UnpickleableError(PyObject[] arg, String[] kws) { PyObject dict = _empty__init__(arg, kws); ! dict.__setitem__("__init__", ! getJavaFunc("_UnpickleableError__init__")); ! dict.__setitem__("__str__", ! getJavaFunc("_UnpickleableError__str__")); return dict; } ! public static void _UnpickleableError__init__(PyObject[] arg, ! String[] kws) ! { ArgParser ap = new ArgParser("__init__", arg, kws, "self", "args"); PyObject self = ap.getPyObject(0); *************** *** 512,516 **** } ! public static PyString _UnpickleableError__str__(PyObject[] arg, String[] kws) { ArgParser ap = new ArgParser("__str__", arg, kws, "self"); PyObject self = ap.getPyObject(0); --- 516,522 ---- } ! public static PyString _UnpickleableError__str__(PyObject[] arg, ! String[] kws) ! { ArgParser ap = new ArgParser("__str__", arg, kws, "self"); PyObject self = ap.getPyObject(0); Index: codeop.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/modules/codeop.java,v retrieving revision 2.8 retrieving revision 2.9 diff -C2 -d -r2.8 -r2.9 *** codeop.java 2001/11/27 13:51:37 2.8 --- codeop.java 2001/11/27 19:07:22 2.9 *************** *** 33,37 **** } ! public static PyObject compile_command_flags(String string,String filename,String kind,CompilerFlags cflags) { org.python.parser.SimpleNode node = --- 33,38 ---- } ! public static PyObject compile_command_flags(String string, ! String filename, String kind, CompilerFlags cflags) { org.python.parser.SimpleNode node = *************** *** 40,44 **** if (node == null) return Py.None; ! return Py.compile_flags(node, Py.getName(), filename, true, true,cflags); } --- 41,46 ---- if (node == null) return Py.None; ! return Py.compile_flags(node, Py.getName(), filename, true, true, ! cflags); } Index: operator.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/modules/operator.java,v retrieving revision 2.7 retrieving revision 2.8 diff -C2 -d -r2.7 -r2.8 *** operator.java 2001/10/28 17:13:44 2.7 --- operator.java 2001/11/27 19:07:22 2.8 *************** *** 84,91 **** "Operator interface.\n"+ "\n"+ ! "This module exports a set of functions implemented in C corresponding\n"+ ! "to the intrinsic operators of Python. For example, operator.add(x, y)\n"+ ! "is equivalent to the expression x+y. The function names are those\n"+ ! "used for special class methods; variants without leading and trailing\n"+ "'__' are also provided for convenience.\n" ); --- 84,95 ---- "Operator interface.\n"+ "\n"+ ! "This module exports a set of functions implemented in C "+ ! "corresponding\n"+ ! "to the intrinsic operators of Python. For example, "+ ! "operator.add(x, y)\n"+ ! "is equivalent to the expression x+y. The function names "+ ! "are those\n"+ ! "used for special class methods; variants without leading "+ ! "and trailing\n"+ "'__' are also provided for convenience.\n" ); Index: thread.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/modules/thread.java,v retrieving revision 2.5 retrieving revision 2.6 diff -C2 -d -r2.5 -r2.6 *** thread.java 2001/10/28 17:13:44 2.5 --- thread.java 2001/11/27 19:07:22 2.6 *************** *** 29,33 **** { public static PyString __doc__ = new PyString( ! "This module provides primitive operations to write multi-threaded programs.\n" + "The 'threading' module provides a more convenient interface." ); --- 29,34 ---- { public static PyString __doc__ = new PyString( ! "This module provides primitive operations to write multi-threaded "+ ! "programs.\n" + "The 'threading' module provides a more convenient interface." ); Index: time.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/modules/time.java,v retrieving revision 2.19 retrieving revision 2.20 diff -C2 -d -r2.19 -r2.20 *** time.java 2001/11/27 13:51:37 2.19 --- time.java 2001/11/27 19:07:22 2.20 *************** *** 55,65 **** "This module provides various functions to manipulate time values.\n"+ "\n"+ ! "There are two standard representations of time. One is the number\n"+ ! "of seconds since the Epoch, in UTC (a.k.a. GMT). It may be an integer\n"+ "or a floating point number (to represent fractions of seconds).\n"+ ! "The Epoch is system-defined; on Unix, it is generally January 1st, 1970.\n"+ "The actual value can be retrieved by calling gmtime(0).\n"+ "\n"+ ! "The other representation is a tuple of 9 integers giving local time.\n"+ "The tuple items are:\n"+ " year (four digits, e.g. 1998)\n"+ --- 55,69 ---- "This module provides various functions to manipulate time values.\n"+ "\n"+ ! "There are two standard representations of time. One is the "+ ! "number\n"+ ! "of seconds since the Epoch, in UTC (a.k.a. GMT). It may be an "+ ! "integer\n"+ "or a floating point number (to represent fractions of seconds).\n"+ ! "The Epoch is system-defined; on Unix, it is generally "+ ! "January 1st, 1970.\n"+ "The actual value can be retrieved by calling gmtime(0).\n"+ "\n"+ ! "The other representation is a tuple of 9 integers giving "+ ! "local time.\n"+ "The tuple items are:\n"+ " year (four digits, e.g. 1998)\n"+ *************** *** 78,82 **** "Variables:\n"+ "\n"+ ! "timezone -- difference in seconds between UTC and local standard time\n"+ "altzone -- difference in seconds between UTC and local DST time\n"+ "daylight -- whether local time should reflect DST\n"+ --- 82,87 ---- "Variables:\n"+ "\n"+ ! "timezone -- difference in seconds between UTC and local "+ ! "standard time\n"+ "altzone -- difference in seconds between UTC and local DST time\n"+ "daylight -- whether local time should reflect DST\n"+ *************** *** 85,89 **** "Functions:\n"+ "\n"+ ! "time() -- return current time in seconds since the Epoch as a float\n"+ "clock() -- return CPU time since process start as a float\n"+ "sleep() -- delay for a number of seconds given as a float\n"+ --- 90,95 ---- "Functions:\n"+ "\n"+ ! "time() -- return current time in seconds since the Epoch "+ ! "as a float\n"+ "clock() -- return CPU time since process start as a float\n"+ "sleep() -- delay for a number of seconds given as a float\n"+ *************** *** 93,98 **** "ctime() -- convert time in seconds to string\n"+ "mktime() -- convert local time tuple to seconds since Epoch\n"+ ! "strftime() -- convert time tuple to string according to format specification\n"+ ! "strptime() -- parse string to time tuple according to format specification\n" ); --- 99,106 ---- "ctime() -- convert time in seconds to string\n"+ "mktime() -- convert local time tuple to seconds since Epoch\n"+ ! "strftime() -- convert time tuple to string according to "+ ! "format specification\n"+ ! "strptime() -- parse string to time tuple according to "+ ! "format specification\n" ); *************** *** 578,582 **** } ! private static String getDisplayName(TimeZone tz, boolean dst, int style) { String version = System.getProperty("java.version"); if (version.compareTo("1.2") >= 0) { --- 586,592 ---- } ! private static String getDisplayName(TimeZone tz, boolean dst, ! int style) ! { String version = System.getProperty("java.version"); if (version.compareTo("1.2") >= 0) { Index: types.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/modules/types.java,v retrieving revision 2.6 retrieving revision 2.7 diff -C2 -d -r2.6 -r2.7 *** types.java 2001/10/28 17:13:44 2.6 --- types.java 2001/11/27 19:07:22 2.7 *************** *** 5,11 **** public class types implements ClassDictInit { public static PyString __doc__ = new PyString( ! "Define names for all type symbols known in the standard interpreter.\n"+ "\n"+ ! "Types that are part of optional modules (e.g. array) are not listed.\n" ); --- 5,13 ---- public class types implements ClassDictInit { public static PyString __doc__ = new PyString( ! "Define names for all type symbols known in the standard "+ ! "interpreter.\n"+ "\n"+ ! "Types that are part of optional modules (e.g. array) "+ ! "are not listed.\n" ); |
From: Finn B. <bc...@us...> - 2001-11-27 19:07:24
|
Update of /cvsroot/jython/jython/org/python/core In directory usw-pr-cvs1:/tmp/cvs-serv31804/core Modified Files: CompilerFlags.java InternalTables.java Py.java PyClass.java PyCode.java PyFrame.java PyFunction.java PyString.java PySystemState.java PyTableCode.java __builtin__.java exceptions.java imp.java parser.java Log Message: Long line normalization. Index: CompilerFlags.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/core/CompilerFlags.java,v retrieving revision 2.3 retrieving revision 2.4 diff -C2 -d -r2.3 -r2.4 *** CompilerFlags.java 2001/11/27 13:51:37 2.3 --- CompilerFlags.java 2001/11/27 19:07:21 2.4 *************** *** 7,11 **** public CompilerFlags(int co_flags) { ! if ((co_flags&org.python.core.PyTableCode.CO_NESTED) != 0) nested_scopes = true; } --- 7,12 ---- public CompilerFlags(int co_flags) { ! if ((co_flags&org.python.core.PyTableCode.CO_NESTED) != 0) ! nested_scopes = true; } Index: InternalTables.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/core/InternalTables.java,v retrieving revision 2.10 retrieving revision 2.11 diff -C2 -d -r2.10 -r2.11 *** InternalTables.java 2001/11/27 13:51:37 2.10 --- InternalTables.java 2001/11/27 19:07:21 2.11 *************** *** 46,51 **** java.util.Properties registry = PySystemState.registry; if (registry == null) { ! throw new java.lang.IllegalStateException("Jython interpreter state not initialized. " ! + "You need to call PySystemState.initialize or PythonInterpreter.initialize."); } String cands = registry.getProperty( --- 46,53 ---- java.util.Properties registry = PySystemState.registry; if (registry == null) { ! throw new java.lang.IllegalStateException( ! "Jython interpreter state not initialized. " + ! "You need to call PySystemState.initialize or " + ! "PythonInterpreter.initialize."); } String cands = registry.getProperty( Index: Py.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/core/Py.java,v retrieving revision 2.57 retrieving revision 2.58 diff -C2 -d -r2.57 -r2.58 *** Py.java 2001/11/27 13:51:37 2.57 --- Py.java 2001/11/27 19:07:21 2.58 *************** *** 277,281 **** } ! public static void warning(PyObject category, String message,String filename,int lineno, String module, PyObject registry) { PyObject func = null; PyObject mod = importWarnings(); --- 277,284 ---- } ! public static void warning(PyObject category, String message, ! String filename, int lineno, String module, ! PyObject registry) ! { PyObject func = null; PyObject mod = importWarnings(); *************** *** 283,292 **** func = mod.__getattr__("warn_explicit"); if (func == null) { ! System.err.println(filename + ":" + lineno + ":" + warn_hcategory(category) + ": " + message); return; } else { ! func.__call__(new PyObject[] {Py.newString(message), category, Py.newString(filename), Py.newInteger(lineno), ! (module == null)?Py.None:Py.newString(module), registry}, Py.NoKeywords); } } --- 286,298 ---- func = mod.__getattr__("warn_explicit"); if (func == null) { ! System.err.println(filename + ":" + lineno + ":" + ! warn_hcategory(category) + ": " + message); return; } else { ! func.__call__(new PyObject[] { ! Py.newString(message), category, Py.newString(filename), Py.newInteger(lineno), ! (module == null) ? Py.None : Py.newString(module), ! registry}, Py.NoKeywords); } } *************** *** 434,438 **** } ! // nested scopes: String[] cellvars,String[] freevars,int npurecell & int moreflags public static PyCode newCode(int argcount, String varnames[], --- 440,445 ---- } ! // nested scopes: ! // String[] cellvars,String[] freevars,int npurecell & int moreflags public static PyCode newCode(int argcount, String varnames[], *************** *** 440,448 **** boolean args, boolean keywords, PyFunctionTable funcs, int func_id, ! String[] cellvars,String[] freevars,int npurecell,int moreflags) { return new PyTableCode(argcount, varnames, filename, name, 0, args, keywords, funcs, ! func_id, cellvars, freevars, npurecell,moreflags); } --- 447,457 ---- boolean args, boolean keywords, PyFunctionTable funcs, int func_id, ! String[] cellvars,String[] freevars, ! int npurecell, int moreflags) { return new PyTableCode(argcount, varnames, filename, name, 0, args, keywords, funcs, ! func_id, cellvars, freevars, npurecell, ! moreflags); } *************** *** 452,461 **** boolean args, boolean keywords, PyFunctionTable funcs, int func_id, ! String[] cellvars,String[] freevars,int npurecell,int moreflags) { return new PyTableCode(argcount, varnames, filename, name, firstlineno, args, keywords, ! funcs, func_id, cellvars, freevars, npurecell,moreflags); } --- 461,472 ---- boolean args, boolean keywords, PyFunctionTable funcs, int func_id, ! String[] cellvars,String[] freevars, ! int npurecell, int moreflags) { return new PyTableCode(argcount, varnames, filename, name, firstlineno, args, keywords, ! funcs, func_id, cellvars, freevars, npurecell, ! moreflags); } *************** *** 809,813 **** code = ((PyRunnable)mainClass.newInstance()).getMain(); } catch (Throwable t) { ! System.err.println("Invalid class: "+mainClass.getName()+"$py"); System.exit(-1); } --- 820,825 ---- code = ((PyRunnable)mainClass.newInstance()).getMain(); } catch (Throwable t) { ! System.err.println("Invalid class: " + mainClass.getName() + ! "$py"); System.exit(-1); } *************** *** 1126,1130 **** throw Py.TypeError( "exec: argument 1 must be string, code or file object"); ! code = Py.compile_flags(contents, "<string>", "exec",Py.getCompilerFlags()); } Py.runCode(code, locals, globals); --- 1138,1143 ---- throw Py.TypeError( "exec: argument 1 must be string, code or file object"); ! code = Py.compile_flags(contents, "<string>", "exec", ! Py.getCompilerFlags()); } Py.runCode(code, locals, globals); *************** *** 1406,1410 **** public static PyObject makeClass(String name, PyObject[] bases, ! PyCode code, PyObject doc,PyObject[] closure_cells) { return makeClass(name, bases, code, doc, null, closure_cells); --- 1419,1424 ---- public static PyObject makeClass(String name, PyObject[] bases, ! PyCode code, PyObject doc, ! PyObject[] closure_cells) { return makeClass(name, bases, code, doc, null, closure_cells); *************** *** 1419,1427 **** ! private static Class[] pyClassCtrSignature = {String.class,PyTuple.class,PyObject.class,Class.class}; public static PyObject makeClass(String name, PyObject[] bases, PyCode code, PyObject doc, ! Class proxyClass,PyObject[] closure_cells) { PyFrame frame = getFrame(); --- 1433,1444 ---- ! private static Class[] pyClassCtrSignature = { ! String.class, PyTuple.class, PyObject.class, Class.class ! }; public static PyObject makeClass(String name, PyObject[] bases, PyCode code, PyObject doc, ! Class proxyClass, ! PyObject[] closure_cells) { PyFrame frame = getFrame(); *************** *** 1429,1433 **** PyObject dict = code.call(Py.EmptyObjects, Py.NoKeywords, ! globals, Py.EmptyObjects,new PyTuple(closure_cells)); if (doc != null) dict.__setitem__("__doc__", doc); --- 1446,1451 ---- PyObject dict = code.call(Py.EmptyObjects, Py.NoKeywords, ! globals, Py.EmptyObjects, ! new PyTuple(closure_cells)); if (doc != null) dict.__setitem__("__doc__", doc); *************** *** 1450,1457 **** // experimental PyMetaClass hook try { ! return (PyObject)bases[i].getClass().getConstructor(pyClassCtrSignature).newInstance( ! new Object[] { name, new PyTuple(bases), dict, proxyClass }); } catch(Exception e) { ! throw Py.TypeError("meta-class fails to supply proper ctr: "+bases[i].safeRepr()); } } --- 1468,1478 ---- // experimental PyMetaClass hook try { ! java.lang.reflect.Constructor ctor = bases[i].getClass(). ! getConstructor(pyClassCtrSignature); ! return (PyObject) ctor.newInstance(new Object[] { ! name, new PyTuple(bases), dict, proxyClass }); } catch(Exception e) { ! throw Py.TypeError("meta-class fails to supply proper " + ! "ctr: " + bases[i].safeRepr()); } } *************** *** 1496,1500 **** boolean printResults) { ! return compile_flags(node,name,filename,linenumbers,printResults,null); } --- 1517,1522 ---- boolean printResults) { ! return compile_flags(node, name, filename, linenumbers, ! printResults, null); } *************** *** 1533,1541 **** if (type.equals("single")) printResults = true; ! return Py.compile_flags(node, getName(), filename, true, printResults,cflags); } ! public static PyCode compile_flags(String data, String filename, String type,CompilerFlags cflags) { ! return Py.compile_flags(new java.io.StringBufferInputStream(data+"\n\n"), filename, type,cflags); } --- 1555,1567 ---- if (type.equals("single")) printResults = true; ! return Py.compile_flags(node, getName(), filename, true, printResults, ! cflags); } ! public static PyCode compile_flags(String data, String filename, ! String type,CompilerFlags cflags) ! { ! return Py.compile_flags( ! new java.io.StringBufferInputStream(data+"\n\n"), filename, type,cflags); } *************** *** 1587,1591 **** public static void printResult(PyObject ret) { Py.getThreadState().systemState.invoke("displayhook", ret); - //Py.getThreadState().systemState.__dict__.__finditem__("displayhook").__call__(ret); } --- 1613,1616 ---- *************** *** 1690,1706 **** public PyObject call(PyObject args[], String keywords[], ! PyObject globals, PyObject[] defaults, PyObject closure) { return func.__call__(args, keywords); } ! public PyObject call(PyObject self, PyObject args[], ! String keywords[], ! PyObject globals, PyObject[] defaults, PyObject closure) { return func.__call__(self, args, keywords); } ! public PyObject call(PyObject globals, PyObject[] defaults, PyObject closure) { return func.__call__(); --- 1715,1733 ---- public PyObject call(PyObject args[], String keywords[], ! PyObject globals, PyObject[] defaults, ! PyObject closure) { return func.__call__(args, keywords); } ! public PyObject call(PyObject self, PyObject args[], String keywords[], ! PyObject globals, PyObject[] defaults, ! PyObject closure) { return func.__call__(self, args, keywords); } ! public PyObject call(PyObject globals, PyObject[] defaults, ! PyObject closure) { return func.__call__(); *************** *** 1708,1718 **** public PyObject call(PyObject arg1, PyObject globals, ! PyObject[] defaults, PyObject closure) { return func.__call__(arg1); } ! public PyObject call(PyObject arg1, PyObject arg2, ! PyObject globals, PyObject[] defaults, PyObject closure) { return func.__call__(arg1, arg2); --- 1735,1745 ---- public PyObject call(PyObject arg1, PyObject globals, ! PyObject[] defaults, PyObject closure) { return func.__call__(arg1); } ! public PyObject call(PyObject arg1, PyObject arg2, PyObject globals, ! PyObject[] defaults, PyObject closure) { return func.__call__(arg1, arg2); *************** *** 1720,1724 **** public PyObject call(PyObject arg1, PyObject arg2, PyObject arg3, ! PyObject globals, PyObject[] defaults, PyObject closure) { return func.__call__(arg1, arg2, arg3); --- 1747,1752 ---- public PyObject call(PyObject arg1, PyObject arg2, PyObject arg3, ! PyObject globals, PyObject[] defaults, ! PyObject closure) { return func.__call__(arg1, arg2, arg3); Index: PyClass.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/core/PyClass.java,v retrieving revision 2.27 retrieving revision 2.28 diff -C2 -d -r2.27 -r2.28 *** PyClass.java 2001/11/27 13:51:37 2.27 --- PyClass.java 2001/11/27 19:07:21 2.28 *************** *** 134,138 **** if (snames != null) { PyObject sname; ! for (int i = 0; (sname = snames.__finditem__(i)) != null; i++) { if (__dict__.__finditem__(sname) == null) { PyObject superFunc = superDict.__finditem__(sname); --- 134,139 ---- if (snames != null) { PyObject sname; ! int i; ! for (i = 0; (sname = snames.__finditem__(i)) != null; i++) { if (__dict__.__finditem__(sname) == null) { PyObject superFunc = superDict.__finditem__(sname); Index: PyCode.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/core/PyCode.java,v retrieving revision 2.7 retrieving revision 2.8 diff -C2 -d -r2.7 -r2.8 *** PyCode.java 2001/11/27 13:51:37 2.7 --- PyCode.java 2001/11/27 19:07:21 2.8 *************** *** 11,24 **** abstract public PyObject call(PyFrame frame, PyObject closure); ! public PyObject call(PyFrame frame) { return call(frame,null); } // commodity abstract public PyObject call(PyObject args[], String keywords[], ! PyObject globals, PyObject[] defaults, PyObject closure); abstract public PyObject call(PyObject self, PyObject args[], String keywords[], ! PyObject globals, PyObject[] defaults,PyObject closure); ! abstract public PyObject call(PyObject globals, PyObject[] defaults, PyObject closure); abstract public PyObject call(PyObject arg1, PyObject globals, --- 11,29 ---- abstract public PyObject call(PyFrame frame, PyObject closure); ! public PyObject call(PyFrame frame) { ! return call(frame, null); ! } abstract public PyObject call(PyObject args[], String keywords[], ! PyObject globals, PyObject[] defaults, ! PyObject closure); abstract public PyObject call(PyObject self, PyObject args[], String keywords[], ! PyObject globals, PyObject[] defaults, ! PyObject closure); ! abstract public PyObject call(PyObject globals, PyObject[] defaults, ! PyObject closure); abstract public PyObject call(PyObject arg1, PyObject globals, *************** *** 26,33 **** abstract public PyObject call(PyObject arg1, PyObject arg2, ! PyObject globals, PyObject[] defaults, PyObject closure); abstract public PyObject call(PyObject arg1, PyObject arg2, PyObject arg3, ! PyObject globals, PyObject[] defaults, PyObject closure); } --- 31,40 ---- abstract public PyObject call(PyObject arg1, PyObject arg2, ! PyObject globals, PyObject[] defaults, ! PyObject closure); abstract public PyObject call(PyObject arg1, PyObject arg2, PyObject arg3, ! PyObject globals, PyObject[] defaults, ! PyObject closure); } Index: PyFrame.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/core/PyFrame.java,v retrieving revision 2.12 retrieving revision 2.13 diff -C2 -d -r2.12 -r2.13 *** PyFrame.java 2001/11/27 13:51:37 2.12 --- PyFrame.java 2001/11/27 19:07:21 2.13 *************** *** 40,52 **** // This needs work to be efficient with multiple interpreter states if (locals == null && code != null) { ! if ((code.co_flags&PyTableCode.CO_OPTIMIZED)!=0 || code.nargs > 0) { // ! f_fastlocals needed for arg passing too ! if (code.co_nlocals>0) f_fastlocals = new PyObject[code.co_nlocals-code.jy_npurecell]; // internal: may change ! } else f_locals = new PyStringMap(); } if (code != null) { // reserve space for env int env_sz = 0; ! if (code.co_freevars != null) env_sz += (f_nfreevars = code.co_freevars.length); ! if (code.co_cellvars != null) env_sz += (f_ncells = code.co_cellvars.length); ! if (env_sz > 0) f_env = new PyCell[env_sz]; } } --- 40,62 ---- // This needs work to be efficient with multiple interpreter states if (locals == null && code != null) { ! // ! f_fastlocals needed for arg passing too ! if ((code.co_flags&PyTableCode.CO_OPTIMIZED)!=0 || ! code.nargs > 0) { ! if (code.co_nlocals > 0) { ! // internal: may change ! f_fastlocals = new PyObject[ ! code.co_nlocals-code.jy_npurecell]; ! } ! } else ! f_locals = new PyStringMap(); } if (code != null) { // reserve space for env int env_sz = 0; ! if (code.co_freevars != null) ! env_sz += (f_nfreevars = code.co_freevars.length); ! if (code.co_cellvars != null) ! env_sz += (f_ncells = code.co_cellvars.length); ! if (env_sz > 0) ! f_env = new PyCell[env_sz]; } } *************** *** 119,125 **** for (i=0; i<f_fastlocals.length; i++) { PyObject o = f_fastlocals[i]; ! if (o != null) f_locals.__setitem__(f_code.co_varnames[i], o); } ! if ((f_code.co_flags&PyTableCode.CO_OPTIMIZED) == 0) f_fastlocals = null; } int j = 0; --- 129,137 ---- for (i=0; i<f_fastlocals.length; i++) { PyObject o = f_fastlocals[i]; ! if (o != null) ! f_locals.__setitem__(f_code.co_varnames[i], o); } ! if ((f_code.co_flags&PyTableCode.CO_OPTIMIZED) == 0) ! f_fastlocals = null; } int j = 0; *************** *** 212,216 **** if (f_fastlocals != null) { if (f_fastlocals[index] == null) { ! throw Py.UnboundLocalError("local: '"+f_code.co_varnames[index]+"'"); } f_fastlocals[index] = null; --- 224,229 ---- if (f_fastlocals != null) { if (f_fastlocals[index] == null) { ! throw Py.UnboundLocalError("local: '"+ ! f_code.co_varnames[index]+"'"); } f_fastlocals[index] = null; Index: PyFunction.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/core/PyFunction.java,v retrieving revision 2.13 retrieving revision 2.14 diff -C2 -d -r2.13 -r2.14 *** PyFunction.java 2001/11/27 13:51:37 2.13 --- PyFunction.java 2001/11/27 19:07:21 2.14 *************** *** 43,47 **** } ! public PyFunction(PyObject globals, PyObject[] defaults, PyCode code, PyObject[] closure_cells) { this(globals, defaults, code, null,closure_cells); } --- 43,49 ---- } ! public PyFunction(PyObject globals, PyObject[] defaults, PyCode code, ! PyObject[] closure_cells) ! { this(globals, defaults, code, null,closure_cells); } *************** *** 171,182 **** } public PyObject __call__(PyObject arg1, PyObject arg2) { ! return func_code.call(arg1, arg2, func_globals, func_defaults, func_closure); } public PyObject __call__(PyObject arg1, PyObject arg2, PyObject arg3) { ! return func_code.call(arg1, arg2, arg3, func_globals, func_defaults, func_closure); } public PyObject __call__(PyObject[] args, String[] keywords) { ! return func_code.call(args, keywords, func_globals, func_defaults, func_closure); } public PyObject __call__(PyObject arg1, PyObject[] args, --- 173,187 ---- } public PyObject __call__(PyObject arg1, PyObject arg2) { ! return func_code.call(arg1, arg2, func_globals, func_defaults, ! func_closure); } public PyObject __call__(PyObject arg1, PyObject arg2, PyObject arg3) { ! return func_code.call(arg1, arg2, arg3, func_globals, func_defaults, ! func_closure); } public PyObject __call__(PyObject[] args, String[] keywords) { ! return func_code.call(args, keywords, func_globals, func_defaults, ! func_closure); } public PyObject __call__(PyObject arg1, PyObject[] args, Index: PyString.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/core/PyString.java,v retrieving revision 2.51 retrieving revision 2.52 diff -C2 -d -r2.51 -r2.52 *** PyString.java 2001/11/27 11:18:04 2.51 --- PyString.java 2001/11/27 19:07:21 2.52 *************** *** 1258,1262 **** if (base == 0 || base == 16) { if (string.charAt(b) == '0') { ! if (b < e-1 && (string.charAt(b+1) == 'x' || string.charAt(b+1) == 'X')) { base = 16; b += 2; --- 1258,1263 ---- if (base == 0 || base == 16) { if (string.charAt(b) == '0') { ! if (b < e-1 && ! Character.toUpperCase(string.charAt(b+1)) == 'X') { base = 16; b += 2; *************** *** 1320,1324 **** if (base == 0 || base == 16) { if (string.charAt(b) == '0') { ! if (b < e-1 && (string.charAt(b+1) == 'x' || string.charAt(b+1) == 'X')) { base = 16; b += 2; --- 1321,1326 ---- if (base == 0 || base == 16) { if (string.charAt(b) == '0') { ! if (b < e-1 && ! Character.toUpperCase(string.charAt(b+1)) == 'X') { base = 16; b += 2; Index: PySystemState.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/core/PySystemState.java,v retrieving revision 2.67 retrieving revision 2.68 diff -C2 -d -r2.67 -r2.68 *** PySystemState.java 2001/11/27 13:51:37 2.67 --- PySystemState.java 2001/11/27 19:07:21 2.68 *************** *** 645,649 **** } catch (PyException exc) { if (!Py.matchException(exc, Py.SystemExit)) { ! Py.println(stderr, Py.newString("Error in sys.exitfunc:")); } Py.printException(exc); --- 645,650 ---- } catch (PyException exc) { if (!Py.matchException(exc, Py.SystemExit)) { ! Py.println(stderr, ! Py.newString("Error in sys.exitfunc:")); } Py.printException(exc); Index: PyTableCode.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/core/PyTableCode.java,v retrieving revision 2.17 retrieving revision 2.18 diff -C2 -d -r2.17 -r2.18 *** PyTableCode.java 2001/11/27 13:51:37 2.17 --- PyTableCode.java 2001/11/27 19:07:21 2.18 *************** *** 36,40 **** PyFunctionTable funcs, int func_id) { ! this(argcount,varnames,filename,name,firstlineno,args,keywords,funcs,func_id,null,null,0,0); } --- 36,41 ---- PyFunctionTable funcs, int func_id) { ! this(argcount, varnames, filename, name, firstlineno, args, ! keywords, funcs, func_id, null, null, 0, 0); } *************** *** 44,48 **** boolean args, boolean keywords, PyFunctionTable funcs, int func_id, ! String[] cellvars,String[] freevars,int npurecell,int moreflags) // may change { co_argcount = nargs = argcount; --- 45,50 ---- boolean args, boolean keywords, PyFunctionTable funcs, int func_id, ! String[] cellvars, String[] freevars, int npurecell, ! int moreflags) // may change { co_argcount = nargs = argcount; *************** *** 245,256 **** } ! public PyObject call(PyObject globals, PyObject[] defaults, PyObject closure) { if (co_argcount != 0 || args || keywords) ! return call(Py.EmptyObjects, Py.NoKeywords, globals, defaults, closure); PyFrame frame = new PyFrame(this, globals); return call(frame, closure); } ! public PyObject call(PyObject arg1, PyObject globals, PyObject[] defaults, PyObject closure) { if (co_argcount != 1 || args || keywords) --- 247,262 ---- } ! public PyObject call(PyObject globals, PyObject[] defaults, ! PyObject closure) ! { if (co_argcount != 0 || args || keywords) ! return call(Py.EmptyObjects, Py.NoKeywords, globals, defaults, ! closure); PyFrame frame = new PyFrame(this, globals); return call(frame, closure); } ! public PyObject call(PyObject arg1, PyObject globals, PyObject[] defaults, ! PyObject closure) { if (co_argcount != 1 || args || keywords) *************** *** 275,279 **** public PyObject call(PyObject arg1, PyObject arg2, PyObject arg3, ! PyObject globals, PyObject[] defaults, PyObject closure) { if (co_argcount != 3 || args || keywords) --- 281,286 ---- public PyObject call(PyObject arg1, PyObject arg2, PyObject arg3, ! PyObject globals, PyObject[] defaults, ! PyObject closure) { if (co_argcount != 3 || args || keywords) *************** *** 302,306 **** public PyObject call(PyObject call_args[], String call_keywords[], ! PyObject globals, PyObject[] defaults, PyObject closure) { //Needs try except finally blocks --- 309,314 ---- public PyObject call(PyObject call_args[], String call_keywords[], ! PyObject globals, PyObject[] defaults, ! PyObject closure) { //Needs try except finally blocks Index: __builtin__.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/core/__builtin__.java,v retrieving revision 2.38 retrieving revision 2.39 diff -C2 -d -r2.38 -r2.39 *** __builtin__.java 2001/11/27 13:51:37 2.38 --- __builtin__.java 2001/11/27 19:07:21 2.39 *************** *** 259,266 **** code = (PyCode)o; else { ! if (o instanceof PyString) code = Py.compile_flags(((PyString)o).toString(), ! "<string>", "eval",null); // eval does not inherit co_nested ! else throw Py.TypeError( "eval: argument 1 must be string or code object"); --- 259,267 ---- code = (PyCode)o; else { ! if (o instanceof PyString) { ! // eval does not inherit co_nested code = Py.compile_flags(((PyString)o).toString(), ! "<string>", "eval", null); ! } else throw Py.TypeError( "eval: argument 1 must be string or code object"); *************** *** 862,866 **** public static PyClass type(PyObject o) { if (o instanceof PyInstance) { ! return PyJavaClass.lookup(o.getClass()); // was just PyInstance.class, goes with experimental PyMetaClass hook } else { return o.__class__; --- 863,869 ---- public static PyClass type(PyObject o) { if (o instanceof PyInstance) { ! // was just PyInstance.class, goes with experimental ! // PyMetaClass hook ! return PyJavaClass.lookup(o.getClass()); } else { return o.__class__; Index: exceptions.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/core/exceptions.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** exceptions.java 2001/07/19 07:12:57 1.9 --- exceptions.java 2001/11/27 19:07:21 1.10 *************** *** 310,314 **** PyObject lineno = self.__findattr__("lineno"); if (filename instanceof PyString && lineno instanceof PyInteger) ! return new PyString(str + " (" + filename + ", line " + lineno + ")"); else if (filename instanceof PyString) return new PyString(str + " (" + filename + ")"); --- 310,315 ---- PyObject lineno = self.__findattr__("lineno"); if (filename instanceof PyString && lineno instanceof PyInteger) ! return new PyString(str + " (" + filename + ", line " + ! lineno + ")"); else if (filename instanceof PyString) return new PyString(str + " (" + filename + ")"); Index: imp.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/core/imp.java,v retrieving revision 2.56 retrieving revision 2.57 diff -C2 -d -r2.56 -r2.57 *** imp.java 2001/11/27 13:51:37 2.56 --- imp.java 2001/11/27 19:07:21 2.57 *************** *** 127,131 **** } org.python.compiler.Module.compile(node, ofp, name+"$py", ! filename, true, false, true,null); if (outFilename != null) { --- 127,132 ---- } org.python.compiler.Module.compile(node, ofp, name+"$py", ! filename, true, false, true, ! null); if (outFilename != null) { *************** *** 319,323 **** long classTime = classEntry.getTime(); if (classTime >= pyTime) { ! InputStream is = zipArchive.getInputStream(classEntry); o = createFromPyClass(modName, is, true, classEntry.getName()); --- 320,325 ---- long classTime = classEntry.getTime(); if (classTime >= pyTime) { ! InputStream is = ! zipArchive.getInputStream(classEntry); o = createFromPyClass(modName, is, true, classEntry.getName()); *************** *** 418,422 **** if (pyFile.isFile() && caseok(pyFile, pyName, nlen)) { ! if (classFile.isFile() && caseok(classFile, className, nlen)) { Py.writeDebug("import", "trying precompiled " + classFile.getPath()); --- 420,425 ---- if (pyFile.isFile() && caseok(pyFile, pyName, nlen)) { ! if (classFile.isFile() && ! caseok(classFile, className, nlen)) { Py.writeDebug("import", "trying precompiled " + classFile.getPath()); *************** *** 495,499 **** } ! Py.writeComment("import", "'" + name + "' not found (=> ImportError)"); return null; } --- 498,503 ---- } ! Py.writeComment("import", "'" + name + ! "' not found (=> ImportError)"); return null; } *************** *** 519,523 **** // can return null, None ! private static PyObject import_next(PyObject mod, StringBuffer parentNameBuffer, String name) { if (parentNameBuffer.length()>0) parentNameBuffer.append('.'); parentNameBuffer.append(name); --- 523,530 ---- // can return null, None ! private static PyObject import_next(PyObject mod, ! StringBuffer parentNameBuffer, ! String name) ! { if (parentNameBuffer.length()>0) parentNameBuffer.append('.'); parentNameBuffer.append(name); *************** *** 527,550 **** if (ret != null) return ret; if (mod == null) { ! ret = load(name.intern(), Py.getSystemState().path); // ?? intern superfluous? } else { ret = mod.impAttr(name.intern()); } if (ret == null || ret == Py.None) return ret; ! if (modules.__finditem__(fullName) == null) modules.__setitem__(fullName, ret); ! else ret = modules.__finditem__(fullName); return ret; } // never returns null or None ! private static PyObject import_first(String name, StringBuffer parentNameBuffer) { PyObject ret = import_next(null,parentNameBuffer,name); ! if (ret == null || ret == Py.None) throw Py.ImportError("no module named "+name); return ret; } ! // Hierarchy-recursively search for dotted name in mod; never returns null or None // ??pending: check if result is really a module/jpkg/jclass? ! private static PyObject import_logic(PyObject mod, StringBuffer parentNameBuffer, String dottedName) { int dot = 0; int last_dot= 0; --- 534,567 ---- if (ret != null) return ret; if (mod == null) { ! // ?? intern superfluous? ! ret = load(name.intern(), Py.getSystemState().path); } else { ret = mod.impAttr(name.intern()); } if (ret == null || ret == Py.None) return ret; ! if (modules.__finditem__(fullName) == null) ! modules.__setitem__(fullName, ret); ! else ! ret = modules.__finditem__(fullName); return ret; } // never returns null or None ! private static PyObject import_first(String name, ! StringBuffer parentNameBuffer) ! { PyObject ret = import_next(null,parentNameBuffer,name); ! if (ret == null || ret == Py.None) ! throw Py.ImportError("no module named "+name); return ret; } ! // Hierarchy-recursively search for dotted name in mod; ! // never returns null or None // ??pending: check if result is really a module/jpkg/jclass? ! private static PyObject import_logic(PyObject mod, ! StringBuffer parentNameBuffer, ! String dottedName) ! { int dot = 0; int last_dot= 0; *************** *** 567,573 **** } ! public static PyObject import_name(String name,boolean top,PyObject modDict) { if (name.length() == 0) ! throw Py.ValueError("Empty module name"); PyObject modules = Py.getSystemState().modules; PyObject pkgMod = null; --- 584,592 ---- } ! public static PyObject import_name(String name, boolean top, ! PyObject modDict) ! { if (name.length() == 0) ! throw Py.ValueError("Empty module name"); PyObject modules = Py.getSystemState().modules; PyObject pkgMod = null; *************** *** 576,598 **** pkgName = getParent(modDict); pkgMod = modules.__finditem__(pkgName); ! if (pkgMod != null && !(pkgMod instanceof PyModule)) pkgMod = null; } int dot = name.indexOf('.'); String firstName; ! if (dot == -1) firstName = name; ! else firstName = name.substring(0,dot); ! StringBuffer parentNameBuffer = new StringBuffer(pkgMod != null?pkgName:""); ! PyObject topMod = import_next(pkgMod,parentNameBuffer,firstName); // None or null or module-like if (topMod == Py.None || topMod == null) { if (topMod == null) { ! modules.__setitem__(parentNameBuffer.toString().intern(),Py.None); } parentNameBuffer = new StringBuffer(""); ! topMod = import_first(firstName,parentNameBuffer); // could throw ImportError } PyObject mod = topMod; ! if (dot != -1) mod = import_logic(topMod,parentNameBuffer,name.substring(dot+1)); // could throw ImportError ! if (top) return topMod; ! else return mod; } --- 595,628 ---- pkgName = getParent(modDict); pkgMod = modules.__finditem__(pkgName); ! if (pkgMod != null && !(pkgMod instanceof PyModule)) ! pkgMod = null; } int dot = name.indexOf('.'); String firstName; ! if (dot == -1) ! firstName = name; ! else ! firstName = name.substring(0,dot); ! StringBuffer parentNameBuffer = new StringBuffer( ! pkgMod != null ? pkgName : ""); ! PyObject topMod = import_next(pkgMod, parentNameBuffer, firstName); if (topMod == Py.None || topMod == null) { if (topMod == null) { ! modules.__setitem__(parentNameBuffer.toString().intern(), ! Py.None); } parentNameBuffer = new StringBuffer(""); ! // could throw ImportError ! topMod = import_first(firstName,parentNameBuffer); } PyObject mod = topMod; ! if (dot != -1) { ! // could throw ImportError ! mod = import_logic(topMod,parentNameBuffer,name.substring(dot+1)); ! } ! if (top) ! return topMod; ! else ! return mod; } *************** *** 642,646 **** * "from spam.eggs import foo, bar" is executed. */ ! public static PyObject[] importFrom(String mod, String[] names, PyFrame frame) { return importFromAs(mod, names, null, frame); } --- 672,678 ---- * "from spam.eggs import foo, bar" is executed. */ ! public static PyObject[] importFrom(String mod, String[] names, ! PyFrame frame) ! { return importFromAs(mod, names, null, frame); } Index: parser.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/core/parser.java,v retrieving revision 2.13 retrieving revision 2.14 diff -C2 -d -r2.13 -r2.14 *** parser.java 2001/11/27 13:51:37 2.13 --- parser.java 2001/11/27 19:07:21 2.14 *************** *** 27,32 **** } ! static public PyException fixParseError(BufferedReader reader, Throwable t, ! String filename) { return fixParseError(reader, t, filename, false); --- 27,33 ---- } ! static public PyException fixParseError(BufferedReader reader, ! Throwable t, ! String filename) { return fixParseError(reader, t, filename, false); |
From: Finn B. <bc...@us...> - 2001-11-27 19:07:24
|
Update of /cvsroot/jython/jython/org/python/compiler In directory usw-pr-cvs1:/tmp/cvs-serv31804/compiler Modified Files: ArgListCompiler.java Code.java CodeCompiler.java CompilationContext.java Future.java JavaMaker.java Label.java Module.java ProxyMaker.java ScopeInfo.java ScopesCompiler.java Log Message: Long line normalization. Index: ArgListCompiler.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/compiler/ArgListCompiler.java,v retrieving revision 2.7 retrieving revision 2.8 diff -C2 -d -r2.7 -r2.8 *** ArgListCompiler.java 2001/11/27 13:51:37 2.7 --- ArgListCompiler.java 2001/11/27 19:07:21 2.8 *************** *** 9,12 **** --- 9,13 ---- public class ArgListCompiler extends org.python.parser.Visitor + implements PythonGrammarTreeConstants { public boolean arglist, keywordlist; *************** *** 19,23 **** defaults = new Vector(); names = new Vector(); ! init_code = new SimpleNode(PythonGrammarTreeConstants.JJTSUITE); } --- 20,24 ---- defaults = new Vector(); names = new Vector(); ! init_code = new SimpleNode(JJTSUITE); } *************** *** 69,79 **** //Handle tuple arguments properly ! if (node.getChild(0).id == PythonGrammarTreeConstants.JJTFPLIST) { ! SimpleNode expr = new SimpleNode( ! PythonGrammarTreeConstants.JJTEXPR_STMT); // Set the right line number for this expr expr.beginLine = node.beginLine; expr.jjtAddChild(node.getChild(0), 0); ! SimpleNode nm = new SimpleNode(PythonGrammarTreeConstants.JJTNAME); nm.setInfo(name); expr.jjtAddChild(nm, 1); --- 70,79 ---- //Handle tuple arguments properly ! if (node.getChild(0).id == JJTFPLIST) { ! SimpleNode expr = new SimpleNode(JJTEXPR_STMT); // Set the right line number for this expr expr.beginLine = node.beginLine; expr.jjtAddChild(node.getChild(0), 0); ! SimpleNode nm = new SimpleNode(JJTNAME); nm.setInfo(name); expr.jjtAddChild(nm, 1); Index: Code.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/compiler/Code.java,v retrieving revision 2.5 retrieving revision 2.6 diff -C2 -d -r2.5 -r2.6 *** Code.java 2001/11/27 13:51:37 2.5 --- Code.java 2001/11/27 19:07:21 2.6 *************** *** 149,153 **** } if (linenumbers != null) ! ClassFile.writeAttributes(stream, new Attribute[] { linenumbers }); else ClassFile.writeAttributes(stream, new Attribute[0]); --- 149,154 ---- } if (linenumbers != null) ! ClassFile.writeAttributes(stream, ! new Attribute[] { linenumbers }); else ClassFile.writeAttributes(stream, new Attribute[0]); *************** *** 284,288 **** } ! public void getfield(String c, String name, String type) throws IOException { getfield(pool.Fieldref(c, name, type)); } --- 285,291 ---- } ! public void getfield(String c, String name, String type) ! throws IOException ! { getfield(pool.Fieldref(c, name, type)); } *************** *** 294,298 **** } ! public void getstatic(String c, String name, String type) throws IOException { getstatic(pool.Fieldref(c, name, type)); } --- 297,303 ---- } ! public void getstatic(String c, String name, String type) ! throws IOException ! { getstatic(pool.Fieldref(c, name, type)); } Index: CodeCompiler.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/compiler/CodeCompiler.java,v retrieving revision 2.22 retrieving revision 2.23 diff -C2 -d -r2.22 -r2.23 *** CodeCompiler.java 2001/11/27 13:51:37 2.22 --- CodeCompiler.java 2001/11/27 19:07:21 2.23 *************** *** 13,18 **** import java.util.Vector; ! public class CodeCompiler extends Visitor implements CompilationContext { public static final Object Exit=new Integer(1); public static final Object NoExit=null; --- 13,20 ---- import java.util.Vector; ! public class CodeCompiler extends Visitor [...1446 lines suppressed...] --- 2411,2415 ---- mrefs.dellocal1 = code.pool.Methodref( "org/python/core/PyFrame", "dellocal", ! "(" + $str + ")V"); } code.invokevirtual(mrefs.dellocal1); *************** *** 2412,2416 **** } if ((syminf.flags&ScopeInfo.CELL) != 0) { ! error("can not delete variable '"+name+"' referenced in nested scope",true,node); } code.iconst(syminf.locals_index); --- 2419,2424 ---- } if ((syminf.flags&ScopeInfo.CELL) != 0) { ! error("can not delete variable '"+name+ ! "' referenced in nested scope",true,node); } code.iconst(syminf.locals_index); Index: CompilationContext.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/compiler/CompilationContext.java,v retrieving revision 2.2 retrieving revision 2.3 diff -C2 -d -r2.2 -r2.3 *** CompilationContext.java 2001/11/27 13:51:37 2.2 --- CompilationContext.java 2001/11/27 19:07:21 2.3 *************** *** 7,11 **** public Future getFutures(); ! public void error(String msg,boolean err,SimpleNode node) throws Exception; public String getFilename(); --- 7,12 ---- public Future getFutures(); ! public void error(String msg,boolean err,SimpleNode node) ! throws Exception; public String getFilename(); Index: Future.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/compiler/Future.java,v retrieving revision 2.4 retrieving revision 2.5 diff -C2 -d -r2.4 -r2.5 *** Future.java 2001/11/27 13:51:37 2.4 --- Future.java 2001/11/27 19:07:21 2.5 *************** *** 5,9 **** import org.python.parser.*; ! public class Future extends Object { private boolean nested_scopes; --- 5,9 ---- import org.python.parser.*; ! public class Future extends Object implements PythonGrammarTreeConstants { private boolean nested_scopes; *************** *** 14,21 **** SimpleNode dotted_name = cand.getChild(0); if (dotted_name.getNumChildren() != 1 || ! !((String)dotted_name.getChild(0).getInfo()).equals(FUTURE)) return false; int n = cand.getNumChildren(); if (n == 1) { ! throw new ParseException("future statement does not support import *",cand); } for (int i = 1; i < n; i++) { --- 14,23 ---- SimpleNode dotted_name = cand.getChild(0); if (dotted_name.getNumChildren() != 1 || ! !((String)dotted_name.getChild(0).getInfo()).equals(FUTURE)) ! return false; int n = cand.getNumChildren(); if (n == 1) { ! throw new ParseException( ! "future statement does not support import *",cand); } for (int i = 1; i < n; i++) { *************** *** 24,31 **** switch(imp.id) { default: ! case PythonGrammarTreeConstants.JJTNAME: feature = (String)imp.getInfo(); break; ! case PythonGrammarTreeConstants.JJTIMPORT_AS_NAME: feature = (String)imp.getChild(0).getInfo(); break; --- 26,33 ---- switch(imp.id) { default: ! case JJTNAME: feature = (String)imp.getInfo(); break; ! case JJTIMPORT_AS_NAME: feature = (String)imp.getChild(0).getInfo(); break; *************** *** 36,62 **** continue; } ! throw new ParseException("future feature "+feature+" is not defined",cand); } return true; } ! public void preprocessFutures(SimpleNode node,org.python.core.CompilerFlags cflags) throws Exception { if (cflags != null) { nested_scopes = cflags.nested_scopes; } ! if ( node.id != PythonGrammarTreeConstants.JJTFILE_INPUT && ! node.id != PythonGrammarTreeConstants.JJTSINGLE_INPUT) return; int n = node.getNumChildren(); if (n == 0) return; int beg = 0; ! if (node.id == PythonGrammarTreeConstants.JJTFILE_INPUT && ! node.getChild(0).id == PythonGrammarTreeConstants.JJTEXPR_STMT && ! node.getChild(0).getChild(0).id == PythonGrammarTreeConstants.JJTSTRING) beg++; for (int i = beg; i < n; i++) { SimpleNode stmt = node.getChild(i); ! if (stmt.id != PythonGrammarTreeConstants.JJTIMPORTFROM) break; stmt.from_future_checked = true; if (!check(stmt)) break; --- 38,68 ---- continue; } ! throw new ParseException("future feature "+feature+ ! " is not defined",cand); } return true; } ! public void preprocessFutures(SimpleNode node, ! org.python.core.CompilerFlags cflags) ! throws Exception ! { if (cflags != null) { nested_scopes = cflags.nested_scopes; } ! if ( node.id != JJTFILE_INPUT && node.id != JJTSINGLE_INPUT) ! return; int n = node.getNumChildren(); if (n == 0) return; int beg = 0; ! if (node.id == JJTFILE_INPUT && ! node.getChild(0).id == JJTEXPR_STMT && ! node.getChild(0).getChild(0).id == JJTSTRING) beg++; for (int i = beg; i < n; i++) { SimpleNode stmt = node.getChild(i); ! if (stmt.id != JJTIMPORTFROM) break; stmt.from_future_checked = true; if (!check(stmt)) break; *************** *** 72,77 **** if (node.from_future_checked) return; SimpleNode dotted_name = node.getChild(0); ! if (dotted_name.getNumChildren() == 1 && ((String)dotted_name.getChild(0).getInfo()).equals(FUTURE)) { ! throw new ParseException("from __future__ imports must occur at the beginning of the file",node); } node.from_future_checked = true; --- 78,85 ---- if (node.from_future_checked) return; SimpleNode dotted_name = node.getChild(0); ! if (dotted_name.getNumChildren() == 1 && ! ((String)dotted_name.getChild(0).getInfo()).equals(FUTURE)) { ! throw new ParseException("from __future__ imports must occur " + ! "at the beginning of the file",node); } node.from_future_checked = true; Index: JavaMaker.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/compiler/JavaMaker.java,v retrieving revision 2.14 retrieving revision 2.15 diff -C2 -d -r2.14 -r2.15 *** JavaMaker.java 2001/11/27 13:51:37 2.14 --- JavaMaker.java 2001/11/27 19:07:21 2.15 *************** *** 8,12 **** import org.python.core.PyProxy; ! public class JavaMaker extends ProxyMaker { public String pythonClass, pythonModule; --- 8,12 ---- import org.python.core.PyProxy; ! public class JavaMaker extends ProxyMaker implements ClassConstants { public String pythonClass, pythonModule; *************** *** 84,88 **** // _initProxy method ! Code code = classfile.addMethod("__initProxy__", "([Ljava/lang/Object;)V", Modifier.PUBLIC); code.aload(0); --- 84,89 ---- // _initProxy method ! Code code = classfile.addMethod("__initProxy__", ! "([Ljava/lang/Object;)V", Modifier.PUBLIC); code.aload(0); *************** *** 99,103 **** int initProxy = code.pool.Methodref( "org/python/core/Py", "initProxy", ! "(Lorg/python/core/PyProxy;Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Object;[Ljava/lang/String;[Ljava/lang/String;Z)V"); code.invokestatic(initProxy); code.return_(); --- 100,105 ---- int initProxy = code.pool.Methodref( "org/python/core/Py", "initProxy", ! "(" + $pyProxy + $str + $str + $objArr + ! $strArr + $strArr + "Z)V"); code.invokestatic(initProxy); code.return_(); *************** *** 114,118 **** public void addMethod(Method method, int access) throws Exception { ! // System.out.println("add: "+method.getName()+", "+methods.containsKey(method.getName())); // Check to see if it's an abstract method if (Modifier.isAbstract(access)) { --- 116,121 ---- public void addMethod(Method method, int access) throws Exception { ! //System.out.println("add: "+method.getName()+", "+ ! // methods.containsKey(method.getName())); // Check to see if it's an abstract method if (Modifier.isAbstract(access)) { *************** *** 133,137 **** { if (!PyProxy.class.isAssignableFrom(this.superclass)) { ! super.addSuperMethod(methodName,superName,superclass,parameters,ret,sig,access); } } --- 136,141 ---- { if (!PyProxy.class.isAssignableFrom(this.superclass)) { ! super.addSuperMethod(methodName,superName,superclass,parameters, ! ret,sig,access); } } *************** *** 140,150 **** public void addMain() throws Exception { ! Code code = classfile.addMethod("main", "([Ljava/lang/String;)V", ClassFile.PUBLIC | ClassFile.STATIC); // Load the class of the Python module to run int forname = code.pool.Methodref( ! "java/lang/Class","forName", ! "(Ljava/lang/String;)Ljava/lang/Class;"); code.ldc(pythonModule); code.invokestatic(forname); --- 144,153 ---- public void addMain() throws Exception { ! Code code = classfile.addMethod("main", "(" + $str + ")V", ClassFile.PUBLIC | ClassFile.STATIC); // Load the class of the Python module to run int forname = code.pool.Methodref( ! "java/lang/Class","forName", "(" + $str + ")" + $clss); code.ldc(pythonModule); code.invokestatic(forname); *************** *** 158,162 **** int runMain = code.pool.Methodref( "org/python/core/Py", "runMain", ! "(Ljava/lang/Class;[Ljava/lang/String;[Ljava/lang/String;[Ljava/lang/String;Z)V"); code.invokestatic(runMain); code.return_(); --- 161,165 ---- int runMain = code.pool.Methodref( "org/python/core/Py", "runMain", ! "(" + $clss + $strArr + $strArr + $strArr + "Z)V"); code.invokestatic(runMain); code.return_(); Index: Label.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/compiler/Label.java,v retrieving revision 2.3 retrieving revision 2.4 diff -C2 -d -r2.3 -r2.4 *** Label.java 2001/11/27 13:51:37 2.3 --- Label.java 2001/11/27 19:07:21 2.4 *************** *** 31,35 **** for (int i=0; i<noffsets; i++) { ! //System.out.println("o: "+offsets[i]+", "+position+", "+positions[i]); int off = position-offsets[i]; int p = positions[i]; --- 31,36 ---- for (int i=0; i<noffsets; i++) { ! //System.out.println("o: "+offsets[i]+", "+position+", "+ ! // positions[i]); int off = position-offsets[i]; int p = positions[i]; Index: Module.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/compiler/Module.java,v retrieving revision 2.9 retrieving revision 2.10 diff -C2 -d -r2.9 -r2.10 *** Module.java 2001/11/27 13:51:37 2.9 --- Module.java 2001/11/27 19:07:21 2.10 *************** *** 7,11 **** import org.python.parser.*; ! class PyIntegerConstant extends Constant { int value; --- 7,11 ---- import org.python.parser.*; ! class PyIntegerConstant extends Constant implements ClassConstants { int value; *************** *** 16,33 **** public void get(Code c) throws IOException { ! c.getstatic(module.classfile.name, name, ! "Lorg/python/core/PyInteger;"); } public void put(Code c) throws IOException { ! module.classfile.addField(name, "Lorg/python/core/PyInteger;", access); c.iconst(value); int mref_newInteger = c.pool.Methodref( "org/python/core/Py", "newInteger", ! "(I)Lorg/python/core/PyInteger;"); c.invokestatic(mref_newInteger); ! c.putstatic(module.classfile.name, name, ! "Lorg/python/core/PyInteger;"); } --- 16,31 ---- public void get(Code c) throws IOException { ! c.getstatic(module.classfile.name, name, $pyInteger); } public void put(Code c) throws IOException { ! module.classfile.addField(name, $pyInteger, access); c.iconst(value); int mref_newInteger = c.pool.Methodref( "org/python/core/Py", "newInteger", ! "(I)" + $pyInteger); c.invokestatic(mref_newInteger); ! c.putstatic(module.classfile.name, name, $pyInteger); } *************** *** 44,48 **** } ! class PyFloatConstant extends Constant { double value; --- 42,46 ---- } ! class PyFloatConstant extends Constant implements ClassConstants { double value; *************** *** 53,67 **** public void get(Code c) throws IOException { ! c.getstatic(module.classfile.name, name, "Lorg/python/core/PyFloat;"); } public void put(Code c) throws IOException { ! module.classfile.addField(name, "Lorg/python/core/PyFloat;", access); c.ldc(c.pool.Double(value)); int mref_newFloat = c.pool.Methodref("org/python/core/Py", "newFloat", ! "(D)Lorg/python/core/PyFloat;"); c.invokestatic(mref_newFloat); ! c.putstatic(module.classfile.name, name, "Lorg/python/core/PyFloat;"); } --- 51,65 ---- public void get(Code c) throws IOException { ! c.getstatic(module.classfile.name, name, $pyFloat); } public void put(Code c) throws IOException { ! module.classfile.addField(name, $pyFloat, access); c.ldc(c.pool.Double(value)); int mref_newFloat = c.pool.Methodref("org/python/core/Py", "newFloat", ! "(D)" + $pyFloat); c.invokestatic(mref_newFloat); ! c.putstatic(module.classfile.name, name, $pyFloat); } *************** *** 78,82 **** } ! class PyComplexConstant extends Constant { double value; --- 76,80 ---- } ! class PyComplexConstant extends Constant implements ClassConstants { double value; *************** *** 87,104 **** public void get(Code c) throws IOException { ! c.getstatic(module.classfile.name, name, ! "Lorg/python/core/PyComplex;"); } public void put(Code c) throws IOException { ! module.classfile.addField(name, "Lorg/python/core/PyComplex;", access); c.ldc(c.pool.Double(value)); int mref_newImaginary = c.pool.Methodref( "org/python/core/Py", "newImaginary", ! "(D)Lorg/python/core/PyComplex;"); c.invokestatic(mref_newImaginary); ! c.putstatic(module.classfile.name, name, ! "Lorg/python/core/PyComplex;"); } --- 85,100 ---- public void get(Code c) throws IOException { ! c.getstatic(module.classfile.name, name, $pyComplex); } public void put(Code c) throws IOException { ! module.classfile.addField(name, $pyComplex, access); c.ldc(c.pool.Double(value)); int mref_newImaginary = c.pool.Methodref( "org/python/core/Py", "newImaginary", ! "(D)" + $pyComplex); c.invokestatic(mref_newImaginary); ! c.putstatic(module.classfile.name, name, $pyComplex); } *************** *** 115,119 **** } ! class PyStringConstant extends Constant { String value; --- 111,115 ---- } ! class PyStringConstant extends Constant implements ClassConstants { String value; *************** *** 124,139 **** public void get(Code c) throws IOException { ! c.getstatic(module.classfile.name, name, "Lorg/python/core/PyString;"); } public void put(Code c) throws IOException { ! module.classfile.addField(name, "Lorg/python/core/PyString;", access); c.ldc(value); int mref_newString = c.pool.Methodref( "org/python/core/Py", "newString", ! "(Ljava/lang/String;)Lorg/python/core/PyString;"); c.invokestatic(mref_newString); ! c.putstatic(module.classfile.name, name, "Lorg/python/core/PyString;"); } --- 120,135 ---- public void get(Code c) throws IOException { ! c.getstatic(module.classfile.name, name, $pyStr); } public void put(Code c) throws IOException { ! module.classfile.addField(name, $pyStr, access); c.ldc(value); int mref_newString = c.pool.Methodref( "org/python/core/Py", "newString", ! "(" + $str + ")" + $pyStr); c.invokestatic(mref_newString); ! c.putstatic(module.classfile.name, name, $pyStr); } *************** *** 150,154 **** } ! class PyLongConstant extends Constant { String value; --- 146,150 ---- } ! class PyLongConstant extends Constant implements ClassConstants { String value; *************** *** 159,174 **** public void get(Code c) throws IOException { ! c.getstatic(module.classfile.name, name, "Lorg/python/core/PyLong;"); } public void put(Code c) throws IOException { ! module.classfile.addField(name, "Lorg/python/core/PyLong;", access); c.ldc(value); int mref_newLong = c.pool.Methodref( "org/python/core/Py", "newLong", ! "(Ljava/lang/String;)Lorg/python/core/PyLong;"); c.invokestatic(mref_newLong); ! c.putstatic(module.classfile.name, name, "Lorg/python/core/PyLong;"); } --- 155,170 ---- public void get(Code c) throws IOException { ! c.getstatic(module.classfile.name, name, $pyLong); } public void put(Code c) throws IOException { ! module.classfile.addField(name, $pyLong, access); c.ldc(value); int mref_newLong = c.pool.Methodref( "org/python/core/Py", "newLong", ! "(" + $str + ")" + $pyLong); c.invokestatic(mref_newLong); ! c.putstatic(module.classfile.name, name, $pyLong); } *************** *** 184,188 **** } ! class PyCodeConstant extends Constant { public String co_name; --- 180,184 ---- } ! class PyCodeConstant extends Constant implements ClassConstants { public String co_name; *************** *** 205,213 **** public void get(Code c) throws IOException { ! c.getstatic(module.classfile.name, name, "Lorg/python/core/PyCode;"); } public void put(Code c) throws IOException { ! module.classfile.addField(name, "Lorg/python/core/PyCode;", access); c.iconst(argcount); --- 201,209 ---- public void get(Code c) throws IOException { ! c.getstatic(module.classfile.name, name, $pyCode); } public void put(Code c) throws IOException { ! module.classfile.addField(name, $pyCode, access); c.iconst(argcount); *************** *** 234,239 **** c.iconst(id); ! if (cellvars != null) CodeCompiler.makeStrings(c, cellvars, cellvars.length); else c.aconst_null(); ! if (freevars != null) CodeCompiler.makeStrings(c, freevars, freevars.length); else c.aconst_null(); c.iconst(jy_npurecell); --- 230,241 ---- c.iconst(id); ! if (cellvars != null) ! CodeCompiler.makeStrings(c, cellvars, cellvars.length); ! else ! c.aconst_null(); ! if (freevars != null) ! CodeCompiler.makeStrings(c, freevars, freevars.length); ! else ! c.aconst_null(); c.iconst(jy_npurecell); *************** *** 244,256 **** "org/python/core/Py", "newCode", ! "(I[Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;IZZLorg/python/core/PyFunctionTable;I[Ljava/lang/String;[Ljava/lang/String;II)Lorg/python/core/PyCode;"); c.invokestatic(mref_newCode); //c.aconst_null(); ! c.putstatic(module.classfile.name, name, "Lorg/python/core/PyCode;"); } } ! public class Module { ClassFile classfile; --- 246,259 ---- "org/python/core/Py", "newCode", ! "(I" + $strArr + $str + $str + "IZZ" + $pyFuncTbl + "I" + ! $strArr + $strArr + "II)" + $pyCode); c.invokestatic(mref_newCode); //c.aconst_null(); ! c.putstatic(module.classfile.name, name, $pyCode); } } ! public class Module implements ClassConstants { ClassFile classfile; *************** *** 323,327 **** int firstlineno) throws Exception { ! return PyCode(tree, name, ac, fast_locals, class_body, false, firstlineno); } public PyCodeConstant PyCode(SimpleNode tree, String name, --- 326,331 ---- int firstlineno) throws Exception { ! return PyCode(tree, name, ac, fast_locals, class_body, false, ! firstlineno); } public PyCodeConstant PyCode(SimpleNode tree, String name, *************** *** 367,371 **** throws Exception { ! return PyCode(tree,name,fast_locals,className,classBody,printResults,firstlineno,scope,null); } --- 371,376 ---- throws Exception { ! return PyCode(tree,name,fast_locals,className,classBody, ! printResults,firstlineno,scope,null); } *************** *** 374,378 **** boolean fast_locals, String className, boolean classBody, boolean printResults, ! int firstlineno, ScopeInfo scope,org.python.core.CompilerFlags cflags) throws Exception { --- 379,384 ---- boolean fast_locals, String className, boolean classBody, boolean printResults, ! int firstlineno, ScopeInfo scope, ! org.python.core.CompilerFlags cflags) throws Exception { *************** *** 400,404 **** Code c = classfile.addMethod( code.fname, ! "(Lorg/python/core/PyFrame;)Lorg/python/core/PyObject;", ClassFile.PUBLIC); --- 406,410 ---- Code c = classfile.addMethod( code.fname, ! "(" + $pyFrame + ")" + $pyObj, ClassFile.PUBLIC); *************** *** 415,419 **** if (nparamcell > 0) { if (to_cell == 0) { ! to_cell = classfile.pool.Methodref("org/python/core/PyFrame","to_cell","(II)V"); } Hashtable tbl = scope.tbl; --- 421,426 ---- if (nparamcell > 0) { if (to_cell == 0) { ! to_cell = classfile.pool.Methodref("org/python/core/PyFrame", ! "to_cell","(II)V"); } Hashtable tbl = scope.tbl; *************** *** 429,433 **** } ! compiler.parse(tree, c, fast_locals, className, classBody, scope,cflags); // !classdef only --- 436,441 ---- } ! compiler.parse(tree, c, fast_locals, className, classBody, ! scope,cflags); // !classdef only *************** *** 464,468 **** public void addRunnable() throws IOException { Code c = classfile.addMethod("getMain", ! "()Lorg/python/core/PyCode;", ClassFile.PUBLIC); mainCode.get(c); --- 472,476 ---- public void addRunnable() throws IOException { Code c = classfile.addMethod("getMain", ! "()" + $pyCode, ClassFile.PUBLIC); mainCode.get(c); *************** *** 471,475 **** public void addMain() throws IOException { ! Code c = classfile.addMethod("main", "([Ljava/lang/String;)V", ClassFile.PUBLIC | ClassFile.STATIC); --- 479,483 ---- public void addMain() throws IOException { ! Code c = classfile.addMethod("main", "(" + $str + ")V", ClassFile.PUBLIC | ClassFile.STATIC); *************** *** 483,487 **** "org/python/core/Py", "do_main", ! "(Lorg/python/core/PyRunnable;[Ljava/lang/String;)V")); c.return_(); } --- 491,495 ---- "org/python/core/Py", "do_main", ! "(" + $pyRunnable + $strArr + ")V")); c.return_(); } *************** *** 517,521 **** Code code = classfile.addMethod( "call_function", ! "(ILorg/python/core/PyFrame;)Lorg/python/core/PyObject;", ClassFile.PUBLIC); --- 525,529 ---- Code code = classfile.addMethod( "call_function", ! "(I" + $pyFrame + ")" + $pyObj, ClassFile.PUBLIC); *************** *** 537,541 **** classfile.name, ((PyCodeConstant)codes.elementAt(i)).fname, ! "(Lorg/python/core/PyFrame;)Lorg/python/core/PyObject;"); code.areturn(); } --- 545,549 ---- classfile.name, ((PyCodeConstant)codes.elementAt(i)).fname, ! "(" + $pyFrame + ")" + $pyObj); code.areturn(); } *************** *** 568,572 **** String name, String filename, boolean linenumbers, boolean printResults, ! boolean setFile,org.python.core.CompilerFlags cflags) throws Exception { --- 576,581 ---- String name, String filename, boolean linenumbers, boolean printResults, ! boolean setFile, ! org.python.core.CompilerFlags cflags) throws Exception { *************** *** 576,580 **** //Add __file__ for filename (if it exists?) ! Constant main = module.PyCode(node, "?",false, null, false, printResults, 0,null,cflags); module.mainCode = main; module.write(ostream); --- 585,590 ---- //Add __file__ for filename (if it exists?) ! Constant main = module.PyCode(node, "?", false, null, false, ! printResults, 0, null, cflags); module.mainCode = main; module.write(ostream); Index: ProxyMaker.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/compiler/ProxyMaker.java,v retrieving revision 2.15 retrieving revision 2.16 diff -C2 -d -r2.15 -r2.16 *** ProxyMaker.java 2001/11/27 13:51:37 2.15 --- ProxyMaker.java 2001/11/27 19:07:21 2.16 *************** *** 10,14 **** import org.python.core.Py; ! public class ProxyMaker { public static final int tBoolean=0; --- 10,14 ---- import org.python.core.Py; ! public class ProxyMaker implements ClassConstants { public static final int tBoolean=0; *************** *** 242,250 **** int jcall = code.pool.Methodref( "org/python/core/PyObject", jcallName, ! "([Ljava/lang/Object;)Lorg/python/core/PyObject;"); int py2j = code.pool.Methodref( "org/python/core/Py", "py2"+name, ! "(Lorg/python/core/PyObject;)"+type); code.invokevirtual(jcall); --- 242,250 ---- int jcall = code.pool.Methodref( "org/python/core/PyObject", jcallName, ! "(" + $objArr + ")" + $pyObj); int py2j = code.pool.Methodref( "org/python/core/Py", "py2"+name, ! "(" + $pyObj + ")"+type); code.invokevirtual(jcall); *************** *** 256,261 **** if (parameters.length == 0) { int EmptyObjects = code.pool.Fieldref( ! "org/python/core/Py", "EmptyObjects", ! "[Lorg/python/core/PyObject;"); code.getstatic(EmptyObjects); } --- 256,260 ---- if (parameters.length == 0) { int EmptyObjects = code.pool.Fieldref( ! "org/python/core/Py", "EmptyObjects", $pyObjArr); code.getstatic(EmptyObjects); } *************** *** 282,286 **** int newInteger = code.pool.Methodref( "org/python/core/Py", ! "newInteger", "(I)Lorg/python/core/PyInteger;"); code.invokestatic(newInteger); break; --- 281,285 ---- int newInteger = code.pool.Methodref( "org/python/core/Py", ! "newInteger", "(I)" + $pyInteger); code.invokestatic(newInteger); break; *************** *** 291,295 **** int newInteger1 = code.pool.Methodref( "org/python/core/Py", ! "newInteger", "(J)Lorg/python/core/PyObject;"); code.invokestatic(newInteger1); break; --- 290,294 ---- int newInteger1 = code.pool.Methodref( "org/python/core/Py", ! "newInteger", "(J)" + $pyObj); code.invokestatic(newInteger1); break; *************** *** 300,304 **** int newFloat = code.pool.Methodref( "org/python/core/Py", ! "newFloat", "(F)Lorg/python/core/PyFloat;"); code.invokestatic(newFloat); break; --- 299,303 ---- int newFloat = code.pool.Methodref( "org/python/core/Py", ! "newFloat", "(F)" + $pyFloat); code.invokestatic(newFloat); break; *************** *** 309,313 **** int newFloat1 = code.pool.Methodref( "org/python/core/Py", ! "newFloat", "(D)Lorg/python/core/PyFloat;"); code.invokestatic(newFloat1); break; --- 308,312 ---- int newFloat1 = code.pool.Methodref( "org/python/core/Py", ! "newFloat", "(D)" + $pyFloat); code.invokestatic(newFloat1); break; *************** *** 317,321 **** int newString = code.pool.Methodref( "org/python/core/Py", ! "newString", "(C)Lorg/python/core/PyString;"); code.invokestatic(newString); break; --- 316,320 ---- int newString = code.pool.Methodref( "org/python/core/Py", ! "newString", "(C)" + $pyStr); code.invokestatic(newString); break; *************** *** 380,384 **** int jcall = code.pool.Methodref( "org/python/core/PyObject", jcallName, ! "([Ljava/lang/Object;)Lorg/python/core/PyObject;"); code.invokevirtual(jcall); /* catching exceptions is not vm mandatory --- 379,383 ---- int jcall = code.pool.Methodref( "org/python/core/PyObject", jcallName, ! "(" + $objArr + ")" + $pyObj); code.invokevirtual(jcall); /* catching exceptions is not vm mandatory *************** *** 391,395 **** int forname = code.pool.Methodref( "java/lang/Class","forName", ! "(Ljava/lang/String;)Ljava/lang/Class;"); code.ldc(ret.getName()); code.invokestatic(forname); --- 390,394 ---- int forname = code.pool.Methodref( "java/lang/Class","forName", ! "(" + $str + ")" + $clss); code.ldc(ret.getName()); code.invokestatic(forname); *************** *** 399,412 **** forname_exch_start.setPosition(); code.stack = 1; ! code.pop(); // never reached, but this code keeps the verifier happy code.aconst_null(); code.dup(); forname_exch_end.setPosition(); ! code.addExceptionHandler(forname_start,forname_end,forname_exch_start,code.pool.Class("java/lang/ClassNotFoundException")); */ int tojava = code.pool.Methodref( "org/python/core/Py", "tojava", ! "(Lorg/python/core/PyObject;Ljava/lang/Class;)Ljava/lang/Object;"); code.invokestatic(tojava); // I guess I need this checkcast to keep the verifier happy --- 398,414 ---- forname_exch_start.setPosition(); code.stack = 1; ! // never reached, but this code keeps the verifier happy ! code.pop(); code.aconst_null(); code.dup(); forname_exch_end.setPosition(); ! code.addExceptionHandler(forname_start,forname_end, ! forname_exch_start, ! code.pool.Class("java/lang/ClassNotFoundException")); */ int tojava = code.pool.Methodref( "org/python/core/Py", "tojava", ! "(" + $pyObj + $clss + ")" + $obj); code.invokestatic(tojava); // I guess I need this checkcast to keep the verifier happy *************** *** 454,458 **** int jthrow = code.pool.Methodref( "org/python/core/PyObject", "_jthrow", ! "(Ljava/lang/Throwable;)V"); code.invokevirtual(jthrow); --- 456,460 ---- int jthrow = code.pool.Methodref( "org/python/core/PyObject", "_jthrow", ! "(" + $throwable + ")V"); code.invokevirtual(jthrow); *************** *** 486,497 **** code.aload(0); - // int proxy = code.pool.Fieldref(classfile.name, "__proxy", "Lorg/python/core/PyInstance;"); - // code.getfield(proxy); - code.ldc(name); - // int nref = code.pool.Fieldref(classfile.name, name, "Lorg/python/core/PyString;"); - // code.getstatic(nref); - if (!isAbstract) { int tmp = code.getLocal(); --- 488,493 ---- *************** *** 499,503 **** "org/python/core/Py", "jfindattr", ! "(Lorg/python/core/PyProxy;Ljava/lang/String;)Lorg/python/core/PyObject;"); code.invokestatic(jfindattr); --- 495,499 ---- "org/python/core/Py", "jfindattr", ! "(" + $pyProxy + $str + ")" + $pyObj); code.invokestatic(jfindattr); *************** *** 525,529 **** "org/python/core/Py", "jgetattr", ! "(Lorg/python/core/PyProxy;Ljava/lang/String;)Lorg/python/core/PyObject;"); code.invokestatic(jgetattr); callMethod(code, name, parameters, ret, --- 521,525 ---- "org/python/core/Py", "jgetattr", ! "(" + $pyProxy + $str + ")" + $pyObj); code.invokestatic(jgetattr); callMethod(code, name, parameters, ret, *************** *** 534,538 **** "org/python/core/Py", "jfindattr", ! "(Lorg/python/core/PyProxy;Ljava/lang/String;)Lorg/python/core/PyObject;"); code.invokestatic(jfindattr); code.dup(); --- 530,534 ---- "org/python/core/Py", "jfindattr", ! "(" + $pyProxy + $str + ")" + $pyObj); code.invokestatic(jfindattr); code.dup(); *************** *** 662,668 **** /* rationale: JC java-class, P proxy-class subclassing JC in order to avoid infinite recursion P should define super__foo ! only if no class between P and JC in the hierarchy defines it yet; ! this means that the python class needing P is the first that ! redefines the JC method foo. */ try { --- 658,664 ---- /* rationale: JC java-class, P proxy-class subclassing JC in order to avoid infinite recursion P should define super__foo ! only if no class between P and JC in the hierarchy defines ! it yet; this means that the python class needing P is the ! first that redefines the JC method foo. */ try { *************** *** 735,739 **** classfile.addInterface(mapClass(org.python.core.ClassDictInit.class)); Code code = classfile.addMethod("classDictInit", ! "(Lorg/python/core/PyObject;)V", Modifier.PUBLIC | Modifier.STATIC); code.aload(0); --- 731,735 ---- classfile.addInterface(mapClass(org.python.core.ClassDictInit.class)); Code code = classfile.addMethod("classDictInit", ! "(" + $pyObj + ")V", Modifier.PUBLIC | Modifier.STATIC); code.aload(0); *************** *** 747,756 **** int j2py = code.pool.Methodref( "org/python/core/Py", "java2py", ! "(Ljava/lang/Object;)Lorg/python/core/PyObject;"); code.invokestatic(j2py); int setitem = code.pool.Methodref( "org/python/core/PyObject", "__setitem__", ! "(Ljava/lang/String;Lorg/python/core/PyObject;)V"); code.invokevirtual(setitem); code.return_(); --- 743,752 ---- int j2py = code.pool.Methodref( "org/python/core/Py", "java2py", ! "(" + $obj + ")" + $pyObj); code.invokestatic(j2py); int setitem = code.pool.Methodref( "org/python/core/PyObject", "__setitem__", ! "(" + $str + $pyObj + ")V"); code.invokevirtual(setitem); code.return_(); Index: ScopeInfo.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/compiler/ScopeInfo.java,v retrieving revision 2.5 retrieving revision 2.6 diff -C2 -d -r2.5 -r2.6 *** ScopeInfo.java 2001/11/27 13:51:37 2.5 --- ScopeInfo.java 2001/11/27 19:07:21 2.6 *************** *** 14,20 **** public void dump() { // for debugging ! if (org.python.core.Options.verbose < org.python.core.Py.DEBUG) return; for(int i=0; i<level; i++) System.err.print(' '); ! System.err.print(((kind != CLASSSCOPE)?scope_name:"class "+scope_name)+": "); for (Enumeration e = tbl.keys(); e.hasMoreElements(); ) { String name = (String)e.nextElement(); --- 14,22 ---- public void dump() { // for debugging ! if (org.python.core.Options.verbose < org.python.core.Py.DEBUG) ! return; for(int i=0; i<level; i++) System.err.print(' '); ! System.err.print(((kind != CLASSSCOPE)?scope_name:"class "+ ! scope_name)+": "); for (Enumeration e = tbl.keys(); e.hasMoreElements(); ) { String name = (String)e.nextElement(); *************** *** 23,30 **** System.err.print(name); if ((flags&BOUND) != 0) System.err.print('='); ! if ((flags&NGLOBAL) != 0) System.err.print('G'); else // func scope global (affect nested scopes) ! if ((flags&CLASS_GLOBAL) != 0) System.err.print('g'); // vs. class scope global ! if ((flags&PARAM) != 0) System.err.print('P'); else ! if ((flags&FROM_PARAM) != 0) System.err.print('p'); if ((flags&CELL) != 0) System.err.print('!'); if ((flags&FREE) != 0) System.err.print(",f"); --- 25,34 ---- System.err.print(name); if ((flags&BOUND) != 0) System.err.print('='); ! // func scope global (affect nested scopes) ! // vs. class scope global ! if ((flags&NGLOBAL) != 0) System.err.print('G'); ! else if ((flags&CLASS_GLOBAL) != 0) System.err.print('g'); ! if ((flags&PARAM) != 0) System.err.print('P'); ! else if ((flags&FROM_PARAM) != 0) System.err.print('p'); if ((flags&CELL) != 0) System.err.print('!'); if ((flags&FREE) != 0) System.err.print(",f"); *************** *** 34,38 **** } ! public ScopeInfo(String name,SimpleNode node,int level,int kind,int func_level,ArgListCompiler ac,boolean nested_scopes) { scope_name = name; scope_node = node; --- 38,44 ---- } ! public ScopeInfo(String name, SimpleNode node, int level, int kind, ! int func_level, ArgListCompiler ac, ! boolean nested_scopes) { scope_name = name; scope_node = node; *************** *** 57,61 **** public int addGlobal(String name) { ! int global = kind==CLASSSCOPE?CLASS_GLOBAL:NGLOBAL; // global kind = func vs. class SymInfo info = (SymInfo)tbl.get(name); if (info == null) { --- 63,68 ---- public int addGlobal(String name) { ! // global kind = func vs. class ! int global = kind==CLASSSCOPE?CLASS_GLOBAL:NGLOBAL; SymInfo info = (SymInfo)tbl.get(name); if (info == null) { *************** *** 128,135 **** int flags = info.flags; if (func) { ! if ((flags&NGLOBAL) == 0 && (flags&BOUND) != 0) { // not func global and bound ? if (nested_scopes) { info.flags |= CELL; ! if ((info.flags&PARAM) != 0) jy_paramcells.addElement(name); cellvars.addElement(name); info.env_index = cell++; --- 135,144 ---- int flags = info.flags; if (func) { ! // not func global and bound ? ! if ((flags&NGLOBAL) == 0 && (flags&BOUND) != 0) { if (nested_scopes) { info.flags |= CELL; ! if ((info.flags&PARAM) != 0) ! jy_paramcells.addElement(name); cellvars.addElement(name); info.env_index = cell++; *************** *** 137,141 **** continue; } ! ctxt.error("local name '"+name+"' in '"+scope_name+"' shadows use as global in nested scopes",false,scope_node); } } else { --- 146,152 ---- continue; } ! ctxt.error("local name '"+name+"' in '"+scope_name+ ! "' shadows use as global in nested scopes", ! false, scope_node); } } else { *************** *** 171,192 **** if ((unqual_exec || from_import_star)) { if(some_inner_free) dynastuff_trouble(true, ctxt); ! else if(func_level > 1 && some_free) dynastuff_trouble(false, ctxt); } } ! private void dynastuff_trouble(boolean inner_free,CompilationContext ctxt) throws Exception { String illegal; if (unqual_exec && from_import_star) ! illegal = "function '"+scope_name+"' uses import * and bare exec, which are illegal"; else if (unqual_exec) ! illegal = "unqualified exec is not allowed in function '"+scope_name+"'"; ! else illegal = "import * is not allowed in function '"+scope_name+"'"; String why; if (inner_free) ! why = " because it contains a function with free variables"; else ! why = " because it contains free variables"; ! ctxt.error(illegal + why ,nested_scopes,scope_node); } --- 182,208 ---- if ((unqual_exec || from_import_star)) { if(some_inner_free) dynastuff_trouble(true, ctxt); ! else if(func_level > 1 && some_free) ! dynastuff_trouble(false, ctxt); } } ! private void dynastuff_trouble(boolean inner_free, ! CompilationContext ctxt) throws Exception { String illegal; if (unqual_exec && from_import_star) ! illegal = "function '"+scope_name+ ! "' uses import * and bare exec, which are illegal"; else if (unqual_exec) ! illegal = "unqualified exec is not allowed in function '"+ ! scope_name+"'"; ! else ! illegal = "import * is not allowed in function '"+scope_name+"'"; String why; if (inner_free) ! why = " because it contains a function with free variables"; else ! why = " because it contains free variables"; ! ctxt.error(illegal + why, nested_scopes, scope_node); } *************** *** 204,208 **** if ((flags&FREE) != 0) { SymInfo up_info = (SymInfo)up_tbl.get(name); ! if (up_info != null) { // ?? differs from CPython -- what is the intended behaviour? int up_flags = up_info.flags; if ((up_flags&(CELL|FREE)) != 0) { --- 220,225 ---- if ((flags&FREE) != 0) { SymInfo up_info = (SymInfo)up_tbl.get(name); ! // ?? differs from CPython -- what is the intended behaviour? ! if (up_info != null) { int up_flags = up_info.flags; if ((up_flags&(CELL|FREE)) != 0) { *************** *** 211,215 **** continue; } ! if (nested && (up_flags&NGLOBAL) != 0) { // ! func global affect nested scopes info.flags = NGLOBAL|BOUND; continue; --- 228,233 ---- continue; } ! // ! func global affect nested scopes ! if (nested && (up_flags&NGLOBAL) != 0) { info.flags = NGLOBAL|BOUND; continue; *************** *** 221,224 **** } - } --- 239,241 ---- Index: ScopesCompiler.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/compiler/ScopesCompiler.java,v retrieving revision 2.4 retrieving revision 2.5 diff -C2 -d -r2.4 -r2.5 *** ScopesCompiler.java 2001/05/27 18:49:15 2.4 --- ScopesCompiler.java 2001/11/27 19:07:21 2.5 *************** *** 28,33 **** scopes = new Stack(); mode = GET; - /*String nested_scopes_opt = org.python.core.PySystemState.registry.getProperty("python.xfutures.nested_scopes"); - if (nested_scopes_opt != null && nested_scopes_opt.equals("on")) nested_scopes = true; else*/ nested_scopes = code_compiler.getFutures().areNestedScopesOn(); // System.err.println("nested-scopes: "+nested_scopes); --- 28,31 ---- *************** *** 54,63 **** } ! public void beginScope(String name,int kind,SimpleNode node,ArgListCompiler ac) { if (cur != null) { scopes.push(cur); } if (kind == FUNCSCOPE) func_level++; ! node.scope = cur = new ScopeInfo(name,node,level++,kind,func_level,ac,nested_scopes); } --- 52,64 ---- } ! public void beginScope(String name, int kind, SimpleNode node, ! ArgListCompiler ac) ! { if (cur != null) { scopes.push(cur); } if (kind == FUNCSCOPE) func_level++; ! node.scope = cur = new ScopeInfo(name, node, level++, kind, ! func_level, ac, nested_scopes); } *************** *** 75,79 **** node.visit(this); } catch(Throwable t) { ! throw org.python.core.parser.fixParseError(null,t,code_compiler.getFilename()); } } --- 76,81 ---- node.visit(this); } catch(Throwable t) { ! throw org.python.core.parser.fixParseError(null, t, ! code_compiler.getFilename()); } } *************** *** 154,158 **** node.getChild(i).visit(this); } ! if(node.getChild(n-1).id != PythonGrammarTreeConstants.JJTCOMMA) node.getChild(n-1).visit(this); } return null; --- 156,161 ---- node.getChild(i).visit(this); } ! if(node.getChild(n-1).id != PythonGrammarTreeConstants.JJTCOMMA) ! node.getChild(n-1).visit(this); } return null; *************** *** 238,246 **** int prev = cur.addGlobal(name); if (prev >= 0) { ! if ((prev&FROM_PARAM) != 0) code_compiler.error("name '"+name+"' is local and global",true,node); if ((prev&GLOBAL) != 0) continue; String what; if ((prev&BOUND) != 0) what = "assignment"; else what = "use"; ! code_compiler.error("name '"+name+"' declared global after "+what,false,node); } } --- 241,252 ---- int prev = cur.addGlobal(name); if (prev >= 0) { ! if ((prev&FROM_PARAM) != 0) ! code_compiler.error("name '"+name+"' is local and global", ! true,node); if ((prev&GLOBAL) != 0) continue; String what; if ((prev&BOUND) != 0) what = "assignment"; else what = "use"; ! code_compiler.error("name '"+name+"' declared global after "+ ! what,false,node); } } *************** *** 477,481 **** if (n > 0) { for (int i=0; i<n-1; i++) node.getChild(i).visit(this); ! if (node.getChild(n-1).id != PythonGrammarTreeConstants.JJTCOMMA) node.getChild(n-1).visit(this); } return null; --- 483,488 ---- if (n > 0) { for (int i=0; i<n-1; i++) node.getChild(i).visit(this); ! if (node.getChild(n-1).id != PythonGrammarTreeConstants.JJTCOMMA) ! node.getChild(n-1).visit(this); } return null; *************** *** 494,498 **** if (n > 0) { for (int i=0; i<n-1; i++) node.getChild(i).visit(this); ! if (node.getChild(n-1).id != PythonGrammarTreeConstants.JJTCOMMA) node.getChild(n-1).visit(this); } return null; --- 501,506 ---- if (n > 0) { for (int i=0; i<n-1; i++) node.getChild(i).visit(this); ! if (node.getChild(n-1).id != PythonGrammarTreeConstants.JJTCOMMA) ! node.getChild(n-1).visit(this); } return null; *************** *** 582,586 **** String name = (String)node.getInfo(); if ( mode != GET) { ! if (name.equals("__debug__")) code_compiler.error("can not assign to __debug__",false,node); cur.addBound(name); } --- 590,595 ---- String name = (String)node.getInfo(); if ( mode != GET) { ! if (name.equals("__debug__")) ! code_compiler.error("can not assign to __debug__",false,node); cur.addBound(name); } |
From: Finn B. <bc...@us...> - 2001-11-27 13:51:41
|
Update of /cvsroot/jython/jython/org/python/compiler In directory usw-pr-cvs1:/tmp/cvs-serv9040/compiler Modified Files: AdapterMaker.java ArgListCompiler.java ClassFile.java Code.java CodeCompiler.java CompilationContext.java ConstantPool.java Future.java JavaMaker.java Label.java Module.java ProxyMaker.java ScopeConstants.java ScopeInfo.java SymInfo.java Log Message: Whitespace normalization. Index: AdapterMaker.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/compiler/AdapterMaker.java,v retrieving revision 2.5 retrieving revision 2.6 diff -C2 -d -r2.5 -r2.6 *** AdapterMaker.java 2001/10/28 17:13:41 2.5 --- AdapterMaker.java 2001/11/27 13:51:37 2.6 *************** *** 46,50 **** } } ! public void addMethod(Method method, int access) throws Exception { Class[] parameters = method.getParameterTypes(); --- 46,50 ---- } } ! public void addMethod(Method method, int access) throws Exception { Class[] parameters = method.getParameterTypes(); Index: ArgListCompiler.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/compiler/ArgListCompiler.java,v retrieving revision 2.6 retrieving revision 2.7 diff -C2 -d -r2.6 -r2.7 *** ArgListCompiler.java 2001/10/28 17:13:41 2.6 --- ArgListCompiler.java 2001/11/27 13:51:37 2.7 *************** *** 67,71 **** } names.addElement(name); ! //Handle tuple arguments properly if (node.getChild(0).id == PythonGrammarTreeConstants.JJTFPLIST) { --- 67,71 ---- } names.addElement(name); ! //Handle tuple arguments properly if (node.getChild(0).id == PythonGrammarTreeConstants.JJTFPLIST) { Index: ClassFile.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/compiler/ClassFile.java,v retrieving revision 2.5 retrieving revision 2.6 diff -C2 -d -r2.5 -r2.6 *** ClassFile.java 2001/10/28 17:13:41 2.5 --- ClassFile.java 2001/11/27 13:51:37 2.6 *************** *** 58,62 **** return new String(c); } ! public ClassFile(String name) { this(name, "java/lang/Object", SYNCHRONIZED | PUBLIC); --- 58,62 ---- return new String(c); } ! public ClassFile(String name) { this(name, "java/lang/Object", SYNCHRONIZED | PUBLIC); *************** *** 119,123 **** } } ! public void addAttribute(Attribute attr) throws IOException { attributes.addElement(attr); --- 119,123 ---- } } ! public void addAttribute(Attribute attr) throws IOException { attributes.addElement(attr); *************** *** 127,131 **** //Write Header int thisclass = pool.Class(name); ! int superclass = pool.Class(this.superclass); stream.writeInt(0xcafebabe); --- 127,131 ---- //Write Header int thisclass = pool.Class(name); ! int superclass = pool.Class(this.superclass); stream.writeInt(0xcafebabe); *************** *** 150,154 **** int n = attributes.size(); stream.writeShort(n); ! for (int i=0; i<n; i++) { ((Attribute)attributes.elementAt(i)).write(stream); --- 150,154 ---- int n = attributes.size(); stream.writeShort(n); ! for (int i=0; i<n; i++) { ((Attribute)attributes.elementAt(i)).write(stream); Index: Code.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/compiler/Code.java,v retrieving revision 2.4 retrieving revision 2.5 diff -C2 -d -r2.4 -r2.5 *** Code.java 2001/10/28 17:13:42 2.4 --- Code.java 2001/11/27 13:51:37 2.5 *************** *** 6,10 **** import java.util.Vector; ! class ExceptionLabel { public Label start, end, handler; --- 6,10 ---- import java.util.Vector; ! class ExceptionLabel { public Label start, end, handler; *************** *** 20,24 **** ! public class Code extends Attribute { ConstantPool pool; --- 20,24 ---- ! public class Code extends Attribute { ConstantPool pool; Index: CodeCompiler.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/compiler/CodeCompiler.java,v retrieving revision 2.21 retrieving revision 2.22 diff -C2 -d -r2.21 -r2.22 *** CodeCompiler.java 2001/10/28 17:13:42 2.21 --- CodeCompiler.java 2001/11/27 13:51:37 2.22 *************** *** 35,47 **** public boolean fast_locals, print_results; ! public Future futures; public Hashtable tbl; public ScopeInfo my_scope; ! public Future getFutures() { return futures; } public String getFilename() { return module.sfilename; } ! boolean optimizeGlobals = true; public Vector names; --- 35,47 ---- public boolean fast_locals, print_results; ! public Future futures; public Hashtable tbl; public ScopeInfo my_scope; ! public Future getFutures() { return futures; } public String getFilename() { return module.sfilename; } ! boolean optimizeGlobals = true; public Vector names; *************** *** 202,206 **** scope = node.scope; } ! my_scope = scope; names = scope.names; --- 202,206 ---- scope = node.scope; } ! my_scope = scope; names = scope.names; *************** *** 251,255 **** if (suite.getNumChildren() > 0 && suite.getChild(0).id == PythonGrammarTreeConstants.JJTEXPR_STMT && ! suite.getChild(0).getChild(0).id == PythonGrammarTreeConstants.JJTSTRING) { loadFrame(); --- 251,255 ---- if (suite.getNumChildren() > 0 && suite.getChild(0).id == PythonGrammarTreeConstants.JJTEXPR_STMT && ! suite.getChild(0).getChild(0).id == PythonGrammarTreeConstants.JJTSTRING) { loadFrame(); *************** *** 322,326 **** int getclosure; ! public boolean makeClosure(Vector freenames) throws Exception { if (freenames == null) return false; --- 322,326 ---- int getclosure; ! public boolean makeClosure(Vector freenames) throws Exception { if (freenames == null) return false; *************** *** 333,337 **** "(I)Lorg/python/core/PyObject;"); } ! int tmp = code.getLocal(); code.iconst(n); --- 333,337 ---- "(I)Lorg/python/core/PyObject;"); } ! int tmp = code.getLocal(); code.iconst(n); *************** *** 347,359 **** code.aastore(); } ! code.aload(tmp); code.freeLocal(tmp); ! return true; } ! ! ! int f_globals, PyFunction_init, PyFunction_closure_init; --- 347,359 ---- code.aastore(); } ! code.aload(tmp); code.freeLocal(tmp); ! return true; } ! ! ! int f_globals, PyFunction_init, PyFunction_closure_init; *************** *** 381,385 **** makeArray(node.scope.ac.getDefaults()); ! node.scope.setup_closure(my_scope); node.scope.dump(); --- 381,385 ---- makeArray(node.scope.ac.getDefaults()); ! node.scope.setup_closure(my_scope); node.scope.dump(); *************** *** 388,392 **** Vector freenames = node.scope.freevars; node.scope = null; // release scope info ! getDocString(suite); --- 388,392 ---- Vector freenames = node.scope.freevars; node.scope = null; // release scope info ! getDocString(suite); *************** *** 417,421 **** setline(node); int n = node.getNumChildren(); ! if (n == 1 && node.getChild(0).id >= PythonGrammarTreeConstants.JJTAUG_PLUS && node.getChild(0).id <= PythonGrammarTreeConstants.JJTAUG_POWER) { --- 417,421 ---- setline(node); int n = node.getNumChildren(); ! if (n == 1 && node.getChild(0).id >= PythonGrammarTreeConstants.JJTAUG_PLUS && node.getChild(0).id <= PythonGrammarTreeConstants.JJTAUG_POWER) { *************** *** 557,561 **** throw new ParseException("'break' outside loop", node); } ! Object obj = breakLabels.peek(); if (obj == DoFinally) { --- 557,561 ---- throw new ParseException("'break' outside loop", node); } ! Object obj = breakLabels.peek(); if (obj == DoFinally) { *************** *** 575,579 **** throw new ParseException("'continue' not properly in loop", node); } ! Object obj = continueLabels.peek(); if (obj == DoFinally) { --- 575,579 ---- throw new ParseException("'continue' not properly in loop", node); } ! Object obj = continueLabels.peek(); if (obj == DoFinally) { *************** *** 591,595 **** return return_stmt(node, false); } ! public Object return_stmt(SimpleNode node, boolean inEval) throws Exception --- 591,595 ---- return return_stmt(node, false); } ! public Object return_stmt(SimpleNode node, boolean inEval) throws Exception *************** *** 690,694 **** code.invokestatic(mrefs.importOne); } ! set(asnameNode); --- 690,694 ---- code.invokestatic(mrefs.importOne); } ! set(asnameNode); *************** *** 713,717 **** if (cnode.id == PythonGrammarTreeConstants.JJTIMPORT_AS_NAME) { names[i] = (String)cnode.getChild(0).getInfo(); ! asnameNodes[i] = cnode.getChild(1); } else { names[i] = (String)cnode.getInfo(); --- 713,717 ---- if (cnode.id == PythonGrammarTreeConstants.JJTIMPORT_AS_NAME) { names[i] = (String)cnode.getChild(0).getInfo(); ! asnameNodes[i] = cnode.getChild(1); } else { names[i] = (String)cnode.getInfo(); *************** *** 795,803 **** setline(node); Label end_of_assert = code.getLabel(); ! /* First do an if __debug__: */ loadFrame(); emitGetGlobal("__debug__"); ! if (mrefs.nonzero == 0) { mrefs.nonzero = code.pool.Methodref("org/python/core/PyObject", --- 795,803 ---- setline(node); Label end_of_assert = code.getLabel(); ! /* First do an if __debug__: */ loadFrame(); emitGetGlobal("__debug__"); ! if (mrefs.nonzero == 0) { mrefs.nonzero = code.pool.Methodref("org/python/core/PyObject", *************** *** 807,811 **** code.ifeq(end_of_assert); ! /* Now do the body of the assert */ node.getChild(0).visit(this); --- 807,811 ---- code.ifeq(end_of_assert); ! /* Now do the body of the assert */ node.getChild(0).visit(this); *************** *** 826,833 **** code.invokestatic(mrefs.assert1); } ! /* And finally set the label for the end of it all */ end_of_assert.setPosition(); ! return null; } --- 826,833 ---- code.invokestatic(mrefs.assert1); } ! /* And finally set the label for the end of it all */ end_of_assert.setPosition(); ! return null; } *************** *** 1106,1120 **** int retLocal = code.getLocal(); code.astore(retLocal); ! // Trick the JVM verifier into thinking this code might not be executed code.iconst(1); code.ifeq(skipSuite); ! // The actual finally suite is always executed (since 1 != 0) ret = finallySuite.visit(this); ! // Fake jump to here to pretend this could always happen skipSuite.setPosition(); ! code.ret(retLocal); finallyEnd.setPosition(); --- 1106,1120 ---- int retLocal = code.getLocal(); code.astore(retLocal); ! // Trick the JVM verifier into thinking this code might not be executed code.iconst(1); code.ifeq(skipSuite); ! // The actual finally suite is always executed (since 1 != 0) ret = finallySuite.visit(this); ! // Fake jump to here to pretend this could always happen skipSuite.setPosition(); ! code.ret(retLocal); finallyEnd.setPosition(); *************** *** 1514,1520 **** inst.visit(this); code.ldc(name); ! //System.out.println("invoke: "+name+": "+values.length); ! switch (values.length) { case 0: --- 1514,1520 ---- inst.visit(this); code.ldc(name); ! //System.out.println("invoke: "+name+": "+values.length); ! switch (values.length) { case 0: *************** *** 1544,1548 **** values[1].visit(this); code.invokevirtual(mrefs.invokea2); ! break; default: makeArray(values); --- 1544,1548 ---- values[1].visit(this); code.invokevirtual(mrefs.invokea2); ! break; default: makeArray(values); *************** *** 1557,1561 **** return null; ! } --- 1557,1561 ---- return null; ! } *************** *** 1612,1616 **** values = new SimpleNode[0]; } ! // Detect a method invocation with no keywords if (nKeywords == 0 && starargs == null && kwargs == null && --- 1612,1616 ---- values = new SimpleNode[0]; } ! // Detect a method invocation with no keywords if (nKeywords == 0 && starargs == null && kwargs == null && *************** *** 1619,1623 **** return Invoke(callee.getChild(0), callee.getChild(1), values); } ! callee.visit(this); --- 1619,1623 ---- return Invoke(callee.getChild(0), callee.getChild(1), values); } ! callee.visit(this); *************** *** 1680,1684 **** values[1].visit(this); code.invokevirtual(mrefs.calla2); ! break; case 3: if (mrefs.calla3 == 0) { --- 1680,1684 ---- values[1].visit(this); code.invokevirtual(mrefs.calla2); ! break; case 3: if (mrefs.calla3 == 0) { *************** *** 1782,1786 **** } return null; ! } --- 1782,1786 ---- } return null; ! } *************** *** 1797,1801 **** } else { int old_mode = mode; ! mode = GET; seq.visit(this); index.visit(this); --- 1797,1801 ---- } else { int old_mode = mode; ! mode = GET; seq.visit(this); index.visit(this); *************** *** 1857,1861 **** } } ! switch(mode) { case DEL: --- 1857,1861 ---- } } ! switch(mode) { case DEL: *************** *** 1896,1900 **** n -= 1; } ! if (mrefs.unpackSequence == 0) { mrefs.unpackSequence = code.pool.Methodref( --- 1896,1900 ---- n -= 1; } ! if (mrefs.unpackSequence == 0) { mrefs.unpackSequence = code.pool.Methodref( *************** *** 1911,1915 **** code.iconst(n); code.invokestatic(mrefs.unpackSequence); ! int tmp = code.getLocal(); code.astore(tmp); --- 1911,1915 ---- code.iconst(n); code.invokestatic(mrefs.unpackSequence); ! int tmp = code.getLocal(); code.astore(tmp); *************** *** 2037,2041 **** public Object list_iter(SimpleNode node) throws Exception { if (node.getNumChildren() == 0) { ! int tmp_append = ((Integer) listComprehensionAppends.peek()).intValue(); SimpleNode exprNode = (SimpleNode) listComprehensionExprs.peek(); --- 2037,2041 ---- public Object list_iter(SimpleNode node) throws Exception { if (node.getNumChildren() == 0) { ! int tmp_append = ((Integer) listComprehensionAppends.peek()).intValue(); SimpleNode exprNode = (SimpleNode) listComprehensionExprs.peek(); *************** *** 2109,2114 **** makeArray(node.scope.ac.getDefaults()); ! ! node.scope.setup_closure(my_scope); node.scope.dump(); module.PyCode(retSuite, name, true, className, --- 2109,2114 ---- makeArray(node.scope.ac.getDefaults()); ! ! node.scope.setup_closure(my_scope); node.scope.dump(); module.PyCode(retSuite, name, true, className, *************** *** 2132,2136 **** code.invokespecial(mrefs.PyFunction_closure_init1); } ! return null; } --- 2132,2136 ---- code.invokespecial(mrefs.PyFunction_closure_init1); } ! return null; } *************** *** 2220,2226 **** "(Ljava/lang/String;[Lorg/python/core/PyObject;Lorg/python/core/PyCode;Lorg/python/core/PyObject;[Lorg/python/core/PyObject;)Lorg/python/core/PyObject;"); } ! code.invokestatic(mrefs.makeClass_closure); } ! //Assign this new class to the given name set(node.getChild(0)); --- 2220,2226 ---- "(Ljava/lang/String;[Lorg/python/core/PyObject;Lorg/python/core/PyCode;Lorg/python/core/PyObject;[Lorg/python/core/PyObject;)Lorg/python/core/PyObject;"); } ! code.invokestatic(mrefs.makeClass_closure); } ! //Assign this new class to the given name set(node.getChild(0)); *************** *** 2273,2277 **** code.invokevirtual(mrefs.getglobal); } ! public Object Name(SimpleNode node) throws Exception { String name; --- 2273,2277 ---- code.invokevirtual(mrefs.getglobal); } ! public Object Name(SimpleNode node) throws Exception { String name; *************** *** 2281,2291 **** name = getName(node); ! if (mode == AUGGET) mode = GET; ! else if (mode == AUGSET) mode = SET; SymInfo syminf = (SymInfo)tbl.get(name); ! switch (mode) { case GET: --- 2281,2291 ---- name = getName(node); ! if (mode == AUGGET) mode = GET; ! else if (mode == AUGSET) mode = SET; SymInfo syminf = (SymInfo)tbl.get(name); ! switch (mode) { case GET: *************** *** 2294,2298 **** int flags = syminf.flags; if (!my_scope.nested_scopes) flags &= ~ScopeInfo.FREE; ! if ((flags&ScopeInfo.GLOBAL) !=0 || optimizeGlobals&&(flags&(ScopeInfo.BOUND|ScopeInfo.CELL|ScopeInfo.FREE))==0) { emitGetGlobal(name); --- 2294,2298 ---- int flags = syminf.flags; if (!my_scope.nested_scopes) flags &= ~ScopeInfo.FREE; ! if ((flags&ScopeInfo.GLOBAL) !=0 || optimizeGlobals&&(flags&(ScopeInfo.BOUND|ScopeInfo.CELL|ScopeInfo.FREE))==0) { emitGetGlobal(name); Index: CompilationContext.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/compiler/CompilationContext.java,v retrieving revision 2.1 retrieving revision 2.2 diff -C2 -d -r2.1 -r2.2 *** CompilationContext.java 2001/05/15 18:53:34 2.1 --- CompilationContext.java 2001/11/27 13:51:37 2.2 *************** *** 1,3 **** ! package org.python.compiler; --- 1,3 ---- ! package org.python.compiler; *************** *** 5,13 **** public interface CompilationContext { ! ! public Future getFutures(); public void error(String msg,boolean err,SimpleNode node) throws Exception; ! public String getFilename(); ! } \ No newline at end of file --- 5,13 ---- public interface CompilationContext { ! ! public Future getFutures(); public void error(String msg,boolean err,SimpleNode node) throws Exception; ! public String getFilename(); ! } Index: ConstantPool.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/compiler/ConstantPool.java,v retrieving revision 2.4 retrieving revision 2.5 diff -C2 -d -r2.4 -r2.5 *** ConstantPool.java 2001/10/28 17:13:42 2.4 --- ConstantPool.java 2001/11/27 13:51:37 2.5 *************** *** 79,83 **** sizes[index+1] = slots; index += slots; ! } //System.out.print("Constant: "); //for(int j=0; j<data.length; j++) --- 79,83 ---- sizes[index+1] = slots; index += slots; ! } //System.out.print("Constant: "); //for(int j=0; j<data.length; j++) *************** *** 90,94 **** tdata.writeByte(1); tdata.writeUTF(s); ! return addConstant(1); } --- 90,94 ---- tdata.writeByte(1); tdata.writeUTF(s); ! return addConstant(1); } *************** *** 97,101 **** tdata.writeByte(7); tdata.writeShort(c); ! return addConstant(1); } --- 97,101 ---- tdata.writeByte(7); tdata.writeShort(c); ! return addConstant(1); } *************** *** 171,175 **** sizes[index] = sigSize(type, true); //System.out.println("method: "+c+", "+name+", "+type+": "+index); ! return index; } --- 171,175 ---- sizes[index] = sigSize(type, true); //System.out.println("method: "+c+", "+name+", "+type+": "+index); ! return index; } *************** *** 185,196 **** int index = addConstant(1); sizes[index] = sigSize(type, true); ! return index; } public int String(String s) throws IOException { ! int i = UTF8(s); tdata.writeByte(8); tdata.writeShort(i); ! return addConstant(1); } --- 185,196 ---- int index = addConstant(1); sizes[index] = sigSize(type, true); ! return index; } public int String(String s) throws IOException { ! int i = UTF8(s); tdata.writeByte(8); tdata.writeShort(i); ! return addConstant(1); } *************** *** 198,202 **** tdata.writeByte(3); tdata.writeInt(i); ! return addConstant(1); } --- 198,202 ---- tdata.writeByte(3); tdata.writeInt(i); ! return addConstant(1); } *************** *** 204,208 **** tdata.writeByte(4); tdata.writeFloat(f); ! return addConstant(1); } --- 204,208 ---- tdata.writeByte(4); tdata.writeFloat(f); ! return addConstant(1); } *************** *** 210,214 **** tdata.writeByte(5); tdata.writeLong(l); ! return addConstant(2); } --- 210,214 ---- tdata.writeByte(5); tdata.writeLong(l); ! return addConstant(2); } *************** *** 216,220 **** tdata.writeByte(6); tdata.writeDouble(d); ! return addConstant(2); } --- 216,220 ---- tdata.writeByte(6); tdata.writeDouble(d); ! return addConstant(2); } *************** *** 226,230 **** tdata.writeShort(n); tdata.writeShort(t); ! return addConstant(1); } --- 226,230 ---- tdata.writeShort(n); tdata.writeShort(t); ! return addConstant(1); } Index: Future.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/compiler/Future.java,v retrieving revision 2.3 retrieving revision 2.4 diff -C2 -d -r2.3 -r2.4 *** Future.java 2001/05/27 18:49:15 2.3 --- Future.java 2001/11/27 13:51:37 2.4 *************** *** 10,21 **** private static final String FUTURE = "__future__"; ! private boolean check(SimpleNode cand) throws Exception { SimpleNode dotted_name = cand.getChild(0); ! if (dotted_name.getNumChildren() != 1 || !((String)dotted_name.getChild(0).getInfo()).equals(FUTURE)) return false; int n = cand.getNumChildren(); if (n == 1) { ! throw new ParseException("future statement does not support import *",cand); } for (int i = 1; i < n; i++) { --- 10,21 ---- private static final String FUTURE = "__future__"; ! private boolean check(SimpleNode cand) throws Exception { SimpleNode dotted_name = cand.getChild(0); ! if (dotted_name.getNumChildren() != 1 || !((String)dotted_name.getChild(0).getInfo()).equals(FUTURE)) return false; int n = cand.getNumChildren(); if (n == 1) { ! throw new ParseException("future statement does not support import *",cand); } for (int i = 1; i < n; i++) { *************** *** 30,34 **** feature = (String)imp.getChild(0).getInfo(); break; ! } // *known* features if (feature.equals("nested_scopes")) { --- 30,34 ---- feature = (String)imp.getChild(0).getInfo(); break; ! } // *known* features if (feature.equals("nested_scopes")) { *************** *** 37,59 **** } throw new ParseException("future feature "+feature+" is not defined",cand); ! } return true; } ! public void preprocessFutures(SimpleNode node,org.python.core.CompilerFlags cflags) throws Exception { if (cflags != null) { nested_scopes = cflags.nested_scopes; } ! ! if ( node.id != PythonGrammarTreeConstants.JJTFILE_INPUT && node.id != PythonGrammarTreeConstants.JJTSINGLE_INPUT) return; int n = node.getNumChildren(); if (n == 0) return; ! int beg = 0; if (node.id == PythonGrammarTreeConstants.JJTFILE_INPUT && node.getChild(0).id == PythonGrammarTreeConstants.JJTEXPR_STMT && node.getChild(0).getChild(0).id == PythonGrammarTreeConstants.JJTSTRING) beg++; ! for (int i = beg; i < n; i++) { SimpleNode stmt = node.getChild(i); --- 37,59 ---- } throw new ParseException("future feature "+feature+" is not defined",cand); ! } return true; } ! public void preprocessFutures(SimpleNode node,org.python.core.CompilerFlags cflags) throws Exception { if (cflags != null) { nested_scopes = cflags.nested_scopes; } ! ! if ( node.id != PythonGrammarTreeConstants.JJTFILE_INPUT && node.id != PythonGrammarTreeConstants.JJTSINGLE_INPUT) return; int n = node.getNumChildren(); if (n == 0) return; ! int beg = 0; if (node.id == PythonGrammarTreeConstants.JJTFILE_INPUT && node.getChild(0).id == PythonGrammarTreeConstants.JJTEXPR_STMT && node.getChild(0).getChild(0).id == PythonGrammarTreeConstants.JJTSTRING) beg++; ! for (int i = beg; i < n; i++) { SimpleNode stmt = node.getChild(i); *************** *** 62,72 **** if (!check(stmt)) break; } ! if (cflags != null) { cflags.nested_scopes = cflags.nested_scopes || nested_scopes; } } - public static void checkFromFuture(SimpleNode node) throws Exception { if (node.from_future_checked) return; --- 62,72 ---- if (!check(stmt)) break; } ! if (cflags != null) { cflags.nested_scopes = cflags.nested_scopes || nested_scopes; } } + public static void checkFromFuture(SimpleNode node) throws Exception { if (node.from_future_checked) return; *************** *** 75,81 **** throw new ParseException("from __future__ imports must occur at the beginning of the file",node); } ! node.from_future_checked = true; } ! public boolean areNestedScopesOn() { return nested_scopes; --- 75,81 ---- throw new ParseException("from __future__ imports must occur at the beginning of the file",node); } ! node.from_future_checked = true; } ! public boolean areNestedScopesOn() { return nested_scopes; Index: JavaMaker.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/compiler/JavaMaker.java,v retrieving revision 2.13 retrieving revision 2.14 diff -C2 -d -r2.13 -r2.14 *** JavaMaker.java 2001/11/21 11:22:45 2.13 --- JavaMaker.java 2001/11/27 13:51:37 2.14 *************** *** 16,20 **** PyObject methods; public boolean frozen, main; ! public JavaMaker(Class superclass, Class[] interfaces, String pythonClass, String pythonModule, String myClass, --- 16,20 ---- PyObject methods; public boolean frozen, main; ! public JavaMaker(Class superclass, Class[] interfaces, String pythonClass, String pythonModule, String myClass, *************** *** 24,28 **** null, null, methods, false, false); } ! public JavaMaker(Class superclass, Class[] interfaces, String pythonClass, String pythonModule, String myClass, --- 24,28 ---- null, null, methods, false, false); } ! public JavaMaker(Class superclass, Class[] interfaces, String pythonClass, String pythonModule, String myClass, *************** *** 121,126 **** } else if (methods.__finditem__(method.getName().intern()) != null) { super.addMethod(method, access); ! } else if (Modifier.isProtected(method.getModifiers())) { ! addSuperMethod(method, access); } } --- 121,126 ---- } else if (methods.__finditem__(method.getName().intern()) != null) { super.addMethod(method, access); ! } else if (Modifier.isProtected(method.getModifiers())) { ! addSuperMethod(method, access); } } *************** *** 138,142 **** */ ! public void addMain() throws Exception { Code code = classfile.addMethod("main", "([Ljava/lang/String;)V", --- 138,142 ---- */ ! public void addMain() throws Exception { Code code = classfile.addMethod("main", "([Ljava/lang/String;)V", Index: Label.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/compiler/Label.java,v retrieving revision 2.2 retrieving revision 2.3 diff -C2 -d -r2.2 -r2.3 *** Label.java 2001/10/28 17:13:42 2.2 --- Label.java 2001/11/27 13:51:37 2.3 *************** *** 12,16 **** Code code; int stack; ! public Label(Code code) { this.code = code; --- 12,16 ---- Code code; int stack; ! public Label(Code code) { this.code = code; *************** *** 64,68 **** return position; } ! public void setPosition() { position = code.size(); --- 64,68 ---- return position; } ! public void setPosition() { position = code.size(); Index: Module.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/compiler/Module.java,v retrieving revision 2.8 retrieving revision 2.9 diff -C2 -d -r2.8 -r2.9 *** Module.java 2001/10/28 17:13:42 2.8 --- Module.java 2001/11/27 13:51:37 2.9 *************** *** 7,11 **** import org.python.parser.*; ! class PyIntegerConstant extends Constant { int value; --- 7,11 ---- import org.python.parser.*; ! class PyIntegerConstant extends Constant { int value; *************** *** 193,202 **** public boolean arglist, keywordlist; String fname; ! // for nested scopes public String[] cellvars; public String[] freevars; public int jy_npurecell; ! public int moreflags; --- 193,202 ---- public boolean arglist, keywordlist; String fname; ! // for nested scopes public String[] cellvars; public String[] freevars; public int jy_npurecell; ! public int moreflags; *************** *** 233,244 **** c.iconst(id); ! if (cellvars != null) CodeCompiler.makeStrings(c, cellvars, cellvars.length); else c.aconst_null(); if (freevars != null) CodeCompiler.makeStrings(c, freevars, freevars.length); else c.aconst_null(); c.iconst(jy_npurecell); ! c.iconst(moreflags); ! int mref_newCode = c.pool.Methodref( "org/python/core/Py", --- 233,244 ---- c.iconst(id); ! if (cellvars != null) CodeCompiler.makeStrings(c, cellvars, cellvars.length); else c.aconst_null(); if (freevars != null) CodeCompiler.makeStrings(c, freevars, freevars.length); else c.aconst_null(); c.iconst(jy_npurecell); ! c.iconst(moreflags); ! int mref_newCode = c.pool.Methodref( "org/python/core/Py", *************** *** 332,336 **** return PyCode(tree, name, ac, fast_locals, class_body, printResults, 0); }*/ ! Vector codes; private boolean isJavaIdentifier(String s) { --- 332,336 ---- return PyCode(tree, name, ac, fast_locals, class_body, printResults, 0); }*/ ! Vector codes; private boolean isJavaIdentifier(String s) { *************** *** 340,344 **** if (!Character.isJavaIdentifierStart(chars[0])) return false; ! for(int i=1; i<chars.length; i++) { if (!Character.isJavaIdentifierPart(chars[i])) --- 340,344 ---- if (!Character.isJavaIdentifierStart(chars[0])) return false; ! for(int i=1; i<chars.length; i++) { if (!Character.isJavaIdentifierPart(chars[i])) *************** *** 349,353 **** private static final String[] emptyStringAr = new String[0]; ! private String[] toNameAr(Vector names,boolean nullok) { int sz = names.size(); --- 349,353 ---- private static final String[] emptyStringAr = new String[0]; ! private String[] toNameAr(Vector names,boolean nullok) { int sz = names.size(); *************** *** 357,362 **** return nameArray; } ! ! private int to_cell; --- 357,362 ---- return nameArray; } ! ! private int to_cell; *************** *** 370,377 **** } ! public PyCodeConstant PyCode(SimpleNode tree, String name, boolean fast_locals, String className, ! boolean classBody, boolean printResults, int firstlineno, ScopeInfo scope,org.python.core.CompilerFlags cflags) throws Exception --- 370,377 ---- } ! public PyCodeConstant PyCode(SimpleNode tree, String name, boolean fast_locals, String className, ! boolean classBody, boolean printResults, int firstlineno, ScopeInfo scope,org.python.core.CompilerFlags cflags) throws Exception *************** *** 379,383 **** PyCodeConstant code = new PyCodeConstant(); ArgListCompiler ac = (scope != null)?scope.ac:null; ! if (ac != null) { code.arglist = ac.arglist; --- 379,383 ---- PyCodeConstant code = new PyCodeConstant(); ArgListCompiler ac = (scope != null)?scope.ac:null; ! if (ac != null) { code.arglist = ac.arglist; *************** *** 385,389 **** code.argcount = ac.names.size(); } ! code.co_name = name; code.co_firstlineno = firstlineno; --- 385,389 ---- code.argcount = ac.names.size(); } ! code.co_name = name; code.co_firstlineno = firstlineno; *************** *** 410,414 **** tree = ac.init_code; } ! if (scope != null) { int nparamcell = scope.jy_paramcells.size(); --- 410,414 ---- tree = ac.init_code; } ! if (scope != null) { int nparamcell = scope.jy_paramcells.size(); *************** *** 433,437 **** // !classdef only if (!classBody) code.names = toNameAr(compiler.names,false); ! if (scope != null) { code.cellvars = toNameAr(scope.cellvars,true); --- 433,437 ---- // !classdef only if (!classBody) code.names = toNameAr(compiler.names,false); ! if (scope != null) { code.cellvars = toNameAr(scope.cellvars,true); *************** *** 446,450 **** code.moreflags |= org.python.core.PyTableCode.CO_NESTED; } ! code.module = this; code.name = code.fname; --- 446,450 ---- code.moreflags |= org.python.core.PyTableCode.CO_NESTED; } ! code.module = this; code.name = code.fname; Index: ProxyMaker.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/compiler/ProxyMaker.java,v retrieving revision 2.14 retrieving revision 2.15 diff -C2 -d -r2.14 -r2.15 *** ProxyMaker.java 2001/10/28 17:13:42 2.14 --- ProxyMaker.java 2001/11/27 13:51:37 2.15 *************** *** 55,59 **** public boolean isAdapter=false; ! // Ctor used by makeProxy and AdapterMaker. public ProxyMaker(String classname, Class superclass) { this.myClass = "org.python.proxies."+classname; --- 55,59 ---- public boolean isAdapter=false; ! // Ctor used by makeProxy and AdapterMaker. public ProxyMaker(String classname, Class superclass) { this.myClass = "org.python.proxies."+classname; *************** *** 236,240 **** } ! public void doJavaCall(Code code, String name, String type, String jcallName) throws Exception --- 236,240 ---- } ! public void doJavaCall(Code code, String name, String type, String jcallName) throws Exception *************** *** 243,251 **** "org/python/core/PyObject", jcallName, "([Ljava/lang/Object;)Lorg/python/core/PyObject;"); ! int py2j = code.pool.Methodref( "org/python/core/Py", "py2"+name, "(Lorg/python/core/PyObject;)"+type); ! code.invokevirtual(jcall); code.invokestatic(py2j); --- 243,251 ---- "org/python/core/PyObject", jcallName, "([Ljava/lang/Object;)Lorg/python/core/PyObject;"); ! int py2j = code.pool.Methodref( "org/python/core/Py", "py2"+name, "(Lorg/python/core/PyObject;)"+type); ! code.invokevirtual(jcall); code.invokestatic(py2j); *************** *** 387,392 **** Label forname_exch_start = code.getLabel(); Label forname_exch_end = code.getLabel(); ! forname_start.setPosition(); ! */ int forname = code.pool.Methodref( "java/lang/Class","forName", --- 387,392 ---- Label forname_exch_start = code.getLabel(); Label forname_exch_end = code.getLabel(); ! forname_start.setPosition(); ! */ int forname = code.pool.Methodref( "java/lang/Class","forName", *************** *** 403,409 **** code.dup(); forname_exch_end.setPosition(); ! code.addExceptionHandler(forname_start,forname_end,forname_exch_start,code.pool.Class("java/lang/ClassNotFoundException")); ! */ int tojava = code.pool.Methodref( "org/python/core/Py", "tojava", --- 403,409 ---- code.dup(); forname_exch_end.setPosition(); ! code.addExceptionHandler(forname_start,forname_end,forname_exch_start,code.pool.Class("java/lang/ClassNotFoundException")); ! */ int tojava = code.pool.Methodref( "org/python/core/Py", "tojava", *************** *** 451,460 **** code.aload(instLocal); code.aload(excLocal); ! int jthrow = code.pool.Methodref( "org/python/core/PyObject", "_jthrow", "(Ljava/lang/Throwable;)V"); code.invokevirtual(jthrow); ! code.addExceptionHandler(start, end, handlerStart, code.pool.Class("java/lang/Throwable")); --- 451,460 ---- code.aload(instLocal); code.aload(excLocal); ! int jthrow = code.pool.Methodref( "org/python/core/PyObject", "_jthrow", "(Ljava/lang/Throwable;)V"); code.invokevirtual(jthrow); ! code.addExceptionHandler(start, end, handlerStart, code.pool.Class("java/lang/Throwable")); *************** *** 466,474 **** } ! public void addMethod(Method method, int access) throws Exception { boolean isAbstract = false; ! if (Modifier.isAbstract(access)) { access = access & ~Modifier.ABSTRACT; isAbstract = true; --- 466,474 ---- } ! public void addMethod(Method method, int access) throws Exception { boolean isAbstract = false; ! if (Modifier.isAbstract(access)) { access = access & ~Modifier.ABSTRACT; isAbstract = true; *************** *** 514,518 **** callPython.setPosition(); code.aload(tmp); ! callMethod(code, name, parameters, ret, method.getExceptionTypes()); --- 514,518 ---- callPython.setPosition(); code.aload(tmp); ! callMethod(code, name, parameters, ret, method.getExceptionTypes()); *************** *** 572,585 **** continue; } ! if (Modifier.isNative(access)) { access = access & ~Modifier.NATIVE; } ! if (Modifier.isProtected(access)) { access = (access & ~Modifier.PROTECTED) | Modifier.PUBLIC; if (Modifier.isFinal(access)) { addSuperMethod(methods[i], access); ! continue; } } --- 572,585 ---- continue; } ! if (Modifier.isNative(access)) { access = access & ~Modifier.NATIVE; } ! if (Modifier.isProtected(access)) { access = (access & ~Modifier.PROTECTED) | Modifier.PUBLIC; if (Modifier.isFinal(access)) { addSuperMethod(methods[i], access); ! continue; } } *************** *** 644,654 **** String sig = makeSignature(parameters, ret); String superclass = mapClass(method.getDeclaringClass()); ! String superName = method.getName(); String methodName = superName; if (Modifier.isFinal(access)) { ! methodName = "super__"+superName; access &= ~Modifier.FINAL; ! } ! addSuperMethod(methodName, superName, superclass, parameters, ret, sig, access); } --- 644,654 ---- String sig = makeSignature(parameters, ret); String superclass = mapClass(method.getDeclaringClass()); ! String superName = method.getName(); String methodName = superName; if (Modifier.isFinal(access)) { ! methodName = "super__"+superName; access &= ~Modifier.FINAL; ! } ! addSuperMethod(methodName, superName, superclass, parameters, ret, sig, access); } *************** *** 702,706 **** code.getfield(field); code.areturn(); ! // implement PyProxy interface classfile.addField("__systemState", --- 702,706 ---- code.getfield(field); code.areturn(); ! // implement PyProxy interface classfile.addField("__systemState", Index: ScopeConstants.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/compiler/ScopeConstants.java,v retrieving revision 2.2 retrieving revision 2.3 diff -C2 -d -r2.2 -r2.3 *** ScopeConstants.java 2001/03/11 16:29:31 2.2 --- ScopeConstants.java 2001/11/27 13:51:37 2.3 *************** *** 2,6 **** public interface ScopeConstants { ! public final static int BOUND = 1; public final static int NGLOBAL = 2; // func scope expl global --- 2,6 ---- public interface ScopeConstants { ! public final static int BOUND = 1; public final static int NGLOBAL = 2; // func scope expl global *************** *** 11,15 **** public final static int CLASS_GLOBAL = 64; // class scope expl global public final static int GLOBAL = NGLOBAL|CLASS_GLOBAL; // all global ! public final static int TOPSCOPE = 0; public final static int FUNCSCOPE = 1; --- 11,15 ---- public final static int CLASS_GLOBAL = 64; // class scope expl global public final static int GLOBAL = NGLOBAL|CLASS_GLOBAL; // all global ! public final static int TOPSCOPE = 0; public final static int FUNCSCOPE = 1; Index: ScopeInfo.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/compiler/ScopeInfo.java,v retrieving revision 2.4 retrieving revision 2.5 diff -C2 -d -r2.4 -r2.5 *** ScopeInfo.java 2001/05/27 18:49:15 2.4 --- ScopeInfo.java 2001/11/27 13:51:37 2.5 *************** *** 23,27 **** System.err.print(name); if ((flags&BOUND) != 0) System.err.print('='); ! if ((flags&NGLOBAL) != 0) System.err.print('G'); else // func scope global (affect nested scopes) if ((flags&CLASS_GLOBAL) != 0) System.err.print('g'); // vs. class scope global if ((flags&PARAM) != 0) System.err.print('P'); else --- 23,27 ---- System.err.print(name); if ((flags&BOUND) != 0) System.err.print('='); ! if ((flags&NGLOBAL) != 0) System.err.print('G'); else // func scope global (affect nested scopes) if ((flags&CLASS_GLOBAL) != 0) System.err.print('g'); // vs. class scope global if ((flags&PARAM) != 0) System.err.print('P'); else *************** *** 31,37 **** System.err.print(" "); } ! System.err.println(); } ! public ScopeInfo(String name,SimpleNode node,int level,int kind,int func_level,ArgListCompiler ac,boolean nested_scopes) { scope_name = name; --- 31,37 ---- System.err.print(" "); } ! System.err.println(); } ! public ScopeInfo(String name,SimpleNode node,int level,int kind,int func_level,ArgListCompiler ac,boolean nested_scopes) { scope_name = name; *************** *** 43,59 **** this.nested_scopes = nested_scopes; } ! public int kind; public boolean nested_scopes; ! public boolean unqual_exec; public boolean exec; public boolean from_import_star; ! public ArgListCompiler ac; ! public Hashtable tbl = new Hashtable(); public Vector names = new Vector(); ! public int addGlobal(String name) { int global = kind==CLASSSCOPE?CLASS_GLOBAL:NGLOBAL; // global kind = func vs. class --- 43,59 ---- this.nested_scopes = nested_scopes; } ! public int kind; public boolean nested_scopes; ! public boolean unqual_exec; public boolean exec; public boolean from_import_star; ! public ArgListCompiler ac; ! public Hashtable tbl = new Hashtable(); public Vector names = new Vector(); ! public int addGlobal(String name) { int global = kind==CLASSSCOPE?CLASS_GLOBAL:NGLOBAL; // global kind = func vs. class *************** *** 67,78 **** return prev; } ! public int local = 0; ! public void addParam(String name) { tbl.put(name, new SymInfo(PARAM|BOUND,local++)); names.addElement(name); } ! public void markFromParam() { for (Enumeration e=tbl.elements(); e.hasMoreElements(); ) { --- 67,78 ---- return prev; } ! public int local = 0; ! public void addParam(String name) { tbl.put(name, new SymInfo(PARAM|BOUND,local++)); names.addElement(name); } ! public void markFromParam() { for (Enumeration e=tbl.elements(); e.hasMoreElements(); ) { *************** *** 81,85 **** } } ! public void addBound(String name) { SymInfo info = (SymInfo)tbl.get(name); --- 81,85 ---- } } ! public void addBound(String name) { SymInfo info = (SymInfo)tbl.get(name); *************** *** 90,94 **** info.flags |= BOUND; } ! public void addUsed(String name) { if (tbl.get(name) == null) { --- 90,94 ---- info.flags |= BOUND; } ! public void addUsed(String name) { if (tbl.get(name) == null) { *************** *** 99,116 **** private final static Object PRESENT = new Object(); ! public Hashtable inner_free = new Hashtable(); ! public Vector cellvars = new Vector(); ! public Vector jy_paramcells = new Vector(); ! public int jy_npurecell; ! public int cell; ! public void cook(ScopeInfo up,CompilationContext ctxt) throws Exception { if (up == null) return; // top level => nop ! boolean nested_scopes = this.nested_scopes; boolean func = kind == FUNCSCOPE; --- 99,116 ---- private final static Object PRESENT = new Object(); ! public Hashtable inner_free = new Hashtable(); ! public Vector cellvars = new Vector(); ! public Vector jy_paramcells = new Vector(); ! public int jy_npurecell; ! public int cell; ! public void cook(ScopeInfo up,CompilationContext ctxt) throws Exception { if (up == null) return; // top level => nop ! boolean nested_scopes = this.nested_scopes; boolean func = kind == FUNCSCOPE; *************** *** 118,122 **** cell = 0; boolean some_inner_free = inner_free.size() > 0; ! for (Enumeration e = inner_free.keys(); e.hasMoreElements(); ) { String name = (String)e.nextElement(); --- 118,122 ---- cell = 0; boolean some_inner_free = inner_free.size() > 0; ! for (Enumeration e = inner_free.keys(); e.hasMoreElements(); ) { String name = (String)e.nextElement(); *************** *** 131,135 **** if (nested_scopes) { info.flags |= CELL; ! if ((info.flags&PARAM) != 0) jy_paramcells.addElement(name); cellvars.addElement(name); info.env_index = cell++; --- 131,135 ---- if (nested_scopes) { info.flags |= CELL; ! if ((info.flags&PARAM) != 0) jy_paramcells.addElement(name); cellvars.addElement(name); info.env_index = cell++; *************** *** 144,148 **** } boolean some_free = false; ! boolean nested = up.kind != TOPSCOPE; for (Enumeration e = tbl.keys(); e.hasMoreElements(); ) { --- 144,148 ---- } boolean some_free = false; ! boolean nested = up.kind != TOPSCOPE; for (Enumeration e = tbl.keys(); e.hasMoreElements(); ) { *************** *** 173,177 **** else if(func_level > 1 && some_free) dynastuff_trouble(false, ctxt); } ! } --- 173,177 ---- else if(func_level > 1 && some_free) dynastuff_trouble(false, ctxt); } ! } *************** *** 190,194 **** ctxt.error(illegal + why ,nested_scopes,scope_node); } ! public Vector freevars = new Vector(); --- 190,194 ---- ctxt.error(illegal + why ,nested_scopes,scope_node); } ! public Vector freevars = new Vector(); *************** *** 214,224 **** info.flags = NGLOBAL|BOUND; continue; ! } } info.flags &= ~FREE; } } ! } ! } --- 214,224 ---- info.flags = NGLOBAL|BOUND; continue; ! } } info.flags &= ~FREE; } } ! } ! } Index: SymInfo.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/compiler/SymInfo.java,v retrieving revision 2.1 retrieving revision 2.2 diff -C2 -d -r2.1 -r2.2 *** SymInfo.java 2001/03/08 23:43:51 2.1 --- SymInfo.java 2001/11/27 13:51:37 2.2 *************** *** 1,3 **** ! package org.python.compiler; --- 1,3 ---- ! package org.python.compiler; *************** *** 7,19 **** this.flags = flags; } ! public SymInfo(int flags,int locals_index) { this.flags = flags; this.locals_index = locals_index; } ! public int flags; public int locals_index; public int env_index; ! } --- 7,19 ---- this.flags = flags; } ! public SymInfo(int flags,int locals_index) { this.flags = flags; this.locals_index = locals_index; } ! public int flags; public int locals_index; public int env_index; ! } |
Update of /cvsroot/jython/jython/org/python/core In directory usw-pr-cvs1:/tmp/cvs-serv9040/core Modified Files: CompilerFlags.java InternalTables.java Options.java PackageManager.java Py.java PyCell.java PyClass.java PyCode.java PyFrame.java PyFunction.java PyJavaInstance.java PyList.java PyModule.java PySystemState.java PyTableCode.java SyspathArchive.java __builtin__.java imp.java parser.java Log Message: Whitespace normalization. Index: CompilerFlags.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/core/CompilerFlags.java,v retrieving revision 2.2 retrieving revision 2.3 diff -C2 -d -r2.2 -r2.3 *** CompilerFlags.java 2001/07/25 18:48:43 2.2 --- CompilerFlags.java 2001/11/27 13:51:37 2.3 *************** *** 3,9 **** public class CompilerFlags extends Object { ! public CompilerFlags() {} ! public CompilerFlags(int co_flags) { if ((co_flags&org.python.core.PyTableCode.CO_NESTED) != 0) nested_scopes = true; --- 3,9 ---- public class CompilerFlags extends Object { ! public CompilerFlags() {} ! public CompilerFlags(int co_flags) { if ((co_flags&org.python.core.PyTableCode.CO_NESTED) != 0) nested_scopes = true; Index: InternalTables.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/core/InternalTables.java,v retrieving revision 2.9 retrieving revision 2.10 diff -C2 -d -r2.9 -r2.10 *** InternalTables.java 2001/07/27 15:46:33 2.9 --- InternalTables.java 2001/11/27 13:51:37 2.10 *************** *** 46,50 **** java.util.Properties registry = PySystemState.registry; if (registry == null) { ! throw new java.lang.IllegalStateException("Jython interpreter state not initialized. " + "You need to call PySystemState.initialize or PythonInterpreter.initialize."); } --- 46,50 ---- java.util.Properties registry = PySystemState.registry; if (registry == null) { ! throw new java.lang.IllegalStateException("Jython interpreter state not initialized. " + "You need to call PySystemState.initialize or PythonInterpreter.initialize."); } Index: Options.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/core/Options.java,v retrieving revision 2.9 retrieving revision 2.10 diff -C2 -d -r2.9 -r2.10 *** Options.java 2001/10/28 17:13:42 2.9 --- Options.java 2001/11/27 13:51:37 2.10 *************** *** 76,81 **** /** * If true, Jython will use the first module found on sys.path ! * where java File.isFile() returns true. Setting this to true ! * have no effect on unix-type filesystems. On Windows/HPS+ * systems setting it to true will enable Jython-2.0 behaviour. */ --- 76,81 ---- /** * If true, Jython will use the first module found on sys.path ! * where java File.isFile() returns true. Setting this to true ! * have no effect on unix-type filesystems. On Windows/HPS+ * systems setting it to true will enable Jython-2.0 behaviour. */ Index: PackageManager.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/core/PackageManager.java,v retrieving revision 2.10 retrieving revision 2.11 diff -C2 -d -r2.10 -r2.11 *** PackageManager.java 2001/10/28 17:13:42 2.10 --- PackageManager.java 2001/11/27 13:51:37 2.11 *************** *** 46,50 **** * Append a directory to the list of directories searched for * java packages and java classes. ! * * @param dir A directory. */ --- 46,50 ---- * Append a directory to the list of directories searched for * java packages and java classes. ! * * @param dir A directory. */ *************** *** 54,58 **** * Append a directory to the list of directories searched for * java packages and java classes. ! * * @param dir A directory name. */ --- 54,58 ---- * Append a directory to the list of directories searched for * java packages and java classes. ! * * @param dir A directory name. */ *************** *** 62,66 **** * Append a jar file to the list of locations searched for * java packages and java classes. ! * * @param jarfile A directory name. */ --- 62,66 ---- * Append a jar file to the list of locations searched for * java packages and java classes. ! * * @param jarfile A directory name. */ Index: Py.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/core/Py.java,v retrieving revision 2.56 retrieving revision 2.57 diff -C2 -d -r2.56 -r2.57 *** Py.java 2001/11/26 11:00:24 2.56 --- Py.java 2001/11/27 13:51:37 2.57 *************** *** 241,245 **** warning(RuntimeWarning, message); } ! private static PyObject warnings_mod; private static PyObject importWarnings() { --- 241,245 ---- warning(RuntimeWarning, message); } ! private static PyObject warnings_mod; private static PyObject importWarnings() { *************** *** 257,261 **** return mod; } ! private static String warn_hcategory(PyObject category) { PyObject name = category.__findattr__("__name__"); --- 257,261 ---- return mod; } ! private static String warn_hcategory(PyObject category) { PyObject name = category.__findattr__("__name__"); *************** *** 263,267 **** return "[warning]"; } ! public static void warning(PyObject category, String message) { PyObject func = null; --- 263,267 ---- return "[warning]"; } ! public static void warning(PyObject category, String message) { PyObject func = null; *************** *** 286,290 **** return; } else { ! func.__call__(new PyObject[] {Py.newString(message), category, Py.newString(filename), Py.newInteger(lineno), (module == null)?Py.None:Py.newString(module), registry}, Py.NoKeywords); --- 286,290 ---- return; } else { ! func.__call__(new PyObject[] {Py.newString(message), category, Py.newString(filename), Py.newInteger(lineno), (module == null)?Py.None:Py.newString(module), registry}, Py.NoKeywords); *************** *** 292,296 **** } ! public static PyObject JavaError; public static PyException JavaError(Throwable t) { --- 292,296 ---- } ! public static PyObject JavaError; public static PyException JavaError(Throwable t) { *************** *** 459,465 **** funcs, func_id, cellvars, freevars, npurecell,moreflags); } ! // -- ! public static PyCode newCode(int argcount, String varnames[], String filename, String name, --- 459,465 ---- funcs, func_id, cellvars, freevars, npurecell,moreflags); } ! // -- ! public static PyCode newCode(int argcount, String varnames[], String filename, String name, *************** *** 489,493 **** public static PyObject newJavaFunc(Class cls, String name) { try { ! java.lang.reflect.Method m = cls.getMethod(name, new Class[] { PyObject[].class, String[].class }); return new JavaFunc(m); --- 489,493 ---- public static PyObject newJavaFunc(Class cls, String name) { try { ! java.lang.reflect.Method m = cls.getMethod(name, new Class[] { PyObject[].class, String[].class }); return new JavaFunc(m); *************** *** 910,914 **** displayException(exc.type, exc.value, exc.traceback); } - ts.exception = null; --- 910,913 ---- *************** *** 1405,1409 **** return makeClass(name, bases, code, doc, null, null); } ! public static PyObject makeClass(String name, PyObject[] bases, PyCode code, PyObject doc,PyObject[] closure_cells) --- 1404,1408 ---- return makeClass(name, bases, code, doc, null, null); } ! public static PyObject makeClass(String name, PyObject[] bases, PyCode code, PyObject doc,PyObject[] closure_cells) *************** *** 1412,1425 **** } ! public static PyObject makeClass(String name, PyObject[] bases, PyCode code, PyObject doc, Class proxyClass) { ! return makeClass(name, bases, code, doc, proxyClass, null); } private static Class[] pyClassCtrSignature = {String.class,PyTuple.class,PyObject.class,Class.class}; ! public static PyObject makeClass(String name, PyObject[] bases, PyCode code, PyObject doc, --- 1411,1424 ---- } ! public static PyObject makeClass(String name, PyObject[] bases, PyCode code, PyObject doc, Class proxyClass) { ! return makeClass(name, bases, code, doc, proxyClass, null); } private static Class[] pyClassCtrSignature = {String.class,PyTuple.class,PyObject.class,Class.class}; ! public static PyObject makeClass(String name, PyObject[] bases, PyCode code, PyObject doc, *************** *** 1457,1461 **** } } ! } --- 1456,1460 ---- } } ! } *************** *** 1477,1485 **** cflags = new CompilerFlags(frame.f_code.co_flags); } ! return cflags; } ! // w/o compiler-flags ! public static PyCode compile(SimpleNode node, String filename) { return compile(node, getName(), filename); --- 1476,1484 ---- cflags = new CompilerFlags(frame.f_code.co_flags); } ! return cflags; } ! // w/o compiler-flags ! public static PyCode compile(SimpleNode node, String filename) { return compile(node, getName(), filename); *************** *** 1499,1503 **** return compile_flags(node,name,filename,linenumbers,printResults,null); } ! public static PyCode compile(InputStream istream, String filename, String type) --- 1498,1502 ---- return compile_flags(node,name,filename,linenumbers,printResults,null); } ! public static PyCode compile(InputStream istream, String filename, String type) *************** *** 1505,1511 **** return compile_flags(istream,filename,type,null); } ! // with compiler-flags ! public static PyCode compile_flags(SimpleNode node, String name, String filename, --- 1504,1510 ---- return compile_flags(istream,filename,type,null); } ! // with compiler-flags ! public static PyCode compile_flags(SimpleNode node, String name, String filename, *************** *** 1536,1545 **** return Py.compile_flags(node, getName(), filename, true, printResults,cflags); } ! public static PyCode compile_flags(String data, String filename, String type,CompilerFlags cflags) { return Py.compile_flags(new java.io.StringBufferInputStream(data+"\n\n"), filename, type,cflags); } ! public static PyObject[] unpackSequence(PyObject o, int length) { if (o instanceof PyTuple) { --- 1535,1544 ---- return Py.compile_flags(node, getName(), filename, true, printResults,cflags); } ! public static PyCode compile_flags(String data, String filename, String type,CompilerFlags cflags) { return Py.compile_flags(new java.io.StringBufferInputStream(data+"\n\n"), filename, type,cflags); } ! public static PyObject[] unpackSequence(PyObject o, int length) { if (o instanceof PyTuple) { *************** *** 1728,1732 **** /** ! * A function object wrapper for a java method which comply with the * PyArgsKeywordsCall standard. */ --- 1727,1731 ---- /** ! * A function object wrapper for a java method which comply with the * PyArgsKeywordsCall standard. */ Index: PyCell.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/core/PyCell.java,v retrieving revision 2.1 retrieving revision 2.2 diff -C2 -d -r2.1 -r2.2 *** PyCell.java 2001/03/08 23:43:51 2.1 --- PyCell.java 2001/11/27 13:51:37 2.2 *************** *** 1,3 **** ! package org.python.core; --- 1,3 ---- ! package org.python.core; *************** *** 5,8 **** public PyObject ob_ref; ! } --- 5,8 ---- public PyObject ob_ref; ! } Index: PyClass.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/core/PyClass.java,v retrieving revision 2.26 retrieving revision 2.27 diff -C2 -d -r2.26 -r2.27 *** PyClass.java 2001/10/28 17:13:43 2.26 --- PyClass.java 2001/11/27 13:51:37 2.27 *************** *** 236,240 **** return; } ! __dict__.__setitem__(name, value); } --- 236,240 ---- return; } ! __dict__.__setitem__(name, value); } Index: PyCode.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/core/PyCode.java,v retrieving revision 2.6 retrieving revision 2.7 diff -C2 -d -r2.6 -r2.7 *** PyCode.java 2001/10/28 17:13:43 2.6 --- PyCode.java 2001/11/27 13:51:37 2.7 *************** *** 8,14 **** { public String co_name; ! abstract public PyObject call(PyFrame frame, PyObject closure); ! public PyObject call(PyFrame frame) { return call(frame,null); } // commodity --- 8,14 ---- { public String co_name; ! abstract public PyObject call(PyFrame frame, PyObject closure); ! public PyObject call(PyFrame frame) { return call(frame,null); } // commodity Index: PyFrame.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/core/PyFrame.java,v retrieving revision 2.11 retrieving revision 2.12 diff -C2 -d -r2.11 -r2.12 *** PyFrame.java 2001/10/28 17:13:43 2.11 --- PyFrame.java 2001/11/27 13:51:37 2.12 *************** *** 19,23 **** public int f_ncells; public int f_nfreevars; ! // an interface to functions suitable for tracing, e.g. via sys.settrace() public TraceFunction tracefunc; --- 19,23 ---- public int f_ncells; public int f_nfreevars; ! // an interface to functions suitable for tracing, e.g. via sys.settrace() public TraceFunction tracefunc; *************** *** 131,135 **** PyObject v = f_env[j].ob_ref; if (v != null) f_locals.__setitem__(f_code.co_freevars[i],v); ! } } return f_locals; --- 131,135 ---- PyObject v = f_env[j].ob_ref; if (v != null) f_locals.__setitem__(f_code.co_freevars[i],v); ! } } return f_locals; *************** *** 212,218 **** if (f_fastlocals != null) { if (f_fastlocals[index] == null) { ! throw Py.UnboundLocalError("local: '"+f_code.co_varnames[index]+"'"); } ! f_fastlocals[index] = null; } else dellocal(f_code.co_varnames[index]); --- 212,218 ---- if (f_fastlocals != null) { if (f_fastlocals[index] == null) { ! throw Py.UnboundLocalError("local: '"+f_code.co_varnames[index]+"'"); } ! f_fastlocals[index] = null; } else dellocal(f_code.co_varnames[index]); *************** *** 226,230 **** } catch(PyException e) { if (!Py.matchException(e,Py.KeyError)) throw e; ! throw Py.UnboundLocalError("local: '"+index+"'"); } } --- 226,230 ---- } catch(PyException e) { if (!Py.matchException(e,Py.KeyError)) throw e; ! throw Py.UnboundLocalError("local: '"+index+"'"); } } *************** *** 233,243 **** f_globals.__delitem__(index); } ! // nested scopes helpers ! public PyObject getclosure(int index) { return f_env[index]; } ! public PyObject getderef(int index) { PyObject obj=f_env[index].ob_ref; --- 233,243 ---- f_globals.__delitem__(index); } ! // nested scopes helpers ! public PyObject getclosure(int index) { return f_env[index]; } ! public PyObject getderef(int index) { PyObject obj=f_env[index].ob_ref; *************** *** 246,259 **** if (index >= f_ncells) name = f_code.co_freevars[index-f_ncells]; else name = f_code.co_cellvars[index]; ! throw Py.UnboundLocalError("local: '"+name+"'"); } ! public void setderef(int index,PyObject value) { f_env[index].ob_ref = value; } ! public void to_cell(int parm_index,int env_index) { ! f_env[env_index].ob_ref=f_fastlocals[parm_index]; } - } --- 246,258 ---- if (index >= f_ncells) name = f_code.co_freevars[index-f_ncells]; else name = f_code.co_cellvars[index]; ! throw Py.UnboundLocalError("local: '"+name+"'"); } ! public void setderef(int index,PyObject value) { f_env[index].ob_ref = value; } ! public void to_cell(int parm_index,int env_index) { ! f_env[env_index].ob_ref=f_fastlocals[parm_index]; } } Index: PyFunction.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/core/PyFunction.java,v retrieving revision 2.12 retrieving revision 2.13 diff -C2 -d -r2.12 -r2.13 *** PyFunction.java 2001/10/28 17:13:43 2.12 --- PyFunction.java 2001/11/27 13:51:37 2.13 *************** *** 38,46 **** this(globals,defaults,code,doc,null); } ! public PyFunction(PyObject globals, PyObject[] defaults, PyCode code) { this(globals, defaults, code, null,null); } ! public PyFunction(PyObject globals, PyObject[] defaults, PyCode code, PyObject[] closure_cells) { this(globals, defaults, code, null,closure_cells); --- 38,46 ---- this(globals,defaults,code,doc,null); } ! public PyFunction(PyObject globals, PyObject[] defaults, PyCode code) { this(globals, defaults, code, null,null); } ! public PyFunction(PyObject globals, PyObject[] defaults, PyCode code, PyObject[] closure_cells) { this(globals, defaults, code, null,closure_cells); Index: PyJavaInstance.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/core/PyJavaInstance.java,v retrieving revision 2.7 retrieving revision 2.8 diff -C2 -d -r2.7 -r2.8 *** PyJavaInstance.java 2001/10/28 17:13:43 2.7 --- PyJavaInstance.java 2001/11/27 13:51:37 2.8 *************** *** 28,32 **** * Implementation of the Externalizable interface. * @param in the input stream. ! * @exception java.io.IOException * @exception ClassNotFoundException */ --- 28,32 ---- * Implementation of the Externalizable interface. * @param in the input stream. ! * @exception java.io.IOException * @exception ClassNotFoundException */ *************** *** 42,46 **** * Implementation of the Externalizable interface. * @param out the output stream. ! * @exception java.io.IOException */ public void writeExternal(java.io.ObjectOutput out) --- 42,46 ---- * Implementation of the Externalizable interface. * @param out the output stream. ! * @exception java.io.IOException */ public void writeExternal(java.io.ObjectOutput out) Index: PyList.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/core/PyList.java,v retrieving revision 2.24 retrieving revision 2.25 diff -C2 -d -r2.24 -r2.25 *** PyList.java 2001/10/28 17:13:43 2.24 --- PyList.java 2001/11/27 13:51:37 2.25 *************** *** 370,374 **** /** ! * Insert the argument element into the list at the specified * index. * <br> --- 370,374 ---- /** ! * Insert the argument element into the list at the specified * index. * <br> *************** *** 402,406 **** /** * Reverses the items of s in place. ! * The reverse() methods modify the list in place for economy * of space when reversing a large list. It doesn't return the * reversed list to remind you of this side effect. --- 402,406 ---- /** * Reverses the items of s in place. ! * The reverse() methods modify the list in place for economy * of space when reversing a large list. It doesn't return the * reversed list to remind you of this side effect. *************** *** 666,676 **** * Sort the items of the list in place. The compare argument is a * function of two arguments (list items) which should return ! * -1, 0 or 1 depending on whether the first argument is ! * considered smaller than, equal to, or larger than the second * argument. Note that this slows the sorting process down * considerably; e.g. to sort a list in reverse order it is much ! * faster to use calls to the methods sort() and reverse() than * to use the built-in function sort() with a comparison function ! * that reverses the ordering of the elements. * * @param compare the comparison function. --- 666,676 ---- * Sort the items of the list in place. The compare argument is a * function of two arguments (list items) which should return ! * -1, 0 or 1 depending on whether the first argument is ! * considered smaller than, equal to, or larger than the second * argument. Note that this slows the sorting process down * considerably; e.g. to sort a list in reverse order it is much ! * faster to use calls to the methods sort() and reverse() than * to use the built-in function sort() with a comparison function ! * that reverses the ordering of the elements. * * @param compare the comparison function. Index: PyModule.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/core/PyModule.java,v retrieving revision 2.13 retrieving revision 2.14 diff -C2 -d -r2.13 -r2.14 *** PyModule.java 2001/10/28 17:13:43 2.13 --- PyModule.java 2001/11/27 13:51:37 2.14 *************** *** 25,29 **** PyObject ret = null; ! if (path == Py.None) { /* disabled: --- 25,29 ---- PyObject ret = null; ! if (path == Py.None) { /* disabled: *************** *** 45,49 **** if (ret != null) { ! // Allow a package component to change its own meaning PyObject tmp = Py.getSystemState().modules.__finditem__(fullName); if (tmp != null) ret = tmp; --- 45,49 ---- if (ret != null) { ! // Allow a package component to change its own meaning PyObject tmp = Py.getSystemState().modules.__finditem__(fullName); if (tmp != null) ret = tmp; Index: PySystemState.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/core/PySystemState.java,v retrieving revision 2.66 retrieving revision 2.67 diff -C2 -d -r2.66 -r2.67 *** PySystemState.java 2001/11/26 11:04:15 2.66 --- PySystemState.java 2001/11/27 13:51:37 2.67 *************** *** 26,30 **** private static int PY_RELEASE_SERIAL = 1; ! public static int hexversion = ((PY_MAJOR_VERSION << 24) | (PY_MINOR_VERSION << 16) | (PY_MICRO_VERSION << 8) | --- 26,30 ---- private static int PY_RELEASE_SERIAL = 1; ! public static int hexversion = ((PY_MAJOR_VERSION << 24) | (PY_MINOR_VERSION << 16) | (PY_MICRO_VERSION << 8) | *************** *** 548,559 **** /** * Add a classpath directory to the list of places that are searched ! * for java packages. * <p> ! * <b>Note</b>. Classes found in directory and subdirectory are not ! * made available to jython by this call. It only make the java * package found ion the directory available. This call is mostly * usefull if jython is embedded in an application that deals with * its own classloaders. A servlet container is a very good example. ! * Calling add_classdir("<context>/WEB-INF/classes") makes the java * packages in WEB-INF classes available to jython import. However the * actual classloading is completely handled by the servlet container's --- 548,559 ---- /** * Add a classpath directory to the list of places that are searched ! * for java packages. * <p> ! * <b>Note</b>. Classes found in directory and subdirectory are not ! * made available to jython by this call. It only make the java * package found ion the directory available. This call is mostly * usefull if jython is embedded in an application that deals with * its own classloaders. A servlet container is a very good example. ! * Calling add_classdir("<context>/WEB-INF/classes") makes the java * packages in WEB-INF classes available to jython import. However the * actual classloading is completely handled by the servlet container's *************** *** 567,571 **** * Add a .jar & .zip directory to the list of places that are searched * for java .jar and .zip files. The .jar and .zip files found will be ! * cached * <p> * <b>Note</b>. Classes in .jar and .zip files found in the directory --- 567,571 ---- * Add a .jar & .zip directory to the list of places that are searched * for java .jar and .zip files. The .jar and .zip files found will be ! * cached * <p> * <b>Note</b>. Classes in .jar and .zip files found in the directory Index: PyTableCode.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/core/PyTableCode.java,v retrieving revision 2.16 retrieving revision 2.17 diff -C2 -d -r2.16 -r2.17 *** PyTableCode.java 2001/10/28 17:13:43 2.16 --- PyTableCode.java 2001/11/27 13:51:37 2.17 *************** *** 25,33 **** final public static int CO_OPTIMIZED = 0x0001; //final public static int CO_NEWLOCALS = 0x0002 ! final public static int CO_VARARGS = 0x0004; final public static int CO_VARKEYWORDS = 0x0008; final public static int CO_NESTED = 0x0010; ! public PyTableCode(int argcount, String varnames[], String filename, String name, --- 25,33 ---- final public static int CO_OPTIMIZED = 0x0001; //final public static int CO_NEWLOCALS = 0x0002 ! final public static int CO_VARARGS = 0x0004; final public static int CO_VARKEYWORDS = 0x0008; final public static int CO_NESTED = 0x0010; ! public PyTableCode(int argcount, String varnames[], String filename, String name, *************** *** 38,42 **** this(argcount,varnames,filename,name,firstlineno,args,keywords,funcs,func_id,null,null,0,0); } ! public PyTableCode(int argcount, String varnames[], String filename, String name, --- 38,42 ---- this(argcount,varnames,filename,name,firstlineno,args,keywords,funcs,func_id,null,null,0,0); } ! public PyTableCode(int argcount, String varnames[], String filename, String name, *************** *** 110,114 **** return new PyTuple(pystr); } ! public PyObject __findattr__(String name) { // have to craft co_varnames specially --- 110,114 ---- return new PyTuple(pystr); } ! public PyObject __findattr__(String name) { // have to craft co_varnames specially *************** *** 153,158 **** env[env_j] = (PyCell)freevars.get(i); } ! ! ts.frame = frame; --- 153,157 ---- env[env_j] = (PyCell)freevars.get(i); } ! ts.frame = frame; Index: SyspathArchive.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/core/SyspathArchive.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SyspathArchive.java 2001/11/27 11:22:07 1.2 --- SyspathArchive.java 2001/11/27 13:51:37 1.3 *************** *** 89,92 **** } } ! */ } --- 89,92 ---- } } ! */ } Index: __builtin__.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/core/__builtin__.java,v retrieving revision 2.37 retrieving revision 2.38 diff -C2 -d -r2.37 -r2.38 *** __builtin__.java 2001/10/28 17:13:43 2.37 --- __builtin__.java 2001/11/27 13:51:37 2.38 *************** *** 131,135 **** dict.__setitem__("id", new BuiltinFunctions("id", 11, 1)); dict.__setitem__("__import__", new ImportFunction()); ! dict.__delitem__("execfile_flags"); // -execfile_flags } --- 131,135 ---- dict.__setitem__("id", new BuiltinFunctions("id", 11, 1)); dict.__setitem__("__import__", new ImportFunction()); ! dict.__delitem__("execfile_flags"); // -execfile_flags } *************** *** 211,215 **** } ! public static PyCode compile(String data, String filename, String type) { return Py.compile_flags(data,filename,type,Py.getCompilerFlags()); } --- 211,215 ---- } ! public static PyCode compile(String data, String filename, String type) { return Py.compile_flags(data,filename,type,Py.getCompilerFlags()); } *************** *** 282,287 **** execfile_flags(name,globals,locals,Py.getCompilerFlags()); } ! ! public static void execfile_flags(String name, PyObject globals, PyObject locals,CompilerFlags cflags) --- 282,287 ---- execfile_flags(name,globals,locals,Py.getCompilerFlags()); } ! ! public static void execfile_flags(String name, PyObject globals, PyObject locals,CompilerFlags cflags) *************** *** 310,314 **** execfile(name, globals, globals); } ! public static void execfile(String name) { execfile(name, null, null); --- 310,314 ---- execfile(name, globals, globals); } ! public static void execfile(String name) { execfile(name, null, null); *************** *** 581,585 **** * Open a file read-only. * @param name the file to open. ! * @exception java.io.IOException */ public static PyFile open(String name) throws java.io.IOException { --- 581,585 ---- * Open a file read-only. * @param name the file to open. ! * @exception java.io.IOException */ public static PyFile open(String name) throws java.io.IOException { *************** *** 591,595 **** * @param name name of the file to open. * @param mode open mode of the file. Use "r", "w", "r+", "w+" and "a". ! * @exception java.io.IOException */ public static PyFile open(String name, String mode) --- 591,595 ---- * @param name name of the file to open. * @param mode open mode of the file. Use "r", "w", "r+", "w+" and "a". ! * @exception java.io.IOException */ public static PyFile open(String name, String mode) *************** *** 604,608 **** * @param mode open mode of the file. Use "r", "w", "r+", "w+" and "a". * @param bufsize size of the internal buffer. Not currently used. ! * @exception java.io.IOException */ public static PyFile open(String name, String mode, int bufsize) --- 604,608 ---- * @param mode open mode of the file. Use "r", "w", "r+", "w+" and "a". * @param bufsize size of the internal buffer. Not currently used. ! * @exception java.io.IOException */ public static PyFile open(String name, String mode, int bufsize) Index: imp.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/core/imp.java,v retrieving revision 2.55 retrieving revision 2.56 diff -C2 -d -r2.55 -r2.56 *** imp.java 2001/11/27 11:22:07 2.55 --- imp.java 2001/11/27 13:51:37 2.56 *************** *** 287,291 **** String pyName = entryName +".py"; String className = entryName +"$py.class"; ! try { String sourceName = entryName + "/__init__.py"; --- 287,291 ---- String pyName = entryName +".py"; String className = entryName +"$py.class"; ! try { String sourceName = entryName + "/__init__.py"; *************** *** 306,310 **** } } ! ZipEntry pyEntry = zipArchive.getEntry(pyName); ZipEntry classEntry = zipArchive.getEntry(className); --- 306,310 ---- } } ! ZipEntry pyEntry = zipArchive.getEntry(pyName); ZipEntry classEntry = zipArchive.getEntry(className); *************** *** 337,341 **** return null; } ! private static boolean isSyspathArchive(PyObject entry, boolean isDir) { if (entry instanceof SyspathArchive) --- 337,341 ---- return null; } ! private static boolean isSyspathArchive(PyObject entry, boolean isDir) { if (entry instanceof SyspathArchive) *************** *** 389,393 **** } } ! PyObject ret = loadFromZipFile(name, modName, (SyspathArchive)entry); --- 389,393 ---- } } ! PyObject ret = loadFromZipFile(name, modName, (SyspathArchive)entry); *************** *** 497,501 **** Py.writeComment("import", "'" + name + "' not found (=> ImportError)"); return null; - } --- 497,500 ---- *************** *** 526,530 **** PyObject modules = Py.getSystemState().modules; PyObject ret = modules.__finditem__(fullName); ! if (ret != null) return ret; if (mod == null) { ret = load(name.intern(), Py.getSystemState().path); // ?? intern superfluous? --- 525,529 ---- PyObject modules = Py.getSystemState().modules; PyObject ret = modules.__finditem__(fullName); ! if (ret != null) return ret; if (mod == null) { ret = load(name.intern(), Py.getSystemState().path); // ?? intern superfluous? *************** *** 535,539 **** if (modules.__finditem__(fullName) == null) modules.__setitem__(fullName, ret); else ret = modules.__finditem__(fullName); ! return ret; } --- 534,538 ---- if (modules.__finditem__(fullName) == null) modules.__setitem__(fullName, ret); else ret = modules.__finditem__(fullName); ! return ret; } *************** *** 542,550 **** PyObject ret = import_next(null,parentNameBuffer,name); if (ret == null || ret == Py.None) throw Py.ImportError("no module named "+name); ! return ret; } ! // Hierarchy-recursively search for dotted name in mod; never returns null or None ! // ??pending: check if result is really a module/jpkg/jclass? private static PyObject import_logic(PyObject mod, StringBuffer parentNameBuffer, String dottedName) { int dot = 0; --- 541,549 ---- PyObject ret = import_next(null,parentNameBuffer,name); if (ret == null || ret == Py.None) throw Py.ImportError("no module named "+name); ! return ret; } ! // Hierarchy-recursively search for dotted name in mod; never returns null or None ! // ??pending: check if result is really a module/jpkg/jclass? private static PyObject import_logic(PyObject mod, StringBuffer parentNameBuffer, String dottedName) { int dot = 0; *************** *** 590,594 **** } parentNameBuffer = new StringBuffer(""); ! topMod = import_first(firstName,parentNameBuffer); // could throw ImportError } PyObject mod = topMod; --- 589,593 ---- } parentNameBuffer = new StringBuffer(""); ! topMod = import_first(firstName,parentNameBuffer); // could throw ImportError } PyObject mod = topMod; *************** *** 606,610 **** return import_name(name,top,modDict); } ! /** * Called from jpython generated code when a statement like "import spam" --- 605,609 ---- return import_name(name,top,modDict); } ! /** * Called from jpython generated code when a statement like "import spam" Index: parser.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/core/parser.java,v retrieving revision 2.12 retrieving revision 2.13 diff -C2 -d -r2.12 -r2.13 *** parser.java 2001/10/28 17:13:44 2.12 --- parser.java 2001/11/27 13:51:37 2.13 *************** *** 97,101 **** reader = new InputStreamReader(istream); } ! //if (Options.fixMacReaderBug); reader = new FixMacReaderBug(reader); --- 97,101 ---- reader = new InputStreamReader(istream); } ! //if (Options.fixMacReaderBug); reader = new FixMacReaderBug(reader); |
From: Finn B. <bc...@us...> - 2001-11-27 13:51:41
|
Update of /cvsroot/jython/jython/org/python/util In directory usw-pr-cvs1:/tmp/cvs-serv9040/util Modified Files: InteractiveConsole.java InteractiveInterpreter.java PyServlet.java PythonInterpreter.java PythonObjectInputStream.java ReadlineConsole.java jython.java Log Message: Whitespace normalization. Index: InteractiveConsole.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/util/InteractiveConsole.java,v retrieving revision 2.8 retrieving revision 2.9 diff -C2 -d -r2.8 -r2.9 *** InteractiveConsole.java 2001/10/28 17:13:44 2.8 --- InteractiveConsole.java 2001/11/27 13:51:38 2.9 *************** *** 34,38 **** public static String getDefaultBanner() { String compiler = System.getProperty("java.compiler"); ! return "Jython " + PySystemState.version + " on " + PySystemState.platform + " (JIT: " + --- 34,38 ---- public static String getDefaultBanner() { String compiler = System.getProperty("java.compiler"); ! return "Jython " + PySystemState.version + " on " + PySystemState.platform + " (JIT: " + Index: InteractiveInterpreter.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/util/InteractiveInterpreter.java,v retrieving revision 2.6 retrieving revision 2.7 diff -C2 -d -r2.6 -r2.7 *** InteractiveInterpreter.java 2001/10/28 17:13:44 2.6 --- InteractiveInterpreter.java 2001/11/27 13:51:38 2.7 *************** *** 110,114 **** buffer.setLength(0); } ! /** Pause the current code, sneak an exception raiser into * sys.trace_func, and then continue the code hoping that JPython will --- 110,114 ---- buffer.setLength(0); } ! /** Pause the current code, sneak an exception raiser into * sys.trace_func, and then continue the code hoping that JPython will *************** *** 123,127 **** ts.systemState.tracefunc = oldTrace; //ts.thread.join(); ! } } --- 123,127 ---- ts.systemState.tracefunc = oldTrace; //ts.thread.join(); ! } } Index: PyServlet.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/util/PyServlet.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** PyServlet.java 2001/07/18 15:53:56 1.11 --- PyServlet.java 2001/11/27 13:51:38 1.12 *************** *** 9,13 **** ! /** * This servlet is used to re-serve JPython servlets. It stores * bytecode for JPython servlets and re-uses it if the underlying .py --- 9,13 ---- ! /** * This servlet is used to re-serve JPython servlets. It stores * bytecode for JPython servlets and re-uses it if the underlying .py *************** *** 20,24 **** * <li>Finn Bock * </ul> ! * If somebody is missing from this list, let us know. * <p> * --- 20,24 ---- * <li>Finn Bock * </ul> ! * If somebody is missing from this list, let us know. * <p> * *************** *** 77,81 **** props.put(name, getInitParameter(name)); } ! if (props.getProperty("python.home") == null && System.getProperty("python.home") == null) { props.put("python.home", rootPath + "WEB-INF" + --- 77,81 ---- props.put(name, getInitParameter(name)); } ! if (props.getProperty("python.home") == null && System.getProperty("python.home") == null) { props.put("python.home", rootPath + "WEB-INF" + *************** *** 123,127 **** interp.set("__file__", rpath); ! HttpServlet servlet = getServlet(rpath); if (servlet != null) --- 123,127 ---- interp.set("__file__", rpath); ! HttpServlet servlet = getServlet(rpath); if (servlet != null) *************** *** 178,186 **** throw new ServletException("No callable (class or function) "+ "named " + name + " in " + path); ! PyObject pyServlet = cls.__call__(); Object o = pyServlet.__tojava__(HttpServlet.class); if (o == Py.NoConversion) ! throw new ServletException("The value from " + name + "must extend HttpServlet"); servlet = (HttpServlet)o; --- 178,186 ---- throw new ServletException("No callable (class or function) "+ "named " + name + " in " + path); ! PyObject pyServlet = cls.__call__(); Object o = pyServlet.__tojava__(HttpServlet.class); if (o == Py.NoConversion) ! throw new ServletException("The value from " + name + "must extend HttpServlet"); servlet = (HttpServlet)o; Index: PythonInterpreter.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/util/PythonInterpreter.java,v retrieving revision 2.9 retrieving revision 2.10 diff -C2 -d -r2.9 -r2.10 *** PythonInterpreter.java 2001/11/03 19:26:02 2.9 --- PythonInterpreter.java 2001/11/27 13:51:38 2.10 *************** *** 18,24 **** protected CompilerFlags cflags = null; ! /** ! * Initialize the jython runtime. This method should only be * called once, and should be call before any other python objects * are created (included a PythonInterpreter). --- 18,24 ---- protected CompilerFlags cflags = null; ! /** ! * Initialize the jython runtime. This method should only be * called once, and should be call before any other python objects * are created (included a PythonInterpreter). *************** *** 32,39 **** * will override system properties and * registry properties. ! * @param argv Command line argument. These values will * assigned to sys.argv. */ ! public static void initialize(Properties preProperties, Properties postProperties, String[] argv) { --- 32,39 ---- * will override system properties and * registry properties. ! * @param argv Command line argument. These values will * assigned to sys.argv. */ ! public static void initialize(Properties preProperties, Properties postProperties, String[] argv) { *************** *** 59,63 **** this(dict, null); } ! public PythonInterpreter(PyObject dict, PySystemState systemState) { PySystemState.initialize(); --- 59,63 ---- this(dict, null); } ! public PythonInterpreter(PyObject dict, PySystemState systemState) { PySystemState.initialize(); *************** *** 74,82 **** setState(); } ! protected void setState() { Py.setSystemState(systemState); } ! /** * Set the Python object to use for the standard output stream --- 74,82 ---- setState(); } ! protected void setState() { Py.setSystemState(systemState); } ! /** * Set the Python object to use for the standard output stream *************** *** 87,96 **** systemState.stdout = outStream; } ! /** * Set a java.io.Writer to use for the standard output stream * * @param outStream Writer to use as output stream ! */ public void setOut(java.io.Writer outStream) { setOut(new PyFile(outStream)); --- 87,96 ---- systemState.stdout = outStream; } ! /** * Set a java.io.Writer to use for the standard output stream * * @param outStream Writer to use as output stream ! */ public void setOut(java.io.Writer outStream) { setOut(new PyFile(outStream)); *************** *** 101,121 **** * * @param outStream OutputStream to use as output stream ! */ public void setOut(java.io.OutputStream outStream) { setOut(new PyFile(outStream)); } ! public void setErr(PyObject outStream) { systemState.stderr = outStream; } ! public void setErr(java.io.Writer outStream) { setErr(new PyFile(outStream)); } ! public void setErr(java.io.OutputStream outStream) { setErr(new PyFile(outStream)); } ! /** * Evaluate a string as Python source and return the result --- 101,121 ---- * * @param outStream OutputStream to use as output stream ! */ public void setOut(java.io.OutputStream outStream) { setOut(new PyFile(outStream)); } ! public void setErr(PyObject outStream) { systemState.stderr = outStream; } ! public void setErr(java.io.Writer outStream) { setErr(new PyFile(outStream)); } ! public void setErr(java.io.OutputStream outStream) { setErr(new PyFile(outStream)); } ! /** * Evaluate a string as Python source and return the result *************** *** 137,141 **** Py.exec(Py.compile_flags(s, "<string>", "exec",cflags), locals, locals); } ! /** * Execute a Python code object in the local namespace --- 137,141 ---- Py.exec(Py.compile_flags(s, "<string>", "exec",cflags), locals, locals); } ! /** * Execute a Python code object in the local namespace *************** *** 161,165 **** execfile(s, "<iostream>"); } ! public void execfile(java.io.InputStream s, String name) { setState(); --- 161,165 ---- execfile(s, "<iostream>"); } ! public void execfile(java.io.InputStream s, String name) { setState(); *************** *** 180,184 **** * * @param name the name of the variable ! * @param value the value to set the variable to. Will be automatically converted to an appropriate Python object. */ --- 180,184 ---- * * @param name the name of the variable ! * @param value the value to set the variable to. Will be automatically converted to an appropriate Python object. */ *************** *** 206,210 **** return locals.__finditem__(name.intern()); } ! /** * Get the value of a variable in the local namespace Value will be --- 206,210 ---- return locals.__finditem__(name.intern()); } ! /** * Get the value of a variable in the local namespace Value will be *************** *** 215,219 **** * @param name the name of the variable * @param javaclass the class of object to return ! */ public Object get(String name, Class javaclass) { return Py.tojava(locals.__finditem__(name.intern()), javaclass); --- 215,219 ---- * @param name the name of the variable * @param javaclass the class of object to return ! */ public Object get(String name, Class javaclass) { return Py.tojava(locals.__finditem__(name.intern()), javaclass); Index: PythonObjectInputStream.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/util/PythonObjectInputStream.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** PythonObjectInputStream.java 2001/02/01 13:23:41 1.7 --- PythonObjectInputStream.java 2001/11/27 13:51:38 1.8 *************** *** 38,44 **** } catch (ClassNotFoundException exc) { PyObject m = importModule(clsName); ! //System.out.println("m:" + m); Object cls = m.__tojava__(Class.class); ! //System.out.println("cls:" + cls); if (cls != null && cls != Py.NoConversion) return (Class) cls; --- 38,44 ---- } catch (ClassNotFoundException exc) { PyObject m = importModule(clsName); ! //System.out.println("m:" + m); Object cls = m.__tojava__(Class.class); ! //System.out.println("cls:" + cls); if (cls != null && cls != Py.NoConversion) return (Class) cls; *************** *** 49,53 **** private static PyObject importModule(String name) { ! PyObject silly_list = new PyTuple(new PyString[] { Py.newString("__doc__"), }); --- 49,53 ---- private static PyObject importModule(String name) { ! PyObject silly_list = new PyTuple(new PyString[] { Py.newString("__doc__"), }); Index: ReadlineConsole.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/util/ReadlineConsole.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ReadlineConsole.java 2001/11/27 13:04:56 1.3 --- ReadlineConsole.java 2001/11/27 13:51:38 1.4 *************** *** 18,22 **** public ReadlineConsole(PyObject locals, String filename) { super(locals,filename); ! Readline.initReadline("jpython"); } --- 18,22 ---- public ReadlineConsole(PyObject locals, String filename) { super(locals,filename); ! Readline.initReadline("jpython"); } Index: jython.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/util/jython.java,v retrieving revision 2.21 retrieving revision 2.22 diff -C2 -d -r2.21 -r2.22 *** jython.java 2001/11/03 19:26:02 2.21 --- jython.java 2001/11/27 13:51:38 2.22 *************** *** 30,34 **** // TBD: this is kind of gross because a local called `zipfile' just // magically shows up in the module's globals. Either `zipfile' ! // should be called `__zipfile__' or (preferrably, IMO), __run__.py // should be imported and a main() function extracted. This // function should be called passing zipfile in as an argument. --- 30,34 ---- // TBD: this is kind of gross because a local called `zipfile' just // magically shows up in the module's globals. Either `zipfile' ! // should be called `__zipfile__' or (preferrably, IMO), __run__.py // should be imported and a main() function extracted. This // function should be called passing zipfile in as an argument. *************** *** 72,84 **** System.exit(exitcode); } ! // Setup the basic python system state from these options PySystemState.initialize(System.getProperties(), opts.properties, opts.argv); ! if (opts.notice) { System.err.println(InteractiveConsole.getDefaultBanner()); } ! // Now create an interpreter InteractiveConsole interp = null; --- 72,84 ---- System.exit(exitcode); } ! // Setup the basic python system state from these options PySystemState.initialize(System.getProperties(), opts.properties, opts.argv); ! if (opts.notice) { System.err.println(InteractiveConsole.getDefaultBanner()); } ! // Now create an interpreter InteractiveConsole interp = null; *************** *** 138,142 **** } } ! if (opts.command != null) { try { --- 138,142 ---- } } ! if (opts.command != null) { try { *************** *** 146,150 **** } } ! // was there a filename on the command line? if (opts.filename != null) { --- 146,150 ---- } } ! // was there a filename on the command line? if (opts.filename != null) { *************** *** 272,276 **** else if (arg.equals("-c")) { command = args[++index]; ! if (!fixInteractive) interactive = false; break; } --- 272,276 ---- else if (arg.equals("-c")) { command = args[++index]; ! if (!fixInteractive) interactive = false; break; } *************** *** 282,286 **** } else if (arg.startsWith("-D")) { ! String key = null; String value = null; int equals = arg.indexOf("="); --- 282,286 ---- } else if (arg.startsWith("-D")) { ! String key = null; String value = null; int equals = arg.indexOf("="); |
From: Finn B. <bc...@us...> - 2001-11-27 13:51:41
|
Update of /cvsroot/jython/jython/org/python/parser In directory usw-pr-cvs1:/tmp/cvs-serv9040/parser Modified Files: ReaderCharStream.java SimpleNode.java TokenMgrError.java Log Message: Whitespace normalization. Index: ReaderCharStream.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/parser/ReaderCharStream.java,v retrieving revision 2.1 retrieving revision 2.2 diff -C2 -d -r2.1 -r2.2 *** ReaderCharStream.java 2001/07/20 13:37:43 2.1 --- ReaderCharStream.java 2001/11/27 13:51:38 2.2 *************** *** 191,195 **** /** ! * @deprecated * @see #getEndColumn */ --- 191,195 ---- /** ! * @deprecated * @see #getEndColumn */ *************** *** 200,204 **** /** ! * @deprecated * @see #getEndLine */ --- 200,204 ---- /** ! * @deprecated * @see #getEndLine */ *************** *** 303,307 **** columnDiff = nextColDiff; i++; ! } if (i < len) --- 303,307 ---- columnDiff = nextColDiff; i++; ! } if (i < len) Index: SimpleNode.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/parser/SimpleNode.java,v retrieving revision 2.16 retrieving revision 2.17 diff -C2 -d -r2.16 -r2.17 *** SimpleNode.java 2001/10/28 17:13:44 2.16 --- SimpleNode.java 2001/11/27 13:51:38 2.17 *************** *** 17,21 **** public org.python.compiler.ScopeInfo scope; // for nested scopes public boolean from_future_checked = false; // from __future__ support ! public SimpleNode(int i) { id = i; --- 17,21 ---- public org.python.compiler.ScopeInfo scope; // for nested scopes public boolean from_future_checked = false; // from __future__ support ! public SimpleNode(int i) { id = i; *************** *** 82,86 **** } ! public static String parseString(String s, int quotes, int beginLine, int beginColumn) { //System.out.println("string: "+s); --- 82,86 ---- } ! public static String parseString(String s, int quotes, int beginLine, int beginColumn) { //System.out.println("string: "+s); *************** *** 91,95 **** ustring = true; start++; ! } quoteChar = s.charAt(start); if (quoteChar == 'r' || quoteChar == 'R') { --- 91,95 ---- ustring = true; start++; ! } quoteChar = s.charAt(start); if (quoteChar == 'r' || quoteChar == 'R') { Index: TokenMgrError.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/parser/TokenMgrError.java,v retrieving revision 2.3 retrieving revision 2.4 diff -C2 -d -r2.3 -r2.4 *** TokenMgrError.java 2001/02/23 20:27:40 2.3 --- TokenMgrError.java 2001/11/27 13:51:38 2.4 *************** *** 90,94 **** * Returns a detailed message for the Error when it is thrown by the * token manager to indicate a lexical error. ! * Parameters : * EOFSeen : indicates if EOF caused the lexicl error * curLexState : lexical state in which this error occured --- 90,94 ---- * Returns a detailed message for the Error when it is thrown by the * token manager to indicate a lexical error. ! * Parameters : * EOFSeen : indicates if EOF caused the lexicl error * curLexState : lexical state in which this error occured *************** *** 116,120 **** * You can also modify the body of this method to customize your error messages. * For example, cases like LOOP_DETECTED and INVALID_LEXICAL_STATE are not ! * of end-users concern, so you can return something like : * * "Internal Error : Please file a bug report .... " --- 116,120 ---- * You can also modify the body of this method to customize your error messages. * For example, cases like LOOP_DETECTED and INVALID_LEXICAL_STATE are not ! * of end-users concern, so you can return something like : * * "Internal Error : Please file a bug report .... " |
From: Finn B. <bc...@us...> - 2001-11-27 13:51:41
|
Update of /cvsroot/jython/jython/org/python/modules/sre In directory usw-pr-cvs1:/tmp/cvs-serv9040/modules/sre Modified Files: MatchObject.java PatternObject.java SRE_REPEAT.java SRE_STATE.java ScannerObject.java Log Message: Whitespace normalization. Index: MatchObject.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/modules/sre/MatchObject.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** MatchObject.java 2001/10/28 15:11:47 1.4 --- MatchObject.java 2001/11/27 13:51:37 1.5 *************** *** 54,58 **** } - public PyObject groupdict(PyObject[] args, String[] kws) { ArgParser ap = new ArgParser("groupdict", args, kws, "default"); --- 54,57 ---- *************** *** 74,86 **** } - - - - public PyObject start() { return start(Py.Zero); } - public PyObject start(PyObject index_) { int index = getindex(index_); --- 73,80 ---- *************** *** 92,102 **** } - - public PyObject end() { return end(Py.Zero); } - public PyObject end(PyObject index_) { int index = getindex(index_); --- 86,93 ---- *************** *** 108,123 **** } - - - public PyTuple span() { return span(Py.Zero); } - public PyTuple span(PyObject index_) { int index = getindex(index_); ! if (index < 0 || index >= groups) throw Py.IndexError("no such group"); --- 99,110 ---- } public PyTuple span() { return span(Py.Zero); } public PyTuple span(PyObject index_) { int index = getindex(index_); ! if (index < 0 || index >= groups) throw Py.IndexError("no such group"); *************** *** 128,134 **** } - - - public PyObject regs() { --- 115,118 ---- *************** *** 143,163 **** - - - - PyTuple _pair(int i1, int i2) { return new PyTuple(new PyObject[] { Py.newInteger(i1), Py.newInteger(i2) }); } - - - private PyObject getslice(PyObject index, PyObject def) { return getslice_by_index(getindex(index), def); } - - private int getindex(PyObject index) { if (index instanceof PyInteger) --- 127,138 ---- *************** *** 175,184 **** } - - private PyObject getslice_by_index(int index, PyObject def) { ! if (index < 0 || index >= groups) throw Py.IndexError("no such group"); ! index *= 2; int start = mark[index]; --- 150,157 ---- } private PyObject getslice_by_index(int index, PyObject def) { ! if (index < 0 || index >= groups) throw Py.IndexError("no such group"); ! index *= 2; int start = mark[index]; *************** *** 192,200 **** return new PyString(string.substring(start, end)); } - - - - - public PyObject __findattr__(String key) { --- 165,168 ---- Index: PatternObject.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/modules/sre/PatternObject.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** PatternObject.java 2001/01/21 14:04:32 1.5 --- PatternObject.java 2001/11/27 13:51:37 1.6 *************** *** 40,45 **** } - - public MatchObject match(String string) { return match(string, 0, Integer.MAX_VALUE); --- 40,43 ---- *************** *** 82,89 **** int count = ap.getInt(2, 0); ! return call("_sub", new PyObject[] { ! Py.java2py(this), template, ! Py.newString(string), Py.newInteger(count) }); } --- 80,87 ---- int count = ap.getInt(2, 0); ! return call("_sub", new PyObject[] { ! Py.java2py(this), template, ! Py.newString(string), Py.newInteger(count) }); } *************** *** 96,103 **** int count = ap.getInt(2, 0); ! return call("_subn", new PyObject[] { ! Py.java2py(this), ! template, ! Py.newString(string), Py.newInteger(count) }); } --- 94,101 ---- int count = ap.getInt(2, 0); ! return call("_subn", new PyObject[] { ! Py.java2py(this), ! template, ! Py.newString(string), Py.newInteger(count) }); } *************** *** 109,115 **** int count = ap.getInt(1, 0); ! return call("_split", new PyObject[] { ! Py.java2py(this), ! Py.newString(string), Py.newInteger(count) }); } --- 107,113 ---- int count = ap.getInt(1, 0); ! return call("_split", new PyObject[] { ! Py.java2py(this), ! Py.newString(string), Py.newInteger(count) }); } *************** *** 165,169 **** if (status == 0) break; ! _error(status); } --- 163,167 ---- if (status == 0) break; ! _error(status); } *************** *** 187,191 **** self.string = string; return self; ! } --- 185,189 ---- self.string = string; return self; ! } Index: SRE_REPEAT.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/modules/sre/SRE_REPEAT.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SRE_REPEAT.java 2000/10/17 19:14:20 1.2 --- SRE_REPEAT.java 2001/11/27 13:51:37 1.3 *************** *** 20,24 **** public class SRE_REPEAT { int count; ! int pidx; SRE_REPEAT prev; --- 20,24 ---- public class SRE_REPEAT { int count; ! int pidx; SRE_REPEAT prev; Index: SRE_STATE.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/modules/sre/SRE_STATE.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** SRE_STATE.java 2001/04/04 19:08:21 1.5 --- SRE_STATE.java 2001/11/27 13:51:37 1.6 *************** *** 21,25 **** public class SRE_STATE { ! public static final int SRE_ERROR_ILLEGAL = -1; /* illegal opcode */ public static final int SRE_ERROR_STATE = -2; /* illegal state */ public static final int SRE_ERROR_RECURSION_LIMIT = -3; /* runaway recursion */ --- 21,25 ---- public class SRE_STATE { ! public static final int SRE_ERROR_ILLEGAL = -1; /* illegal opcode */ public static final int SRE_ERROR_STATE = -2; /* illegal state */ public static final int SRE_ERROR_RECURSION_LIMIT = -3; /* runaway recursion */ *************** *** 141,145 **** this.str = str.toCharArray(); int size = str.length(); ! this.charsize = 1; --- 141,145 ---- this.str = str.toCharArray(); int size = str.length(); ! this.charsize = 1; *************** *** 240,244 **** case SRE_AT_BEGINNING_LINE: ! return (ptr == beginning || SRE_IS_LINEBREAK(str[ptr-1])); case SRE_AT_END: --- 240,244 ---- case SRE_AT_BEGINNING_LINE: ! return (ptr == beginning || SRE_IS_LINEBREAK(str[ptr-1])); case SRE_AT_END: *************** *** 292,296 **** final boolean SRE_CHARSET(char[] set, int setidx, char ch) { ! /* check if character is a member of the given set. return 1 if so, 0 otherwise */ --- 292,296 ---- final boolean SRE_CHARSET(char[] set, int setidx, char ch) { ! /* check if character is a member of the given set. return 1 if so, 0 otherwise */ *************** *** 313,317 **** setidx += 2; break; ! case SRE_OP_CHARSET: /* <CHARSET> <bitmap> (16 bits per code word) */ --- 313,317 ---- setidx += 2; break; ! case SRE_OP_CHARSET: /* <CHARSET> <bitmap> (16 bits per code word) */ *************** *** 395,399 **** ptr++; break; ! case SRE_OP_NOT_LITERAL_IGNORE: /* repeated non-literal */ --- 395,399 ---- ptr++; break; ! case SRE_OP_NOT_LITERAL_IGNORE: /* repeated non-literal */ *************** *** 442,447 **** //TRACE(pidx, ptr, "ENTER " + level); ! if (level > USE_RECURSION_LIMIT) ! return SRE_ERROR_RECURSION_LIMIT; if (pattern[pidx] == SRE_OP_INFO) { --- 442,447 ---- //TRACE(pidx, ptr, "ENTER " + level); ! if (level > USE_RECURSION_LIMIT) ! return SRE_ERROR_RECURSION_LIMIT; if (pattern[pidx] == SRE_OP_INFO) { *************** *** 550,554 **** if (ptr >= end || str[ptr] != str[p]) return 0; ! p++; ptr++; } --- 550,554 ---- if (ptr >= end || str[ptr] != str[p]) return 0; ! p++; ptr++; } *************** *** 711,715 **** chr = pattern[pidx + pattern[pidx]+1]; for (;;) { ! while (count >= mincount && (ptr >= end || str[ptr] != chr)) { ptr--; --- 711,715 ---- chr = pattern[pidx + pattern[pidx]+1]; for (;;) { ! while (count >= mincount && (ptr >= end || str[ptr] != chr)) { ptr--; *************** *** 806,810 **** this.ptr = ptr; } ! /* cannot match more repeated items here. make sure the tail matches */ --- 806,810 ---- this.ptr = ptr; } ! /* cannot match more repeated items here. make sure the tail matches */ *************** *** 821,825 **** /* minimizing repeat */ /* <REPEAT> <skip> <1=min> <2=max> item <MIN_UNTIL> tail */ ! rp = this.repeat; if (rp == null) --- 821,825 ---- /* minimizing repeat */ /* <REPEAT> <skip> <1=min> <2=max> item <MIN_UNTIL> tail */ ! rp = this.repeat; if (rp == null) *************** *** 897,901 **** int overlap = 0; int flags = 0; ! if (pattern[pidx] == SRE_OP_INFO) { /* optimization info block */ --- 897,901 ---- int overlap = 0; int flags = 0; ! if (pattern[pidx] == SRE_OP_INFO) { /* optimization info block */ *************** *** 957,961 **** break; } ! } ptr++; --- 957,961 ---- break; } ! } ptr++; *************** *** 964,968 **** } - if (pattern[pidx] == SRE_OP_LITERAL) { /* pattern starts with a literal */ --- 964,967 ---- *************** *** 1071,1075 **** } ! /* default character predicates (run sre_chars.py to regenerate tables) */ --- 1070,1074 ---- } ! /* default character predicates (run sre_chars.py to regenerate tables) */ Index: ScannerObject.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/modules/sre/ScannerObject.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ScannerObject.java 2000/10/17 19:14:20 1.2 --- ScannerObject.java 2001/11/27 13:51:37 1.3 *************** *** 40,44 **** state.state_reset(); state.ptr = state.start; ! int status = state.SRE_SEARCH(pattern.code, 0); MatchObject match = pattern._pattern_new_match(state, string, status); --- 40,44 ---- state.state_reset(); state.ptr = state.start; ! int status = state.SRE_SEARCH(pattern.code, 0); MatchObject match = pattern._pattern_new_match(state, string, status); |
From: Finn B. <bc...@us...> - 2001-11-27 13:51:41
|
Update of /cvsroot/jython/jython/org/python/modules In directory usw-pr-cvs1:/tmp/cvs-serv9040/modules Modified Files: _weakref.java cPickle.java cStringIO.java codeop.java time.java Log Message: Whitespace normalization. Index: _weakref.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/modules/_weakref.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** _weakref.java 2001/08/19 18:14:53 1.1 --- _weakref.java 2001/11/27 13:51:37 1.2 *************** *** 21,25 **** reaperThread.start(); } ! /** <i>Internal use only. Do not call this method explicit.</i> */ public static void classDictInit(PyObject dict) --- 21,25 ---- reaperThread.start(); } ! /** <i>Internal use only. Do not call this method explicit.</i> */ public static void classDictInit(PyObject dict) *************** *** 150,154 **** for (int i = references.size() - 1; i >= 0; i--) { AbstractReference r = getReferenceAt(i); ! if (r == null) references.removeElementAt(i); else if (r.callback == null && r.getClass() == cls) { --- 150,154 ---- for (int i = references.size() - 1; i >= 0; i--) { AbstractReference r = getReferenceAt(i); ! if (r == null) references.removeElementAt(i); else if (r.callback == null && r.getClass() == cls) { *************** *** 165,169 **** for (int i = references.size() - 1; i >= 0; i--) { AbstractReference r = getReferenceAt(i); ! if (r == null) references.removeElementAt(i); else --- 165,169 ---- for (int i = references.size() - 1; i >= 0; i--) { AbstractReference r = getReferenceAt(i); ! if (r == null) references.removeElementAt(i); else *************** *** 186,190 **** for (int i = references.size() - 1; i >= 0; i--) { AbstractReference r = getReferenceAt(i); ! if (r == null) references.removeElementAt(i); else --- 186,190 ---- for (int i = references.size() - 1; i >= 0; i--) { AbstractReference r = getReferenceAt(i); ! if (r == null) references.removeElementAt(i); else *************** *** 308,313 **** public PyComplex __complex__() { return py().__complex__(); } public PyObject __pos__() { return py().__pos__(); } ! public PyObject __neg__() { return py().__neg__(); } ! public PyObject __abs__() { return py().__abs__(); } public PyObject __invert__() { return py().__invert__(); } --- 308,313 ---- public PyComplex __complex__() { return py().__complex__(); } public PyObject __pos__() { return py().__pos__(); } ! public PyObject __neg__() { return py().__neg__(); } ! public PyObject __abs__() { return py().__abs__(); } public PyObject __invert__() { return py().__invert__(); } Index: cPickle.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/modules/cPickle.java,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** cPickle.java 2001/10/28 17:13:44 1.19 --- cPickle.java 2001/11/27 13:51:37 1.20 *************** *** 484,488 **** self.__setattr__("args", args); - } --- 484,487 ---- Index: cStringIO.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/modules/cStringIO.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** cStringIO.java 2001/11/27 12:08:39 1.11 --- cStringIO.java 2001/11/27 13:51:37 1.12 *************** *** 75,79 **** super.__setattr__(name, value); } ! /** * Free the memory buffer. --- 75,79 ---- super.__setattr__(name, value); } ! /** * Free the memory buffer. Index: codeop.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/modules/codeop.java,v retrieving revision 2.7 retrieving revision 2.8 diff -C2 -d -r2.7 -r2.8 *** codeop.java 2001/10/28 17:13:44 2.7 --- codeop.java 2001/11/27 13:51:37 2.8 *************** *** 9,20 **** ); ! public static void classDictInit(PyObject dict) ! { dict.__delitem__("compile_command_flags"); dict.__delitem__("classDictInit"); } ! public static PyList __all__ = new PyList(new PyString[] { ! new PyString("compile_command") }); --- 9,20 ---- ); ! public static void classDictInit(PyObject dict) ! { dict.__delitem__("compile_command_flags"); dict.__delitem__("classDictInit"); } ! public static PyList __all__ = new PyList(new PyString[] { ! new PyString("compile_command") }); *************** *** 32,36 **** return compile_command_flags(string,filename,kind,null); } ! public static PyObject compile_command_flags(String string,String filename,String kind,CompilerFlags cflags) { --- 32,36 ---- return compile_command_flags(string,filename,kind,null); } ! public static PyObject compile_command_flags(String string,String filename,String kind,CompilerFlags cflags) { Index: time.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/modules/time.java,v retrieving revision 2.18 retrieving revision 2.19 diff -C2 -d -r2.18 -r2.19 *** time.java 2001/10/28 17:13:44 2.18 --- time.java 2001/11/27 13:51:37 2.19 *************** *** 590,594 **** return tz.getID(); } ! private static int getDSTSavings(TimeZone tz) { String version = System.getProperty("java.version"); --- 590,594 ---- return tz.getID(); } ! private static int getDSTSavings(TimeZone tz) { String version = System.getProperty("java.version"); |
From: Finn B. <bc...@us...> - 2001-11-27 13:04:58
|
Update of /cvsroot/jython/jython/org/python/util In directory usw-pr-cvs1:/tmp/cvs-serv31054 Modified Files: ReadlineConsole.java Log Message: Updated to java_readline-0.6. Index: ReadlineConsole.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/util/ReadlineConsole.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ReadlineConsole.java 2001/10/28 17:13:44 1.2 --- ReadlineConsole.java 2001/11/27 13:04:56 1.3 *************** *** 35,40 **** } catch (java.io.EOFException eofe) { throw new PyException(Py.EOFError); ! } catch (java.io.UnsupportedEncodingException e) { ! throw new PyException(); } } --- 35,40 ---- } catch (java.io.EOFException eofe) { throw new PyException(Py.EOFError); ! } catch (java.io.IOException e) { ! throw new PyException(Py.IOError); } } |
From: Finn B. <bc...@us...> - 2001-11-27 12:33:25
|
Update of /cvsroot/jython/jython In directory usw-pr-cvs1:/tmp/cvs-serv21675 Modified Files: build.xml Log Message: Added cleanup to the javadoc task before generating a new set of API documents. Index: build.xml =================================================================== RCS file: /cvsroot/jython/jython/build.xml,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** build.xml 2001/11/27 12:19:38 1.23 --- build.xml 2001/11/27 12:33:21 1.24 *************** *** 230,233 **** --- 230,241 ---- <target name="javadoc" depends="compile"> + <delete> + <fileset dir="${apidocDir}" includes="**/*.html" /> + <fileset dir="${apidocDir}" includes="**/*.css" /> + <fileset dir="${apidocDir}" includes="package-list" /> + </delete> + <delete dir="${apidocDir}/org" /> + <delete dir="${apidocDir}/com" /> + <mkdir dir="${apidocDir}" /> <javadoc sourcepath="${sourceDir}" |
From: Finn B. <bc...@us...> - 2001-11-27 12:19:41
|
Update of /cvsroot/jython/jython In directory usw-pr-cvs1:/tmp/cvs-serv18152 Modified Files: build.xml Log Message: Added target "doc" to build the .html files in the ./Doc directory. Index: build.xml =================================================================== RCS file: /cvsroot/jython/jython/build.xml,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** build.xml 2001/11/25 17:01:09 1.22 --- build.xml 2001/11/27 12:19:38 1.23 *************** *** 215,218 **** --- 215,232 ---- </target> + <target name="doc" depends="init"> + <delete> + <fileset dir="Doc" includes="*.html" /> + </delete> + <!-- Create .html files in Doc --> + <execon executable="${python.home}/python" dir="Doc"> + <arg line="${ht2html.dir}/ht2html.py"/> + <arg line="-s JPyLocalGenerator"/> + <fileset dir="Doc"> + <include name="*.ht" /> + </fileset> + </execon> + </target> + <target name="javadoc" depends="compile"> <mkdir dir="${apidocDir}" /> |
From: Finn B. <bc...@us...> - 2001-11-27 12:08:41
|
Update of /cvsroot/jython/jython/org/python/modules In directory usw-pr-cvs1:/tmp/cvs-serv15642 Modified Files: cStringIO.java Log Message: Make the softspace field writable. Fix for "[ #485968 ] cStringIO.softspace is not assignable." Index: cStringIO.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/modules/cStringIO.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** cStringIO.java 2001/10/28 17:13:44 1.10 --- cStringIO.java 2001/11/27 12:08:39 1.11 *************** *** 68,71 **** --- 68,79 ---- + public void __setattr__(String name, PyObject value) { + if (name == "softspace") { + softspace = value.__nonzero__(); + return; + } + super.__setattr__(name, value); + } + /** * Free the memory buffer. |
From: Finn B. <bc...@us...> - 2001-11-27 12:07:15
|
Update of /cvsroot/jython/bugtests In directory usw-pr-cvs1:/tmp/cvs-serv15174 Added Files: test344.py Log Message: Test for "[ #485968 ] cStringIO.softspace is not assignable." --- NEW FILE: test344.py --- """ [ #485968 ] cStringIO.softspace is not assignable. """ import support import sys, cStringIO h = cStringIO.StringIO() sys.stdout = h print "line1" print "line2", print "line3", sys.stdout = sys.__stdout__ if h.getvalue() != "line1\nline2 line3": raise support.TestError('Wrong softspace handling in cStringIO"') |
From: Finn B. <bc...@us...> - 2001-11-27 11:27:50
|
Update of /cvsroot/jython/bugtests In directory usw-pr-cvs1:/tmp/cvs-serv7621 Modified Files: test307.py test323.py Log Message: Updated to match the new way of adding .zip files to sys.path. Index: test307.py =================================================================== RCS file: /cvsroot/jython/bugtests/test307.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** test307.py 2001/07/25 20:21:45 1.1 --- test307.py 2001/11/27 11:27:48 1.2 *************** *** 35,42 **** compare("__name__", __name__, "test307p") compare("__file__", __file__, "test307p/__init__.py") ! compare("__path__", __path__, ["test307.zip!test307p"]) import mod import submod ! __path__.append("test307.zip!foo/bar") import foobar """) --- 35,42 ---- compare("__name__", __name__, "test307p") compare("__file__", __file__, "test307p/__init__.py") ! compare("__path__", __path__, ["test307.zip/test307p"]) import mod import submod ! __path__.append("test307.zip/foo/bar") import foobar """) Index: test323.py =================================================================== RCS file: /cvsroot/jython/bugtests/test323.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** test323.py 2001/10/28 14:51:01 1.1 --- test323.py 2001/11/27 11:27:48 1.2 *************** *** 30,34 **** import sys ! sys.path.append("test323.zip!Lib") import test323m --- 30,34 ---- import sys ! sys.path.append("test323.zip/Lib") import test323m |
From: Finn B. <bc...@us...> - 2001-11-27 11:22:10
|
Update of /cvsroot/jython/jython/org/python/core In directory usw-pr-cvs1:/tmp/cvs-serv5608 Modified Files: imp.java SyspathArchive.java Log Message: Make the ".zip file on sys.path" support match the expected behaviour in CPython-2.3. This trigger for a .zip/.jar file search is: '/path/to/file.zip' or '/path/to/file.zip/path/in/archive' Index: imp.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/core/imp.java,v retrieving revision 2.54 retrieving revision 2.55 diff -C2 -d -r2.54 -r2.55 *** imp.java 2001/10/28 17:13:43 2.54 --- imp.java 2001/11/27 11:22:07 2.55 *************** *** 343,356 **** if (isDir) return false; ! String dir = entry.toString(); ! int idx = dir.indexOf('!'); ! if (idx > 0) { ! dir = dir.substring(0, idx); ! } ! if (dir.length() < 5) { ! return false; ! } ! String ext = dir.substring(dir.length() - 4); ! return ext.equalsIgnoreCase(".zip") || ext.equalsIgnoreCase(".jar"); } --- 343,347 ---- if (isDir) return false; ! return SyspathArchive.getArchiveName(entry.toString()) != null; } Index: SyspathArchive.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/core/SyspathArchive.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SyspathArchive.java 2001/07/26 20:23:09 1.1 --- SyspathArchive.java 2001/11/27 11:22:07 1.2 *************** *** 9,16 **** public SyspathArchive(String archiveName) throws IOException { super(archiveName); ! int idx = archiveName.indexOf('!'); ! if (idx > 0) { ! archiveName = archiveName.substring(0, idx); ! } zipFile = new ZipFile(new File(archiveName)); Py.getSystemState().packageManager.addJar(archiveName); --- 9,13 ---- public SyspathArchive(String archiveName) throws IOException { super(archiveName); ! archiveName = getArchiveName(archiveName); zipFile = new ZipFile(new File(archiveName)); Py.getSystemState().packageManager.addJar(archiveName); *************** *** 22,37 **** } public SyspathArchive makeSubfolder(String folder) { ! return new SyspathArchive(zipFile, super.toString() + "!" + folder); } private String makeEntry(String entry) { String archive = super.toString(); ! int idx = archive.indexOf('!'); ! if (idx < 0) { return entry; } - String folder = archive.substring(idx+1); - return folder + "/" + entry; } --- 19,54 ---- } + static String getArchiveName(String dir) { + String lowerName = dir.toLowerCase(); + int idx = lowerName.indexOf(".zip"); + if (idx < 0) { + idx = lowerName.indexOf(".jar"); + } + if (idx < 0) { + return null; + } + + if (idx == dir.length() - 4) { + return dir; + } + char ch = dir.charAt(idx+4); + if (ch == File.separatorChar || ch == '/') { + return dir.substring(0, idx+4); + } + return null; + } + public SyspathArchive makeSubfolder(String folder) { ! return new SyspathArchive(zipFile, super.toString() + "/" + folder); } private String makeEntry(String entry) { String archive = super.toString(); ! String folder = getArchiveName(super.toString()); ! if (archive.length() == folder.length()) { return entry; + } else { + return archive.substring(folder.length()+1) + "/" + entry; } } |
From: Finn B. <bc...@us...> - 2001-11-27 11:18:07
|
Update of /cvsroot/jython/jython/org/python/core In directory usw-pr-cvs1:/tmp/cvs-serv4751 Modified Files: PyString.java Log Message: encode_UnicodeEscape(): Use the \xNN encoding for 127 >= values >= 255. Index: PyString.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/core/PyString.java,v retrieving revision 2.50 retrieving revision 2.51 diff -C2 -d -r2.50 -r2.51 *** PyString.java 2001/10/28 17:13:43 2.50 --- PyString.java 2001/11/27 11:18:04 2.51 *************** *** 388,396 **** else if (use_quotes && ch == '\f') v.append("\\f"); else if (use_quotes && ch == '\r') v.append("\\r"); ! else if (ch < ' ' || ch >= 128) { ! v.append('\\'); ! v.append(hexdigit[(ch >> 6) & 7]); ! v.append(hexdigit[(ch >> 3) & 7]); ! v.append(hexdigit[ch & 7]); } /* Copy everything else as-is */ --- 388,395 ---- else if (use_quotes && ch == '\f') v.append("\\f"); else if (use_quotes && ch == '\r') v.append("\\r"); ! else if (ch < ' ' || ch >= 127) { ! v.append("\\x"); ! v.append(hexdigit[(ch >> 4) & 0xF]); ! v.append(hexdigit[ch & 0xF]); } /* Copy everything else as-is */ |
From: Finn B. <bc...@us...> - 2001-11-27 11:03:22
|
Update of /cvsroot/jython/jython/installer In directory usw-pr-cvs1:/tmp/cvs-serv1719 Modified Files: liftoff.filelist Log Message: New list files that includes zxJDBC. Index: liftoff.filelist =================================================================== RCS file: /cvsroot/jython/jython/installer/liftoff.filelist,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** liftoff.filelist 2001/10/06 22:19:51 1.20 --- liftoff.filelist 2001/11/27 11:03:19 1.21 *************** *** 49,57 **** --- 49,61 ---- # t Lib/copy.py ..\Lib\copy.py + t Lib/dbexts.py ..\Lib\dbexts.py t Lib/getopt.py ..\Lib\getopt.py + t Lib/imaplib.py ..\Lib\imaplib.py + t Lib/isql.py ..\Lib\isql.py t Lib/javaos.py ..\Lib\javaos.py t Lib/javapath.py ..\Lib\javapath.py t Lib/jreload.py ..\Lib\jreload.py t Lib/marshal.py ..\Lib\marshal.py + t Lib/random.py ..\Lib\random.py t Lib/re.py ..\Lib\re.py t Lib/socket.py ..\Lib\socket.py *************** *** 78,85 **** --- 82,91 ---- t Doc/usejava.html ..\Doc\usejava.html t Doc/whatis.html ..\Doc\whatis.html + t Doc/zxJDBC.html ..\Doc\zxJDBC.html b Doc/images/jython-new-small.gif ..\Doc/images/jython-new-small.gif b Doc/images/PythonPoweredSmall.gif ..\Doc/images/PythonPoweredSmall.gif t Doc/api/allclasses-frame.html ..\Doc\api\allclasses-frame.html t Doc/api/allclasses-noframe.html ..\Doc\api\allclasses-noframe.html + t Doc/api/constant-values.html ..\Doc\api\constant-values.html t Doc/api/deprecated-list.html ..\Doc\api\deprecated-list.html t Doc/api/help-doc.html ..\Doc\api\help-doc.html *************** *** 187,190 **** --- 193,207 ---- t Doc/api/org/python/util/PythonObjectInputStream.html ..\Doc\api\org\python\util\PythonObjectInputStream.html t Doc/api/org/python/util/ReadlineConsole.html ..\Doc\api\org\python\util\ReadlineConsole.html + t Doc/api/com/ziclix/python/sql/DataHandler.html ..\Doc\api\com\ziclix\python\sql\DataHandler.html + t Doc/api/com/ziclix/python/sql/Fetch.html ..\Doc\api\com\ziclix\python\sql\Fetch.html + t Doc/api/com/ziclix/python/sql/FilterDataHandler.html ..\Doc\api\com\ziclix\python\sql\FilterDataHandler.html + t Doc/api/com/ziclix/python/sql/JDBC20DataHandler.html ..\Doc\api\com\ziclix\python\sql\JDBC20DataHandler.html + t Doc/api/com/ziclix/python/sql/package-frame.html ..\Doc\api\com\ziclix\python\sql\package-frame.html + t Doc/api/com/ziclix/python/sql/package-summary.html ..\Doc\api\com\ziclix\python\sql\package-summary.html + t Doc/api/com/ziclix/python/sql/package-tree.html ..\Doc\api\com\ziclix\python\sql\package-tree.html + t Doc/api/com/ziclix/python/sql/PyConnection.html ..\Doc\api\com\ziclix\python\sql\PyConnection.html + t Doc/api/com/ziclix/python/sql/PyCursor.html ..\Doc\api\com\ziclix\python\sql\PyCursor.html + t Doc/api/com/ziclix/python/sql/PyExtendedCursor.html ..\Doc\api\com\ziclix\python\sql\PyExtendedCursor.html + t Doc/api/com/ziclix/python/sql/zxJDBC.html ..\Doc\api\com\ziclix\python\sql\zxJDBC.html # # Demos *************** *** 390,393 **** --- 407,411 ---- 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/xreadlines.java ..\org\python\modules\xreadlines.java t org/python/modules/_codecs.java ..\org\python\modules\_codecs.java t org/python/modules/_jython.java ..\org\python\modules\_jython.java *************** *** 431,434 **** --- 449,481 ---- t Lib/jxxload_help/PathVFS.java ..\Lib\jxxload_help\PathVFS.java t Lib/jxxload_help/PathVFSJavaLoader.java ..\Lib\jxxload_help\PathVFSJavaLoader.java + t com/ziclix/python/sql/DataHandler.java ..\com\ziclix\python\sql\DataHandler.java + t com/ziclix/python/sql/Fetch.java ..\com\ziclix\python\sql\Fetch.java + t com/ziclix/python/sql/FilterDataHandler.java ..\com\ziclix\python\sql\FilterDataHandler.java + t com/ziclix/python/sql/JDBC20DataHandler.java ..\com\ziclix\python\sql\JDBC20DataHandler.java + t com/ziclix/python/sql/PyConnection.java ..\com\ziclix\python\sql\PyConnection.java + t com/ziclix/python/sql/PyCursor.java ..\com\ziclix\python\sql\PyCursor.java + t com/ziclix/python/sql/PyExtendedCursor.java ..\com\ziclix\python\sql\PyExtendedCursor.java + t com/ziclix/python/sql/zxJDBC.java ..\com\ziclix\python\sql\zxJDBC.java + t com/ziclix/python/sql/util/BCP.java ..\com\ziclix\python\sql\util\BCP.java + t com/ziclix/python/sql/util/PyArgParser.java ..\com\ziclix\python\sql\util\PyArgParser.java + t com/ziclix/python/sql/util/Queue.java ..\com\ziclix\python\sql\util\Queue.java + t com/ziclix/python/sql/util/QueueClosedException.java ..\com\ziclix\python\sql\util\QueueClosedException.java + t com/ziclix/python/sql/resource/zxJDBCMessages.properties ..\com\ziclix\python\sql\resource\zxJDBCMessages.properties + t com/ziclix/python/sql/pipe/Pipe.java ..\com\ziclix\python\sql\pipe\Pipe.java + t com/ziclix/python/sql/pipe/Sink.java ..\com\ziclix\python\sql\pipe\Sink.java + t com/ziclix/python/sql/pipe/Source.java ..\com\ziclix\python\sql\pipe\Source.java + t com/ziclix/python/sql/pipe/db/BaseDB.java ..\com\ziclix\python\sql\pipe\db\BaseDB.java + t com/ziclix/python/sql/pipe/db/DBSink.java ..\com\ziclix\python\sql\pipe\db\DBSink.java + t com/ziclix/python/sql/pipe/db/DBSource.java ..\com\ziclix\python\sql\pipe\db\DBSource.java + t com/ziclix/python/sql/pipe/csv/CSVSink.java ..\com\ziclix\python\sql\pipe\csv\CSVSink.java + t com/ziclix/python/sql/pipe/csv/CSVString.java ..\com\ziclix\python\sql\pipe\csv\CSVString.java + t com/ziclix/python/sql/handler/InformixDataHandler.java ..\com\ziclix\python\sql\handler\InformixDataHandler.java + t com/ziclix/python/sql/handler/MySQLDataHandler.java ..\com\ziclix\python\sql\handler\MySQLDataHandler.java + t com/ziclix/python/sql/handler/OracleDataHandler.java ..\com\ziclix\python\sql\handler\OracleDataHandler.java + t com/ziclix/python/sql/handler/PostgresqlDataHandler.java ..\com\ziclix\python\sql\handler\PostgresqlDataHandler.java + t com/ziclix/python/sql/handler/UpdateCountDataHandler.java ..\com\ziclix\python\sql\handler\UpdateCountDataHandler.java + t com/ziclix/python/sql/connect/Connect.java ..\com\ziclix\python\sql\connect\Connect.java + t com/ziclix/python/sql/connect/Connectx.java ..\com\ziclix\python\sql\connect\Connectx.java + t com/ziclix/python/sql/connect/Lookup.java ..\com\ziclix\python\sql\connect\Lookup.java # # Library modules from CPython *************** *** 477,481 **** t Lib/htmllib.py d:\python\Python211\Lib\htmllib.py t Lib/httplib.py d:\python\Python211\Lib\httplib.py - t Lib/imaplib.py d:\python\Python211\Lib\imaplib.py t Lib/imghdr.py d:\python\Python211\Lib\imghdr.py t Lib/keyword.py d:\python\Python211\Lib\keyword.py --- 524,527 ---- *************** *** 505,509 **** t Lib/pyclbr.py d:\python\Python211\Lib\pyclbr.py t Lib/quopri.py d:\python\Python211\Lib\quopri.py - t Lib/random.py d:\python\Python211\Lib\random.py t Lib/reconvert.py d:\python\Python211\Lib\reconvert.py t Lib/repr.py d:\python\Python211\Lib\repr.py --- 551,554 ---- |