Guido van Rossum [Tue, 17 Nov 1998 04:16:37 +0000 (04:16 +0000)]
Accept a non-list sequence for the long options (request by Jack Jansen).
Because it might be a common mistake to pass a single string, this
situation is treated separately.
Since we were making a copy of the longopts list anyway, we now use
the list() function -- this made it necessary to change all uses of
the local variable (and argument) 'list' to something more meaningful,
i.e., 'opts'.
Also added docstrings (copied from the library manual) and removed the
(now redundant) module comments.
Fred Drake [Mon, 16 Nov 1998 18:34:07 +0000 (18:34 +0000)]
Update the example in "Calling Python Functions from C" to use
METH_VARARGS conventions and PyArg_ParseTuple(), and document the flag
and where to look for PyArg_ParseTuple() info.
Response to comment from Don Bashford <bashford@scripps.edu>.
Jack Jansen [Sun, 1 Nov 1998 22:11:33 +0000 (22:11 +0000)]
Project files converted for CW Pro 4. And the daylight savings time switch seems to have "modified" the resource files (but nothing has changed there).
Barry Warsaw [Sat, 31 Oct 1998 22:52:54 +0000 (22:52 +0000)]
audio(7I) suggests that applications do the following to get the
device and control pseudo-device:
- first look for the device filename in the environment variable
AUDIODEV.
- if not found, use /dev/audio
- calculate the control device by tacking "ctl" onto the base device
name.
We now do this. Also, if the open fails, we call
PyErr_SetFromErrnoWithFilename() to give a more informative error
message.
Added a fileno() method to the audio object returned from open().
This returns the file descriptor which can be used by applications to
set up SIGPOLL notification, as per the manpage.
Fred Drake [Wed, 28 Oct 1998 20:08:35 +0000 (20:08 +0000)]
Don't describe something as "below"; that won't make sense for the
HTML version. Give a reference to the actual section to allow a
hyperlink to be built.
Barry Warsaw [Wed, 28 Oct 1998 00:10:45 +0000 (00:10 +0000)]
#XEmacs 21 now supports Imenu, so I am able to test (and fix) some
#simple things. First step: rename the Imenu supportive variables and
#functions in this file to py-imenu-* so I can grok what is part of
#python-mode and what is part of Imenu.
(py-imenu-create-index-engine): Fixed problem with two classes in a
single file, caused by new semantics of py-beginning-of-def-or-class
when called programmatically.
#Note, there are still some problems with Imenu when arguments to
#functions are funky, but it should be much better now.
Guido van Rossum [Sat, 24 Oct 1998 16:29:21 +0000 (16:29 +0000)]
Split the goto() function in two: _goto() is the internal one,
using Canvas coordinates, and goto() uses turtle coordinates
and accepts variable argument lists.
Guido van Rossum [Sat, 24 Oct 1998 01:34:45 +0000 (01:34 +0000)]
The TemporaryFile() function has a security leak -- because the
filenames generated are easily predictable, it is possible to trick an
unsuspecting program into overwriting another file by creating a
symbolic link with the predicted name. Fix this by using the
low-level os.open() function with the O_EXCL flag and mode 0700. On
non-Unix platforms, presumably there are no symbolic links so the
problem doesn't exist. The explicit test for Unix (posix, actually)
makes it possible to change the non-Unix logic to work without a
try-except clause.
Guido van Rossum [Thu, 22 Oct 1998 20:15:36 +0000 (20:15 +0000)]
Jim Fulton writes:
"""
I've attached a long overdue patch to pickle.py to bring it to format
1.3, which is the same as 1.2 except that the binary float format
is supported. This is done using the new platform-indepent format
features of struct.
This patch also gets rid of the undocumented obsolete Pickler
dump_special method.
"""
Barry Warsaw [Thu, 22 Oct 1998 18:51:22 +0000 (18:51 +0000)]
__init__(): Removed initialcolor keyword.
show(): added color keyword here so that the selected color can be
chosen on each invocation of askcolor().
Also fixed this class, and askcolor() so that the same Chooser
instance can be re-used instead of creating a new one on each
invocation of askcolor().
Added a module function save() which can be used to explicitly save
the option database in ~/.pynche. This does not happen automatically
when used as a modal.
Barry Warsaw [Thu, 22 Oct 1998 03:44:52 +0000 (03:44 +0000)]
Chooser.__init__(): Added `wantspec' keyword to conform exactly to
tkColorChooser.askcolor() interface (i.e. don't return a color name
even if there is an exact match).
Barry Warsaw [Thu, 22 Oct 1998 03:25:59 +0000 (03:25 +0000)]
Many changes to support a second mode of operation. Pynche can now be
run either as a standalone application (by running pynche or
pynche.pyw), or as a modal dialog inside another application. This
can be done by importing pyColorChooser and running askcolor(). The
API for this is the same as the tkColorChooser.askcolor() API, namely:
When `Okay' is hit, askcolor() returns ((r, g, b), "name"). When
`Cancel' is hit, askcolor() returns (None, None).
Note the following differences:
1. pyColorChooser.askcolor() takes an optional keyword `master'
which if set tells Pynche to run as a modal dialog. `master'
is a Tkinter parent window. Without the `master' keyword
Pynche runs standalone.
2. in pyColorChooser.askcolor() will return a Tk/X11 color name as
"name" if there is an exact match, otherwise it will return a
color spec, e.g. "#rrggbb". tkColorChooser can't return a
color name.
There are also some UI differences when running standalone vs. modal.
When modal, there is no "File" menu, but instead there are "Okay" and
"Cancel" buttons.
The implementation of all this is a bit of a hack, but it seems to
work moderately well. I'm not guaranteeing the pyColorChooser.Chooser
class has the same semantics as the tkColorChooser.Chooser class.
Guido van Rossum [Wed, 21 Oct 1998 17:03:36 +0000 (17:03 +0000)]
Add note about compiling FORMS with -Dclear=__GLclear.
(The GLHACK variable isn't really needed since the change to
glmodule.c, but I'm too busy to remove it. It's harmless.)
Guido van Rossum [Wed, 21 Oct 1998 16:10:40 +0000 (16:10 +0000)]
Check in the changed version after running the stubber again -- this
solves the conflict with curses over the 'clear' entry point much
nicer. (Jack had checked in the changes to cstubs eons ago, but I
never regenrated glmodule.c :-( )
Guido van Rossum [Wed, 21 Oct 1998 15:08:40 +0000 (15:08 +0000)]
On a recommendation from Sjoerd Mullender, add -Dclear=__GLclear to
the compilation flags for the gl, fl and fm modules. This avoids a
name conflict with the curses module (both gl and curses have an entry
point called 'clear').
"""
the NEWS file of Python 1.5.2a2 inspired me to look at
Tools/scripts/untabify.py. I wonder why it accepts a -t argument
but ignores it. The following patch tries to make it somewhat useful
(i.e., to override the tabsize=8 setting). Is that agreeable?
"""
Guido van Rossum [Tue, 20 Oct 1998 14:43:02 +0000 (14:43 +0000)]
Patch by Jim Fulton, who writes:
"""
The FieldStorage constructor calls the read_multi method. The read_multi
method creates new FieldStorage objects, re-invoking the constructor
(on the new objects). The problem is that the 'environ', 'keep_blank_values',
and 'strict_parsing' arguments originally passed to the constructor are not
propigated to the new object constructors. This causes os.environ to be used,
leading to a miss-handling of the parts.
I fixed this by passing these arguments to read_multi and then on to the
constructor. See the context diff below.
"""
Guido van Rossum [Mon, 19 Oct 1998 13:28:26 +0000 (13:28 +0000)]
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)