Fred Drake [Tue, 17 Jul 2001 20:52:51 +0000 (20:52 +0000)]
Start of a test suite for the "os" module -- this only tests the temporary
file management functions that have just been made available on more
platforms.
Jack Jansen [Tue, 17 Jul 2001 20:47:13 +0000 (20:47 +0000)]
Used an adapted MethodGenerator to generate methods too for functions that have the object as the second arg after a first CFAllocatorRef arg (which we pass as NULL always anyway).
Fred Drake [Tue, 17 Jul 2001 19:48:30 +0000 (19:48 +0000)]
Adding what's done of the documentation for the new profiling &
tracing interface. Incomplete, but better to check it in since I've
been including it in my updates.
Fred Drake [Tue, 17 Jul 2001 19:32:05 +0000 (19:32 +0000)]
The syntax trees handled by this module are not "abstract," so take the
"A" out of the internal abbreviations. For published functions with
"ast" in their names, make alternate offerings using just "st".
Add a really stupid warning about 'yield' used as an identifier.
This is really stupid because it cannot be suppressed or altered using
the warning framework; that's because the warning framework is built
on Python interpreter internals, and the parser generator doesn't have
access to any of those (you cannot use anything of type PyObject * in
the parser).
But it's better than nothing, and implementing a proper check for this
appears to require modifying compile.c in a dozen places, for which I
don't have the stamina today. I promise we'll do better in 2.2a2.
At least it tells you the filename and line number (unlike the first
hack I considered :-).
Fred Drake [Tue, 17 Jul 2001 16:48:55 +0000 (16:48 +0000)]
Make the syntax for compound command lines more portable (nmake, CygWin).
This is probably not sufficient by itself for the info generation, and is
being done mostly to keep the style consistent with additional patches
that will be applied to Doc/Makefile.
Fred Drake [Tue, 17 Jul 2001 16:46:14 +0000 (16:46 +0000)]
Script to re-write @FOO@-style marks with values, initializing the
replacement for @DATE@ from a TeX file containing a \date{...} mark
(such as texinputs/boilerplate.tex).
This will be used to re-write the html/index.html.in file instead of
a combination of grep, date, and sed -- this is more portable to non-Unix
platforms.
This solves part of the problem reported in SF patch #429611, but does
not use the suggested patch.
Fred Drake [Tue, 17 Jul 2001 14:46:09 +0000 (14:46 +0000)]
Job.__init__(): Only create the builddir directory if it will be used (by
building the HTML or text documentation). There is no need to create
it for other formats.
Job.build_html(): The builddir parameter is always passed in, so it need
not be optional.
Fred Drake [Tue, 17 Jul 2001 05:17:58 +0000 (05:17 +0000)]
Fix a couple of minor markup nits.
Footnotes should be added *after* punctuation, not before.
(Yes, this should be merged with the descr branch. Sorry, Tim!)
-c cmd run the command in a shell
-d enable the debugger
-i open an interactive shell
-i file(s) open a shell and also an editor window for each file
-r script run a file as a script in a shell
-s run $IDLESTARTUP or $PYTHONSTARTUP before anything else
-t title set title of shell window
Remaining arguments are applied to the command (-c) or script (-r).
******************
idles: Removed the idles script, not needed
******************
idle: Removed the IdleConf references, not required anymore
Barry Warsaw [Mon, 16 Jul 2001 20:44:16 +0000 (20:44 +0000)]
test_basic(): Add a test for "person@dom.ain (User J. Person)" which
was already correctly parsed (contrary to a comment in Mailman).
test_rfc2822_phrases(): RFC 2822 now requires that we allow `.' in
phrases, which means we must accept dots in unquoted realname parts.
Add a test to check the change in rfc822.py 1.58.
Barry Warsaw [Mon, 16 Jul 2001 20:40:35 +0000 (20:40 +0000)]
Fix address parsing to be RFC 2822 conformant. Specifically, dots are
now allowed in unquoted RealName areas (technically, they are defined
as "obsolete syntax" we MUST accept in phrases, as part of the
obs-phrase production). Thus, parsing
To: User J. Person <person@dom.ain>
correctly returns "User J. Person" as the RealName.
AddrlistClass.__init__(): Add definition of self.phraseends which is
just self.atomends with `.' removed.
getatom(): Add an optional argument `atomends' which, if None (the
default) means use self.atomends.
getphraselist(): Pass self.phraseends to getatom() and break out of
the loop only when the current character is in phraseends instead of
atomends. This allows dots to continue to serve as atom delimiters in
all contexts except phrases.
Also, loads of docstring updates to document RFC 2822 conformance
(sorry, this should have been two separate patches).
Thomas Wouters [Mon, 16 Jul 2001 15:47:36 +0000 (15:47 +0000)]
Fix SF #441664: Python crash on del of a slice of a mmap
Check for slice/item deletion, which calls slice/item assignment with a NULL
value, and raise a TypeError instead of coredumping. Bugreport and suggested
fix by Alex Martelli.
Kurt B. Kaiser [Mon, 16 Jul 2001 07:08:20 +0000 (07:08 +0000)]
Added installation instructions.
Added a patch which modifies idlefork so that it can co-exist with
"official" IDLE in the site-packages directory. This patch is not
necessary if only idlefork IDLE is installed. See INSTALLATION for further
details.
Kurt B. Kaiser [Mon, 16 Jul 2001 05:50:45 +0000 (05:50 +0000)]
Add a script "idles" which opens a Python Shell window.
The default behaviour of idlefork idle is to open an editor window instead
of a shell. Complex expressions may be run in a fresh environment by
selecting "run". There are times, however, when a shell is desired.
Though one can be started by "idle -t 'foo'", this script is more
convenient. In addition, a shell and an editor window can be started
in parallel by "idles -e foo.py".
Tim Peters [Mon, 16 Jul 2001 05:37:24 +0000 (05:37 +0000)]
Ugly. A pile of new xxxFlags() functions, to communicate to the parser
that 'yield' is a keyword. This doesn't help test_generators at all! I
don't know why not. These things do work now (and didn't before this
patch):
1. "from __future__ import generators" now works in a native shell.
2. Similarly "python -i xxx.py" now has generators enabled in the
shell if xxx.py had them enabled.
3. This program (which was my doctest proxy) works fine:
from __future__ import generators
source = """\
def f():
yield 1
"""
exec compile(source, "", "single") in globals()
print type(f())
Kurt B. Kaiser [Mon, 16 Jul 2001 04:00:10 +0000 (04:00 +0000)]
Add a script "idles" which opens a Python Shell window.
The default behaviour of idlefork idle is to open an editor window instead
of a shell. Complex expressions may be run in a fresh environment by
selecting "run". There are times, however, when a shell is desired.
Though one can be started by "idle -t 'foo'", this script is more
convenient. In addition, a shell and an editor window can be started
in parallel by "idles -e foo.py".
Tim Peters [Mon, 16 Jul 2001 02:29:45 +0000 (02:29 +0000)]
Part way to allowing "from __future__ import generators" to communicate
that info to code dynamically compiled *by* code compiled with generators
enabled. Doesn't yet work because there's still no way to tell the parser
that "yield" is OK (unlike nested_scopes, the parser has its fingers in
this too).
Replaced PyEval_GetNestedScopes by a more-general
PyEval_MergeCompilerFlags. Perhaps I should not have? I doubted it was
*intended* to be part of the public API, so just did.
Preliminary support for "from __future__ import generators" to enable
the yield statement. I figure we have to have this in before I can
release 2.2a1 on Wednesday.
Note: test_generators is currently broken, I'm counting on Tim to fix
this.
[Bug #438050]
Include sys/poll.h if it was found by the configure script. The OpenGroup
spec says poll.h is the correct header file to use, so that file is
preferred.
Fix bug #417212: "curses.newwin can return pads" by changing the Python
newwin() wrapper to always return a window, and never a pad. This makes
the code match the documentation.
Jack Jansen [Sat, 14 Jul 2001 14:02:21 +0000 (14:02 +0000)]
Minimal text editor using MLTE (code based on wed.py, the waste demo).
It's sort-of starting to work, but there's still problems with redraws and
with resizing the window.
Tim Peters [Sat, 14 Jul 2001 12:23:19 +0000 (12:23 +0000)]
divrem1 & long_format: found a clean way to factor divrem1 so that
long_format can reuse a scratch area for its repeated divisions (instead
of malloc/free for every digit produced); speeds str(long)/repr(long).
Fred Drake [Sat, 14 Jul 2001 05:50:33 +0000 (05:50 +0000)]
Be more permissive in what is accepted as an attribute name; this makes
this module slightly more resiliant in the face of XHTML input, or just
colons in attribute names.
Kurt B. Kaiser [Sat, 14 Jul 2001 05:21:37 +0000 (05:21 +0000)]
py-cvs-2001_07_13 (Rev 1.4) merge
"Move the action of loading the configuration to the IdleConf module
rather than the idle.py script. This has advantages and
disadvantages; the biggest advantage being that we can more easily
have an alternative main program." --GvR
Kurt B. Kaiser [Sat, 14 Jul 2001 05:10:34 +0000 (05:10 +0000)]
py-cvs-2001_07_13 (Rev 1.34) merge
"Amazing. A very subtle change in policy in descr-branch actually
found a bug here. Here's the deal: Class PyShell derives from class
OutputWindow. Method PyShell.close()
wants to invoke its parent method, but because PyShell long ago was
inherited from class PyShellEditorWindow, it invokes
PyShelEditorWindow.close(self). Now, class PyShellEditorWindow itself
derives from class OutputWindow, and inherits the close() method from
there without overriding it. Under the old rules,
PyShellEditorWindow.close would return an unbound method restricted to
the class that defined the implementation of close(), which was
OutputWindow.close. Under the new rules, the unbound method is
restricted to the class whose method was requested, that is
PyShellEditorWindow, and this was correctly trapped as an error." --GvR
Kurt B. Kaiser [Sat, 14 Jul 2001 04:59:24 +0000 (04:59 +0000)]
py-cvs-2001_07_13 (Rel 1.9) merge
"Taught IDLE's autoident parser that "yield" is a keyword that begins a
stmt. Along w/ the preceding change to keyword.py, making all this
work w/ a future-stmt just looks harder and harder." --tim_one
(From Rel 1.8: "Hack to make this still work with Python 1.5.2. ;-( "
--fdrake)
Kurt B. Kaiser [Sat, 14 Jul 2001 04:51:06 +0000 (04:51 +0000)]
py-cvs-2001_07_13 (Rel 1.7) merge
"Move the action of loading the configuration to the IdleConf module
rather than the idle.py script. This has advantages and
disadvantages; the biggest advantage being that we can more easily
have an alternative main program." --GvR