Commit Graph

1721 Commits

Author SHA1 Message Date
Guido van Rossum eeb2f32aad Fixed a problem where xmllib didn't handle the tag
<sometag attrib=">">
correctly.
Also changed comparisons of re matches and searches into explicit
comparisons with None.
(Sjoerd Mullender)
1998-10-19 13:28:26 +00:00
Guido van Rossum d54fb7ae9b The usual 1998-10-17 18:09:27 +00:00
Guido van Rossum c2047c19f5 When run as a script, don't pass a fake __main__ dictionary; use the
real one.
1998-10-15 01:38:23 +00:00
Guido van Rossum b0e5718643 Fix so that after a fork() -- on Unix only -- the template gets
recalculated.
1998-10-14 20:27:05 +00:00
Guido van Rossum 9f1292d840 Perhaps a controversial change: when reporting a callback exception,
assign the exception info to sys.last_{type,value,traceback}.  That
way, an introspective Tkinter app can inspect its own stack trace.

(The controversy is that it would keep some objects alive, but that's
probably no big deal.)
1998-10-13 20:02:39 +00:00
Barry Warsaw 4eaadf002e Added {xview,yview}_{moveto,scroll} to the Canvas class. 1998-10-13 19:01:10 +00:00
Guido van Rossum e73d702344 Ever-so-slight improvementL the patterns to recognize import
statements now also stop at ';' (formerly they only stopped at '#').
1998-10-13 16:12:36 +00:00
Guido van Rossum 243ac4f497 Updated listbox methods to Tk 8.0. (Moved some around, added
x/yview_scroll/moveto.)
1998-10-13 13:37:30 +00:00
Guido van Rossum 3179b36014 When no master widget is specified, use options['parent'] if it exists. 1998-10-12 20:40:47 +00:00
Guido van Rossum 7f20263349 Only reference Tkinter._default_root when needed. 1998-10-12 20:40:09 +00:00
Guido van Rossum 0688436305 Enhancements by Sjoerd Mullender: support for
from a.b import c
	import a . b
1998-10-12 15:23:04 +00:00
Guido van Rossum 7a840e8d50 Add support for dotted module names to readmodule(). 1998-10-12 15:21:38 +00:00
Guido van Rossum 1c5fb1cd1b Make mimetypes.guess_type understand data URLs. (Sjoerd Mullender) 1998-10-12 15:12:28 +00:00
Guido van Rossum 56440a58f7 Fix two bugs in the fstat() line, reported by Fredruk Lundh. 1998-10-07 14:06:03 +00:00
Guido van Rossum d832f9e425 Fix append() calls with more than 1 argument. 1998-10-07 13:18:17 +00:00
Guido van Rossum da65450530 The message "Exception in Tkinter callback" should go to stderr.
Fix bug in NoDefaultRoot() -- _default_root wasn't declared global;
and made it reentrant.

Don't set _default_root to whatever master gets passed in to
BaseWidget._setup() (only set it when we need to create a new Tk()
widget).
1998-10-06 19:06:27 +00:00
Guido van Rossum 96372a2657 ST_MODE should be ST_MTIME in utime call in copystat. Thanks to Mike Orr. 1998-10-02 03:16:08 +00:00
Guido van Rossum 64e736ba4e Some new blood and some updated versions. 1998-10-02 01:23:47 +00:00
Guido van Rossum 4581a0c07b New test_long.py from Tim Peters. 1998-10-02 01:19:48 +00:00
Barry Warsaw 4cbe3876ec NSEW is also valid for -sticky 1998-10-01 15:54:48 +00:00
Barry Warsaw 9190046289 Added NS and EW constants, which are meaningful values for grid's
-sticky option.
1998-10-01 13:49:37 +00:00
Guido van Rossum f984a65267 Fix suggested by Sjoerd (long ago!) to get a better error message when
there's a syntax error.  (In particular, display the correct
filename).  This changes the API: if there's a syntax error, the
function now returns normally after dumping the error to sys.stderr.
I changed Sjoerd's use of string.join(string.split(...)) with
string.replace().
1998-09-29 15:57:42 +00:00
Guido van Rossum 26367a001d New version from Piers Lauder, who writes:
Added a debug function to replace 'print' statements.
Ensured that response attached to 'NO' replies is passed back.
added readonly exception.
Rearranged method order into types.
Ensure select returns a meaningful error on 'NO'.
'NO' returns from authenticate and login raise error with last message,
not list.
1998-09-28 15:34:46 +00:00
Guido van Rossum 75bb54c3d8 Don't set a local variable named __args__; this feature no longer
works and Greg Ward just reported a problem it caused...
1998-09-28 15:33:38 +00:00
Guido van Rossum 9ab96d40eb Changes by Eric Raymond:
1. Generate a correct Content-Length header visible through the info() method
   if a request to open an FTP URL gets a length in the response to RETR.

2. Take a third argument to urlretrieve() that makes it possible to progress-
   meter an urlretrieve call (this is what I needed the above change for).
   See the second patch band below for details.

3. To avoid spurious errors, I commented out the gopher test.  The target
   document no longer exists.
1998-09-28 14:07:00 +00:00
Barry Warsaw 9195f55bbf Updated the docstring and class hierarchy diagram 1998-09-25 22:43:21 +00:00
Guido van Rossum f7d77009c1 Add two constants (with the same value) to specify the on-board CD input. 1998-09-24 18:09:47 +00:00
Guido van Rossum 5227f0fdcd Reworked it quite a bit. There are now two classes: a base class,
InteractiveInterpreter, which handles parsing and interpreter state
but doesn't know deal with buffering or prompting or input file
naming.  And a derived class, InteractiveConsole, which adds buffering
and prompting and supports setting the filename once.  Also tweak the
algorithm in compile_command() a bit so that input consisting of all
blank lines or comments always succeeds immediately, and note the fact
that apart from SyntaxError it can also raise OverflowError.
1998-09-22 20:38:53 +00:00
Guido van Rossum 0238a25b20 Do the check for lacking sys.stdin.fileno() *before* testing for
Windows.  If sys.stdin doesn't appear to be a real file (characterized
by having a working fileno()), don't use any console specific methods
-- go straight to the default.
1998-09-22 02:38:42 +00:00
Guido van Rossum ef0056ae1a When sys.stdin.fileno() doesn't work, fall back to default_getpass()
-- don't just die.
1998-09-21 20:00:35 +00:00
Guido van Rossum 4ecd85aad7 After the previous changes, func_normalize() turned out to be redundant.
This simplified some other places in the code.
1998-09-21 17:40:47 +00:00
Guido van Rossum b0a94c0549 Changes so that JPython can also use this version of profile.py.
Suggested by Jim Hugunin.
1998-09-21 16:52:44 +00:00
Guido van Rossum f07029e4ba Get rid of the classes RModuleLoader and RModuleImporter -- these were
only there to override reload() in a way that doesn't make a whole lot
of sense and moreover broke since the latest changes in ihooks.
1998-09-21 14:53:26 +00:00
Guido van Rossum e3f8a64906 Comment out 't = t[0] + t[1]' in profiler_simulation() -- this
function is only used when running the calibration code, and it turns
out that recent changes in the timing code caused this statement to
raise an exception.
1998-09-21 14:52:22 +00:00
Guido van Rossum fc076d4ce2 Untabified and applied Richard Wolff's changes (plus my own reflowing
of some paragraphs).
1998-09-17 15:01:38 +00:00
Guido van Rossum 3a98e78a6e Richard Wolff's additional changes; some layout nits, and change the
alias delimiter to ';;'.
1998-09-17 15:00:30 +00:00
Guido van Rossum 743d17e3aa In load_inst(), when instantiating an instance the old way (i.e. when
there's an __getinitargs__() method), if a TypeError occurs, catch and
reraise it but add info to the error about the class name being
instantiated.  This makes debugging a lot easier if __getinitargs__()
returns something bogus (e.g. a string instead of a singleton tuple).
1998-09-15 20:25:57 +00:00
Guido van Rossum 0c92000b7a Ignore the TclError exception raised when deleting the registration
for callit, used by the after() command.  This can happen when the
callback deletes the window.
1998-09-14 19:06:39 +00:00
Guido van Rossum 8d5bef7fb8 There was a confusion in my checkin of the code to support list() with
and without a message number argument: the argument was called 'msg'
but the code expected it to be called 'which'.  In line with the other
methods, I've renamed the argument to 'which', and adapted the doc
string not to refer to 'msg'.
1998-09-14 17:36:51 +00:00
Guido van Rossum f9a6d7d494 Print serious errors to stderr instead of stdout. 1998-09-14 16:22:21 +00:00
Guido van Rossum 7944ea523e Patch by Marc-Andre Lemburg: use re module to compare test results.
This makes it possible to accept that on Linux %w returns "01" instead
of "1", for example.
1998-09-14 15:50:40 +00:00
Guido van Rossum f0a275d4db Richard Wolff's changes:
pdb.doc		Updated to reflect better the various changes.
1998-09-12 14:42:23 +00:00
Guido van Rossum 2424f855f3 Richard Wolff's changes:
pdb.py  Uses the Breakpoint class so one can enable/disable breakpoints,
	set temporary ones, set ignore counts, and conditions.  The last
	can be set using the 'b' command
		b 243 , i>4		( b 243,i>4 if you are space adverse)
	or with the condition command so conditions can be changed
	for a particular breakpoint.

	Breakpoints are numbered from 1 on, and if a breakpoint is deleted,
	the number is not reused.  All the breakpoint handling commands
	refer to breakpoints by number.  To be consistent, the clear command
	does so as well, which is the one change from the original pdb that
	is not transparent.  Thus only the breakpoint command 'b' uses a
	line number or file:line or method.  You can also give
		b whrandom.random    and the method will be searched for along
	sys.path.  This is implemented with an 'egrep' command and so
	is not as portable as it might be.  [ see  lineinfo() and
	lineinfoCmd ]

	Breakpoints cannot be set at a line that is blank or a '#' comment
	or starts a triply quoted comment.  This is because I would like
	this behavior in my DDD interface and think it reasonable for
	pdb as well.  It can be removed readily, however as it is all
	incorporated in the routine checkline().  If one attempts to
	set a breakpoint at a 'def' line, the breakpoint is automatically
	moved to the first executable line after the 'def'.  This too is
	in checkline().

	do_EOF() returns zero so typing an end-of-file character as a command
	does nothing.  'quit' does the quitting.

	The routine defaultFile() is present so as to preserve the current
	pdb behavior and yet allow me to override it in pydb.

	There's some code in lineinfo() that is probably mainly useful only
	for pydb and if you prefer, much up to the comment "Best first guess"
	could be removed.

	Keith Davidson provided the code for handling $HOME/.pdbrc and
	./.pdbrc, and it has been incorporated.  He also provided the
	alias handling routine.  I modified it a bit so it could live
	nicely in precmd().  He and I have been in contact; he has the
	new pdb (and pydb) with his code incorporated.  He also asked
	about the possibility of allowing multiple commands on one
	line, such as step;step  or s;s  or with an alias such as
		alias ct tbreak %1 ; continue
	and since it was so easy, that's in place as well.  It's a simple
	'split the line at the first ";"' operation and puts the second
	half in the command queue (self.cmdqueue).  This has the unfortunate
	effect of destroying a line like   print "i: "+i+"; j: "+j
	but either there's a simple way to deal with this, or my attitude
	will remain that pdb is a debugger, not a compiler/parser/etc.
	An alias like   alias 4s  s;;s;
	will work because the adjacent and trailing ";" act like a <cr> which
	repeats the last command.  Of course, either s;s;s;s or s;;;  would be
	a bit more sensible.

	The help commands have been updated.
1998-09-11 22:50:09 +00:00
Guido van Rossum d93643fe4a Richard Wolff's changes:
bdb.py  now has a class definition called Breakpoint along with
	associated methods.  There's no reason why this class has to
	be there; if you prefer it elsewhere, 'tis easily done.

(Minor reformatting by GvR; e.g. moved Breakpoint's doc string to
proper point.)
1998-09-11 22:38:35 +00:00
Guido van Rossum 5fca6fd2d9 Richard Wolff's changes:
cmd.py  has incorporated the changes we discussed a couple of weeks ago
	(a command queue, returning line from precmd, and stop from postcmd)
	and some changes to help that were occasioned because I wanted to
	inherit from pdb which inherits from cmd.py and the help routine
	didn't look for commands or the associated help deeply enough.
1998-09-11 22:33:08 +00:00
Guido van Rossum a063303693 Patch suggested by Perry Stoll -- os.path.normpath(".//x") returned
"/x", should return "x".
1998-09-08 22:28:06 +00:00
Jeremy Hylton b85c8479eb Easy optimizations of urlparse for the common case of parsing an http URL.
1. use dict.get instead of try/except KeyError
2. if the url scheme is 'http' then avoid the series of
   'if var in [someseq]:'.  instead, inline all of the code.
3. find = string.find
1998-09-02 21:53:16 +00:00
Guido van Rossum f6ae743cb5 Fix suggested by movits@lockstar.com (plus doc string by myself)
for LIST command with msg argument.
1998-09-02 14:42:02 +00:00
Guido van Rossum c86b7c63e0 Make bind variants without a sequence return a tuple of sequences
(formerly it returned a string, which wasn't very convenient).

Add image commands to the Text widget (these are new in Tk 8.0).
1998-08-31 16:54:33 +00:00
Guido van Rossum b9f48608f6 Changes by Richard Wolff:
1) I added a command queue which is helpful to me (at least so far) and
   would also allow syntax like 's;s' (step; step) in conjunction with precmd
2) doc_leader allows the derived class to print a message before the help
   output.  Defaults to current practise of a blank line
3) nohelp allows one to override the 'No help on' message.  I need
    'Undefined command: "%s".  Try "help".'
4) Pass line to self.precmd to allow one to do some parsing: change first
   word to lower case, strip out a leading number, whatever.
5) Pass the result of onecmd and the input line to postcmd.  This allows
   one to ponder the stop result before it is effective.
6) emptyline() requires a   if self.lastcmd:  conditional because if the
   first command is null (<cr>), you get an infinite recursion with the
   code as it stands.
1998-08-27 19:02:51 +00:00