Update of /cvsroot/pycrust/PyCrust
In directory sc8-pr-cvs1:/tmp/cvs-serv18870
Modified Files:
version.py introspect.py CHANGES.txt
Log Message:
Fixed introspection bug.
Index: version.py
===================================================================
RCS file: /cvsroot/pycrust/PyCrust/version.py,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** version.py 20 Mar 2003 22:38:52 -0000 1.18
--- version.py 21 Mar 2003 05:57:20 -0000 1.19
***************
*** 8,11 ****
__revision__ = "$Revision$"[11:-2]
! VERSION = '0.9'
--- 8,11 ----
__revision__ = "$Revision$"[11:-2]
! VERSION = '0.9.1'
Index: introspect.py
===================================================================
RCS file: /cvsroot/pycrust/PyCrust/introspect.py,v
retrieving revision 1.61
retrieving revision 1.62
diff -C2 -d -r1.61 -r1.62
*** introspect.py 4 Mar 2003 19:31:52 -0000 1.61
--- introspect.py 21 Mar 2003 05:57:21 -0000 1.62
***************
*** 10,13 ****
--- 10,14 ----
import cStringIO
import inspect
+ import sys
import tokenize
import types
***************
*** 201,204 ****
--- 202,209 ----
'.'. The terminator and anything after the terminator will be
dropped."""
+ command = command.split('\n')[-1]
+ if command.startswith(sys.ps2):
+ command = command[len(sys.ps2):]
+ command = command.lstrip()
command = rtrimTerminus(command, terminator)
tokens = getTokens(command)
***************
*** 208,211 ****
--- 213,218 ----
# Remove the end marker.
del tokens[-1]
+ if not tokens:
+ return ''
if terminator == '.' and \
(tokens[-1][1] <> '.' or tokens[-1][0] is not tokenize.OP):
***************
*** 214,218 ****
else:
# Strip off the terminator.
! command = command[:-1]
command = command.rstrip()
tokens = getTokens(command)
--- 221,227 ----
else:
# Strip off the terminator.
! if terminator and command.endswith(terminator):
! size = 0 - len(terminator)
! command = command[:size]
command = command.rstrip()
tokens = getTokens(command)
***************
*** 294,298 ****
def rtrimTerminus(command, terminator=None):
! """Return command minus anything that fillows the final terminator."""
if terminator:
pieces = command.split(terminator)
--- 303,307 ----
def rtrimTerminus(command, terminator=None):
! """Return command minus anything that follows the final terminator."""
if terminator:
pieces = command.split(terminator)
Index: CHANGES.txt
===================================================================
RCS file: /cvsroot/pycrust/PyCrust/CHANGES.txt,v
retrieving revision 1.27
retrieving revision 1.28
diff -C2 -d -r1.27 -r1.28
*** CHANGES.txt 20 Mar 2003 22:32:41 -0000 1.27
--- CHANGES.txt 21 Mar 2003 05:57:21 -0000 1.28
***************
*** 8,11 ****
--- 8,23 ----
+ 0.9.1 (3/21/2003 to //2003)
+ ==============================
+
+ Fixed bug in introspect.py on introspecting objects occurring
+ immediately after a secondary prompt, like this:
+
+ >>> l = [1, 2, 3]
+ >>> for n in range(3):
+ ... l. <-- failed to popup autocomplete list
+
+
+
0.9 (2/27/2003 to 3/20/2003)
============================
|