Greg Ward [Mon, 6 Mar 2000 03:40:29 +0000 (03:40 +0000)]
Serious overhaul of the C compiler interface and the two classes that
implement it (so far):
* moved filename generation methods into CCompiler base class,
driven by data supplied by implementation classes
* moved a bunch of common code from UnixCCompiler to convenience
methods in CCompiler
* overhauled MSVCCompiler's compile/link methods to look and act
as much as possible like UnixCCompiler's, in order to regularize
both interface and behaviour (especially by using those new
convenience methods)
Greg Ward [Mon, 6 Mar 2000 03:36:50 +0000 (03:36 +0000)]
Don't pass 'keep_dir' to 'compile()' method of CCompiler -- no longer used.
Don't assume that the 'libraries' and 'library_dirs' elements of the
build info dict are always lists.
Jack Jansen [Fri, 3 Mar 2000 16:03:06 +0000 (16:03 +0000)]
Added PutPixMapBytes() and GetPixMapBytes() functions that allow getting at
pixmap data.
Added an as_GrafPort() method to be able to use a GWorld as argument to
routines that expect a GrafPort.
Changes the one regexp in PyParse capable of making the re module blow the C
stack when passed unreasonable <0.9 wink> program text. Jeremy Hylton
provoked this with a program of the form:
x = (1,
2,
... # 9997 lines deleted here
10000,
)
Programs "like this" will no longer (no matter how many lines they contain)
trigger re death. OTOH, you can now make another class of unreasonable
program that will take much longer to parse.
Greg Ward [Thu, 2 Mar 2000 01:57:12 +0000 (01:57 +0000)]
Renamed 'build_lib' command to 'build_clib':
* replaced build_lib.py with build_clib.py
* renamed the class in build_clib.py
* changed all references to 'build_lib' command in other command classes
Greg Ward [Thu, 2 Mar 2000 01:32:21 +0000 (01:32 +0000)]
If the "build_lib" command built any C libraries, link with them all
when building extensions (uses build_lib's 'get_library_names()' method).
Ensure that the relative structure of source filenames is preserved in
the temporary build tree, eg. foo/bar.c compiles to
build/temp.<plat>/foo/bar.o.
Greg Ward [Thu, 2 Mar 2000 01:27:36 +0000 (01:27 +0000)]
Added command description.
Added 'build_clib' and 'build_temp' options (where to put C libraries
and where to put temporary compiler by-products, ie. object files).
Moved the call to 'check_library_list()' from 'run()' to 'finalize_options()'
-- that way, if we're going to crash we do so earlier, and we guarantee
that the library list is valid before we do anything (not just run).
Disallow directory separators in library names -- the compiled library
always goes right in 'build_clib'.
Added 'get_library_names()', so the "build_ext" command knows what
libraries to link every extension with.
Greg Ward [Thu, 2 Mar 2000 01:21:54 +0000 (01:21 +0000)]
In the 'compile()' method: preserve the directory portion of source
filenames when constructing object filenames, even if output_dir given --
eg. "foo/bar.c" will compile to "foo/bar.o" without an output_dir, and to
"temp/foo/bar.o" if output_dir is "temp".
Greg Ward [Wed, 1 Mar 2000 21:51:56 +0000 (21:51 +0000)]
Second attempt to fix the ctermid_r/tmpnam_r warnings: define USE_CTERMID_R
and USE_TMPNAM_R at the top of the file and refer to them later; this
catches a second reference to 'tmpnam_r' that I didn't spot first time around.
Greg Ward [Wed, 1 Mar 2000 01:43:28 +0000 (01:43 +0000)]
Build reorg:
* 'build_dir' -> 'build_lib', which by default takes its value
straight from 'build_lib' in the 'build' command
* added 'build_temp' and 'inplace' options
* change 'build_extensions()' to put object files (compiler turds) in
'build_temp' dir
* complicated the name-of-extension-file shenanigans in
'build_extensions()' to support "in-place" extension building, i.e.
put the extension right into the source tree (handy for developers)
* added 'get_ext_fullname()', renamed 'extension_filename()' to
'get_ext_filename()', and tweaked the latter a bit -- all to support
the new filename shenanigans
Greg Ward [Wed, 1 Mar 2000 01:26:45 +0000 (01:26 +0000)]
Build reorg:
* 'build_lib' -> 'build_purelib'
* new 'build_lib' and 'build_temp' options
* use 'get_platform()' to initialize 'build_platlib' and 'build_temp'
Guido van Rossum [Tue, 29 Feb 2000 15:52:40 +0000 (15:52 +0000)]
Patch by Fred Gansevles (the module's original author).
This patch fixes 3 small problems.
1) If a map is used which is generated with 'makedbm -a',
the trailing '\0' is now handled correctely.
2) The nis.maps() function skipped the first map in the output list.
3) The library '-lnsl' is added in Setup.in (needed on Linux glibc2 and
Solaris systems. Maybe on other systems too?)
[I note that this still doesn't work when you are using NIS+ --GvR]
Fred Drake [Tue, 29 Feb 2000 05:19:38 +0000 (05:19 +0000)]
Update portability information for the spawn*() functions and related
constants. Someone will need to fill in information on the spawn*()
functions that aren't listed.
Fred Drake [Mon, 28 Feb 2000 20:59:03 +0000 (20:59 +0000)]
(Finally!) Changes related to the ConfigParser/INI-file topics
discussed on c.l.py last January. Specifically:
- more characters allowed in section & option names
- if '=' is used to separate the option & value, the value can be
followed by a comment of the form '\s;'
Guido van Rossum [Mon, 28 Feb 2000 19:52:53 +0000 (19:52 +0000)]
Drop the support level for stdwin a notch -- the contents of
lib-stdwin is no longer installed.
Increase the support level for other obsolete modules a bit: install
lib-old by default. It still isn't in the path by default, but at
least it's easier to add to your $PYTHONPATH this way. (This makes
sense because in 1.6 we're much more aggressive with declaring modules
obsolete.)
Guido van Rossum [Mon, 28 Feb 2000 15:03:15 +0000 (15:03 +0000)]
Patch by Mozhe Zadka, for __contains__ (overloading 'in'). This adds
an instance method instance_contains as sq_contains. It looks for
__contains__ and if not found falls back to previous behaviour.
Done.
Guido van Rossum [Mon, 28 Feb 2000 15:00:40 +0000 (15:00 +0000)]
Patch by Mozhe Zadka, for __contains__ (overloading 'in'). This adds
a new proc type (objobjproc), a new slot sq_contains to
PySequenceMethods, and a new flag Py_TPFLAGS_HAVE_SEQUENCE_IN to
Py_TPFLAGS_DEFAULT. More to follow.
Barry Warsaw [Sat, 26 Feb 2000 20:56:47 +0000 (20:56 +0000)]
Changes submitted by Peter Funk (some fixes/additions by B.Warsaw) to
make pygettext more compatible with GNU xgettext, specifically:
Added -E/--escape for allowing pass-thru of iso8859-1 characters above
7 bits.
Added -o/--output option for renaming the output file from
messages.pot (there's overlap with -d/--default-domain, but GNU
xgettext has them both).
Added -p/--output-dir for specifying the output directory for
messages.pot.
Added -V/--version for printing the version number.
Added -w/--width for specifying the output page width (this is because
now pygettext, like GNU xgettext will put several locations on the
same line to cut down on vertical space).
Added -x/--exclude-file for specifying a list of strings that are not
to be extracted from the input files.
Bumped version number to 1.0
Try to import fintl and use fintl.gettext as _ if available. Fall
back is to use identity definition of _().
Moved the escape creation to a function make_escapes() so that its
behavior can be controlled by the -E option.
__openseen(): Support the -x option.
write(): Support -w option and vertical space preserving feature.
Greg Ward [Sat, 26 Feb 2000 00:49:04 +0000 (00:49 +0000)]
Unfinished, untested implementation of the lovely baroque installation scheme
cooked up by Fred Drake and me. Only saved for posterity (whoever posterity
is), as it is about to be ditched in favour of GvR's much simpler design.
Barry Warsaw [Fri, 25 Feb 2000 21:54:19 +0000 (21:54 +0000)]
Changes inspired by Randall Hooper to allow callbacks when an
OptionMenu is modified. Somewhat rewritten and elaborated by myself.
class _setit: The constructor now takes an optional argument
`callback' and stashes this in a private variable. If set, the
__call__() method will invoke this callback after the variable's value
has changed. It will pass the callback the value, followed by any
args passed to __call__().
class OptionMenu: The constructor now takes keyword arguments, the
only one that's legally recognized is `command', which can be set to a
callback. This callback is invoked when the OptionMenu value is set.
Any other keyword argument throws a TclError.
Guido van Rossum [Fri, 25 Feb 2000 19:26:31 +0000 (19:26 +0000)]
Pat Knight:
Solaris 2 has stub implementations of the POSIX thread functions such as
pthread_detach in libc. This means that configure tries to use them without
-lpthread, then the test of pthread_create fails and the configuration
falls back to the Solaris thread library. This patch moves the test for
pthread_create in -lpthread ahead of the test for pthread_detach in libc.
The patch also ensures that -lpthread is at the start of the library list
when linking, to pick up POSIX thread semantics for fork (see below).
Justification.
Use of POSIX threads on Solaris ensures that the fork() call only runs the
thread that called fork() in the child. This is desirable to prevent (for
example) parent server or database threads running in the child. Sun's
-lthread library uses a traditional fork() which replicates all the
parent's threads in the child. I find this undesirable.
Digression.
The configure.in seems to always test for -lthread even if a POSIX library
is found. I'm not enough of a configure.in wizard to decide whether this is
desirable or how to fix it. It is also irrelevant to this patch - I just
spotted it while testing.
End of Digression.
Guido van Rossum [Thu, 24 Feb 2000 15:26:30 +0000 (15:26 +0000)]
Peter Funk:
This patch allows building the Python 'mpzmodule' under SuSE Linux
without having to install the source package of the GMP-libary.
The gmp-mparam.h seems to be an internal header file. The patch
shouldn't hurt any other platforms.
Guido van Rossum [Thu, 24 Feb 2000 15:23:03 +0000 (15:23 +0000)]
Made all list methods use PyArg_ParseTuple(), for more accurate
diagnostics.
*** INCOMPATIBLE CHANGE: This changes append(), remove(), index(), and
*** count() to require exactly one argument -- previously, multiple
*** arguments were silently assumed to be a tuple.
Guido van Rossum [Thu, 24 Feb 2000 02:24:50 +0000 (02:24 +0000)]
Piers Lauder:
A change in my last patch could, under certain circumstances,
cause a loop if the connection to the server dropped while
waiting for a command completion. I've changed the code to
re-raise the error after possible debugging output.
Allow using long integers as arguments to PyObject_GetItem(), _SetItem(),
and _DelItem().
In sequence multiplication by a long, only call PyErr_Occurred() when the
value returned is -1.
Guido van Rossum [Wed, 23 Feb 2000 15:32:19 +0000 (15:32 +0000)]
Added tabnanny.py, by Tim Peters, formerly from Tools/scripts, to the
standard library. Added some comments:
# XXX Note: this is now a standard library module.
# XXX The API needs to undergo changes however; the current code is too
# XXX script-like. This will be addressed later.
Guido van Rossum [Tue, 22 Feb 2000 00:19:58 +0000 (00:19 +0000)]
Added a new command: Check module (Alt-F5) It does a full syntax check
of the current module. It also runs the tabnanny to catch any
inconsistent tabs.
Also did a little bit of refactoring: added an errorbox() method to
simplify the display of error dialogs.
Guido van Rossum [Mon, 21 Feb 2000 16:50:31 +0000 (16:50 +0000)]
Mark pointed out a buglet in his patch: i < _sys_nerr isn't strong
enough, it could be negative. Add i > 0 test. (Not i >= 0; zero isn't
a valid error number.)