Jack Jansen [Thu, 20 Feb 1997 15:25:49 +0000 (15:25 +0000)]
- Put USE_MAC_DYNAMIC_LOADING beack here in stead of auto-enabling it
in importdl.c (I had just one crash too many with a static python
importing a dynamic module)
- On powerpc, enable USE_CACHE_ALIGNED with a linesize of 32 bytes.
Guido van Rossum [Tue, 18 Feb 1997 21:53:32 +0000 (21:53 +0000)]
Restructured quite a bit, hopefully Lee Busby will find this useful.
Also grandly renamed.
Here's the new interface:
When WITH_READLINE is defined, two functions are defined:
- PyOS_GnuReadline (what used to be my_readline() with WITH_READLINE)
- PyOS_ReadlineInit (for Dave Ascher)
Always, these functions are defined:
- PyOS_StdioReadline (what used to be my_readline() without WITH_READLINE)
- PyOS_Readline (the interface used by tokenizer.c and [raw_]input().
There's a global function pointer PyOS_ReadlineFunctionPointer,
initialized to NULL. When PyOS_Readline finds this to be NULL, it
sets it to either PyOS_GnuReadline or PyOS_StdioReadline depending on
which one makes more sense (i.e. it uses GNU only if it is defined
*and* stdin is indeed a tty device).
An embedding program that has its own wishes can set the function
pointer to a function of its own design. It should take a char*
prompt argument (which may be NULL) and return a string *ending in a
\n character* -- or "" for EOF or NULL for a user interrupt.
--Guido van Rossum (home page: http://www.python.org/~guido/)
Barry Warsaw [Tue, 18 Feb 1997 18:52:55 +0000 (18:52 +0000)]
Store the current regex syntax along with the regular expression
string as the key to the cache. This means that changing the syntax
will return the correct compiled pattern.
Guido van Rossum [Tue, 18 Feb 1997 16:55:33 +0000 (16:55 +0000)]
Put back #! /usr/local/bin/python. For cgi scripts, /usr/bin/env is
unlikely to find a python binary, as /usr/local/bin is usually not on
the default search path.
Guido van Rossum [Sat, 15 Feb 1997 18:33:24 +0000 (18:33 +0000)]
Require _tkinter -- don't attempt to import tkinter when _tkinter does
not exist. All 8 uses of tkinter are replaced with _tkinter. Still
create a variable tkinter though, because that is used by other
modules importing Tkinter (e.g. tkinter.createfilehandler()).
Also added a comment to the 'import _tkinter' line saying that if this
fails, Python is not configured correctly.
Guido van Rossum [Fri, 14 Feb 1997 19:50:32 +0000 (19:50 +0000)]
My version of Lee Busby's patches to make '-i' pretend stdin is a tty
even if it isn't. Changes:
- set the global flag Py_InteractiveFlag when -i is given
- call Py_FdIsInteractive() instead of isatty()
- make stdin unbuffered, too, when using -u
- make stdin and stdout line buffered, when stdin is interactive and not -u
Note that setting the environment variable PYTHONINSPECT does not have
these extra effects of -i. (Should it?)
Unlike Lee's changes, I don't set change the prompt to go to stderr
when -i is given.
Guido van Rossum [Fri, 14 Feb 1997 19:45:36 +0000 (19:45 +0000)]
Added new global flag variable Py_InteractiveFlag and new function
Py_FdIsInteractive(). The flag is supposed to be set by the -i
command line option. The function is supposed to be called instead of
isatty(). This is used for Lee Busby's wish #1, to have an option
that pretends stdin is interactive even when it really isn't.
Guido van Rossum [Fri, 14 Feb 1997 16:32:14 +0000 (16:32 +0000)]
*Don't* kill all local variables on function exit. This will be done
by the frameobject dealloc when it is time for the locals to go. When
there's still a traceback object referencing this stack frame, we
don't want the local variables to disappear yet.
(Hmm... Shouldn't they be copied to the f_locals dictionary?)
Guido van Rossum [Fri, 14 Feb 1997 16:29:22 +0000 (16:29 +0000)]
Slight tweak: in string_hash(), if the hash hasn't been computed yet,
and if there's a pointer to an interned version of the string, use its
hash and store its hash in this object, rather than recomputing it.
Guido van Rossum [Wed, 12 Feb 1997 16:49:57 +0000 (16:49 +0000)]
Put support for a cnf dictionary back in, since it is still supported
by all true Tkinter widgets. (Not that I *like* this module -- it
stinks, but until I have something better, I can't nuke it.)
Guido van Rossum [Tue, 11 Feb 1997 16:39:31 +0000 (16:39 +0000)]
Merged in Jack's fixes. This brings some lines beyond 79 chars again;
I'll clean that up later. Also corrected a mistake introduced by the
previous reformatting: an 'else' belonging to a 'for' was accidentally
reindented to belong to the 'if' inside the 'for'. Note that the
module uses inconsistent indentation -- most code is indented with 8
spaces, but some of the reformatted code uses 4 spaces. I'll fix this
later in the promised cleanup pass.
Restructured Checker class to get rid of 'ext' table.
Links are now either in 'todo' or 'done', and ext links
are hadled more like local links except that no further
links are gathered (and sometimes they aren't checked,
e.g. for mailto and news URLs). The -x option reverses
its meaning: it disables checking of ext links (they are
moved to 'done' without checking). A new 'errors' table
collects pages with bad links as we go -- redundant,
but useful for the GUI version which needs to report
this as we go. Some new methods, including reset().
New checkpoint format.
Adapted the GUI to the changes in the Checker class.
Added Quit and "Start over" buttons, and a checkbox
to disable checking external links. The details
window now also shows bad links emanating from the
selected page. Miscellaneous small chages.
Guido van Rossum [Fri, 31 Jan 1997 14:43:15 +0000 (14:43 +0000)]
Many misc changes.
- Faster HTML parser derivede from SGMLparser (Fred Gansevles).
- All manipulations of todo, done, ext, bad are done via methods, so a
derived class can override. Also moved the 'done' marking to
dopage(), so run() is much simpler.
- Added a method status() which returns a string containing the
summary counts; added a "total" count.
- Drop the guessing of the file type before opening the document -- we
still need to check those links for validity!
- Added a subroutine to close a connection which first slurps up the
remaining data when it's an ftp URL -- apparently closing an ftp
connection without reading till the end makes it hang.
- Added -n option to skip running (only useful with -R).
- The Checker object now has an instance variable which is set to 1
when it is changed. This is not pickled.
Guido van Rossum [Thu, 30 Jan 1997 15:54:58 +0000 (15:54 +0000)]
Move the 'import os' in URLopener.cleanup() to inside the block
guarded by 'if self.tempcache', to reduce the likelihood of this
causing an exception when invoked during __del__...
Guido van Rossum [Thu, 30 Jan 1997 04:26:57 +0000 (04:26 +0000)]
Some refinements of the external-link checking code: insert the errors
in the 'bad' dictionary (sanitize them so they are picklable; the
sanitation code is now a subroutine); don't check mailto: URLs; omit
colon in Error message.
Guido van Rossum [Thu, 30 Jan 1997 03:19:41 +0000 (03:19 +0000)]
Added robots.txt support, using Skip Montanaro's parser.
Fixed occasional inclusion of unpicklable objects (Message in errors).
Changed indent of a few messages.
Guido van Rossum [Wed, 29 Jan 1997 16:03:45 +0000 (16:03 +0000)]
Did nobody ever notice that "make test" didn't print the summary line
any more? This was because the *parent* process in test_socket.py did
an os._exit(0)! Getting rid of that now...
Guido van Rossum [Tue, 28 Jan 1997 00:00:11 +0000 (00:00 +0000)]
Changed the lookup algorithm again, based on Reimer Behrends's post.
The table size is now constrained to be a power of two, and we use a
variable increment based on GF(2^n)-{0} (not that I have the faintest
idea what that is :-) which helps avoid the expensive '%' operation.
Some of the entries in the table of polynomials have been modified
according to a post by Tim Peters.