Jeremy Hylton [Tue, 28 Jul 1998 17:30:06 +0000 (17:30 +0000)]
fix __str__ method of EnvironmentError (base class of IOError): was
using "%d" % errno to print out IOError exceptions -- but urllib.py
raises exceptions where the errno slot in the exception tuple is a
string.
Fred Drake [Fri, 24 Jul 1998 22:16:04 +0000 (22:16 +0000)]
Added module synopsis support with one (big) caveat: All the modules are
listed in each chapter that has a \localmoduletable. This will be fixed,
and everything else seems to be working fine.
Document makedirs(), removedirs(), renames() -- ESR-inspired super-versions
of mkdir(), rmdir() and rename() that make or remove intermediate
directories as well.
Add makedirs(), removedirs(), renames() -- ESR-inspired super-versions
of mkdir(), rmdir() and rename() that make or remove intermediate
directories as well.
Use 'S' format character for the optional constructor argument, so we
get a decent error message when it's not a string (instead of
confusing errors when trying to use the thing).
Fred Drake [Fri, 24 Jul 1998 15:19:38 +0000 (15:19 +0000)]
Remove use of the avant package; Helvetica isn't as pretty, but works for
acroread. The problem this solves is likely dependent on font availability,
so keeping things simple is a good solution.
Fred Drake [Fri, 24 Jul 1998 13:56:11 +0000 (13:56 +0000)]
Move files around to get the names to match the module names except for
case. Two modules (SocketServer, BaseHTTPServer) still don't match; those
names are just too long!
Fred Drake [Thu, 23 Jul 1998 21:41:02 +0000 (21:41 +0000)]
\textunderscore: Re-define with a width that's more appropriate for the
courier font used in Python code. This still isn't *good*, but
makes the width about right in most cases. (Exception: it's now
a little wide in \var words.)
Fred Drake [Thu, 23 Jul 1998 19:33:08 +0000 (19:33 +0000)]
Use the new module synopsis syntax, even though we don't need a synopsis table
for this chapter. This protects against backend changes for \declaremodule.
Fred Drake [Thu, 23 Jul 1998 19:13:52 +0000 (19:13 +0000)]
use_latex(): Hack to pass .syn files though uniq, so that the last module
in a HOWTO document isn't listed in the synopsis table twice. This
will do until the real bug is found (low priority!).
Fred Drake [Thu, 23 Jul 1998 17:50:45 +0000 (17:50 +0000)]
Lots of new stuff for "module synopsis support." Public interface consists
of three macros, one which replaces some of the current conventions used in
the module sections:
\declaremodule: Requires two parameters: module type (standard, builtin,
extension), and the module name. An optional parameter should be
given as the basis for the module's "key" used for linking to or
referencing the section. The "key" should only be given if the
module's name contains underscores, and should be the name with the
underscore's stripped. This should be the first thing after the
\section used to introduce the module.
\modulesynopsis: Requires a single parameter: a short, one-liner
description of the module that can be used as part of the chapter
introduction. This should probably be placed just after the
\declaremodule, but may be placed anywhere in the same section.
\localmoduletable: No parameters. If a .syn file exists for the current
chapter (or for the entire document in howto docs), a synopsistable
is created with the contents loaded from the .syn file.
Some re-organization due to module synopsis support.
Barry Warsaw [Thu, 23 Jul 1998 16:07:02 +0000 (16:07 +0000)]
PyFile_FromString(): If an exception occurs, pass in the filename that
was used so it's reflected in the IOError. Call
PyErr_SetFromErrnoWithFilename().
Barry Warsaw [Thu, 23 Jul 1998 16:05:56 +0000 (16:05 +0000)]
PyErr_SetFromErrnoWithFilename(): New function which supports setting
an exception from errno, with a supplied filename (primarily used by
IOError and OSError). If class exceptions are used then the exception
is instantiated with a 3-tuple: (errno, strerror, filename). For
backwards compatibility reasons, if string exceptions are used,
filename is ignored.
PyErr_SetFromErrno(): Implement in terms of
PyErr_SetFromErrnoWithFilename().
Barry Warsaw [Thu, 23 Jul 1998 16:03:46 +0000 (16:03 +0000)]
Added support for including the filename in IOErrors and OSErrors that
involve a filesystem path. To that end:
- Changed IOError to EnvironmentError and added a hack which checks
for arg of len 3. When constructed with a 3-tuple, the third item
is the filename and this is squirreled away in the `filename'
attribute. However, for in-place unpacking backwards
compatibility, self.args still only gets the first two items. Added
a __str__() which prints the filename if it is given.
- IOError now inherits from EnvironmentError
- New class OSError which also inherits from EnvironmentError and is
used by the posix module.
Barry Warsaw [Thu, 23 Jul 1998 15:59:57 +0000 (15:59 +0000)]
Added support for two new standard errors: EnvironmentError and
OSError. The EnvironmentError serves primarily as the (common
implementation) base class for IOError and OSError. OSError is used
by posixmodule.c
Also added tuple definition of EnvironmentError when using string
based exceptions.
Jack Jansen [Wed, 22 Jul 1998 13:37:37 +0000 (13:37 +0000)]
- Added a function MoviesTask, which is the same as the method but
with a null movie (giving time to all active movies)
- Made the graphics world parameter to SetMovieGWorld optional.
When comparing objects, always check that tp_compare is not NULL
before calling it. This check was there when the objects were of the
same type *before* coercion, but not if they initially differed but
became the same *after* coercion.
Added support for specifying a filename for a breakpoint, roughly
according to an idea by Harri Pasanen (but with different syntax).
This affects the 'break' and 'clear' commands and their help
functions. Also added a helper method lookupmodule().
Also:
- Try to import readline (important when pdb is used from/as a script).
- Get rid of reference to ancient __privileged__ magic variable.
- Moved all import out of functions to the top.
- When used as a script, check that the script file exists.