Fred Drake [Tue, 14 Sep 1999 18:00:49 +0000 (18:00 +0000)]
Added "import string" to a couple of examples that describe string
module functions, to clarify that the import is not automatic.
Suggested by Koray Oner <Koray.Oner@Eng.Sun.COM>.
Changed selection of installation directories (in 'set_final_options()')
so that pure Python modules are installed to the platform-specific
directory if there are any extension modules in this distribution.
Straightened up the selection of installation directories for platform-
specific files; it was somewhat broken, and the comments were dead
wrong.
Now runs 'install_ext' command after 'install_py'.
Added 'output_dir' parameter to 'compile()' and 'link_shared_object().
Changed those two methods to only compile/link if necessary (according
to simplistic timestamp checks).
Added 'output_dir' to 'object_filenames()' and 'shared_object_filename()'.
Added 'newer_pairwise()' and 'newer_group()'.
Terminology change in 'newer()'.
Made 'copy_tree' respect dry_run flag a little better.
Added 'move_file()'.
Added 'output_dir' attribute, and 'output_dir' parameter to several method
signatures, and updated some docstrings to reflect it.
Some comments added.
Added 'announce()' and 'move_file()' methods.
Barry Warsaw [Thu, 9 Sep 1999 23:24:33 +0000 (23:24 +0000)]
canonic(): This used to be equivalent to str() but that caused too
much breakage (esp. in JPython which holds absolute path names in
co_filename already). This implementation uses os.path.abspath() as a
slightly better way to canonicalize path names. It implements a
cache.
Barry Warsaw [Thu, 9 Sep 1999 16:32:41 +0000 (16:32 +0000)]
Pdb.lineinfo(): Don't use os.popen('egrep ...') to find the line in
the file that a function is defined on. Non-portable to Windows and
JPython. Instead, new find_function() uses re module on a similar
(simple-minded) pattern.
It appears that inet_aton() doesn't really exist except in libresolv;
the proper function to call is inet_addr(). Since we already had code
to do that (for MS-Windows), this simplifies things a lot!
Fred Drake [Thu, 9 Sep 1999 14:21:52 +0000 (14:21 +0000)]
Added keyword parameter support to all public interfaces; keyword
names match the documentation.
Removed broken code that supports the __methods__ attribute on ast
objects; the right magic was added to Py_FindMethod() since this was
originally written. <ast-object>.__methods__ now works, so dir() and
rlcompleter are happy.
Barry Warsaw [Wed, 8 Sep 1999 16:26:33 +0000 (16:26 +0000)]
call_trace(): A fix for PR#73, if an exception occurred in the
tracefunc (or profilefunc -- we're not sure which), zap the global
trace and profile funcs so that we can't get into recursive loop when
instantiating the resulting class based exception.
Changed to reflect the new "command options" regime -- in particular,
we no longer explicitly pull distribution options out of our Distribution
object, but rather let the Distribution put them into the command object.
Careful rethink of command options, distribution options, distribution
attributes, etc. Biggest change was to the Distribution constructor
-- it now looks for an 'options' attribute, which contains values
(options) that are explicitly farmed out to the commands. Also,
certain options supplied to Distribution (ie. in the 'setup()' call in
setup.py) are now "command option aliases", meaning they are dropped
right into a certain command rather than being distribution options.
This is handled by a new Distribution class attribute,
'alias_options'.
Various comment changes to reflect the new way-of-thinking.
Added 'get_command_name()' method to Command -- was assuming its
existence all along as 'command_name()', so changed the code that
needs it to call 'get_command_name()'.
Ditched redundant docstrings and comments (overlap with ccompiler.py).
Ditched redundant '_gen_preprocess_options()' and '_gen_lib_options()'
-- now provided by ccompiler.py.
Fixed some filename extension variables -- added missing period.
Cosmetic tweaks.
Ditched '_gen_preprocess_options()' and '_gen_lib_options()' -- they're
now provided (minus the leading underscore) by the ccompiler module.
Fix 'compile()' to return the list of object files generated.
Cosmetic tweaks/delete cruft.
os.name is "posix" or "nt" or we don't care.
Added big comment about the kludginess of passing 'build_options'
to the link methods and how to fix it.
Added 'gen_preprocess_options()' and 'gen_lib_options()' convenience
functions -- the two cases are very similar for Unix C Compilers and
VC++, so I figured I might as well unify the implementations.
Fix indent error in __format(): del context[objid] at the end should
be executed in all cases, not just when it's not a list, tuple or
dict. Discovered by Christian Tismer.
Greg Ward [Sun, 29 Aug 1999 18:17:36 +0000 (18:17 +0000)]
Patch from Perry Stoll:
- fix some broken abstract methods
- kludge: add 'build_info' parameter to link methods
- add 'object_name()' and 'shared_library_name()'
- support for MSVCCompiler class on NT/Win95
Guido van Rossum [Thu, 26 Aug 1999 23:06:05 +0000 (23:06 +0000)]
Find the help.txt file relative to __file__ or ".", not in sys.path.
(Suggested by Moshe Zadka, but implemented differently.)
Add <<python-docs>> event which, on Unix, brings up Netscape pointing
to http://www.python.doc/current/ (a local copy would be nice but its
location can't be predicted). Windows solution TBD.
Fred Drake [Thu, 26 Aug 1999 17:23:54 +0000 (17:23 +0000)]
posix_putenv(): Constrain memory leakage when setting the same
environment variable repeatedly. I posted this to the list
some time ago, but only now got around to asking g--d- what he
thought about it.
Guido van Rossum [Thu, 26 Aug 1999 15:52:33 +0000 (15:52 +0000)]
Sjoerd Mullender writes:
"""
Added some optional arguments to the XMLParser __init__ method to
specify that selected non-standard constructs are to be accepted.
Also removed the documentation for handle_entityrefs since it isn't
used.
"""
Guido van Rossum [Thu, 26 Aug 1999 15:50:43 +0000 (15:50 +0000)]
Sjoerd Mullender writes:
"""
Extended chunk so that it can also handle formats that are almost
according to EA IFF 85. In particular, added options to handle
little-endian and to handle formats that include the header size in
the chunk size value.
Fixed a bug where the header size was included in the chunk size, which
it isn't according to EA IFF 85.
Added a new method getsize() to get the size of the chunk (excluding
header).
Fixed chunk documentation (TIFF doesn't look like it uses chunks).
Converted wave to use chunk. Wave uses EA IFF 85 chunks except that
it uses little-endian encoding of integer data.
Removed __del__ methods from aifc and wave since I got an
AttributeError there upon exit.
"""
Guido van Rossum [Fri, 20 Aug 1999 18:26:06 +0000 (18:26 +0000)]
Add calls to self.protocol("WM_DELETE_WINDOW", self.destroy) to the Tk
and Toplevel class constructors. This means that if the window
manager closes the window, the Python-side Tkinter data structures
will be destroyed correctly. (Most apps do this anyway, and it's
recommended practice; I see no reason why making it the default
behavior could be bad.)
Fred Drake [Fri, 20 Aug 1999 14:28:29 +0000 (14:28 +0000)]
rewrite_descriptor(): Fix bug that dropped the first TEXT node from
<description> elements. Add another sanity
check to make sure a special case only becomes
involved for <opcodedesc> and <opcodedescni>
elements.
fixup_paras_helper(): Clean up control flow.
Everywhere that checks node.nodeType==ELEMENT and node.tagName now
just check node.nodeName (nodeName is guaranteed for all node types
and will be special values that don't conflict with GIs for
non-ELEMENT nodes). Simplifies a number of tests and improves
readability in a lot of places.
Guido van Rossum [Wed, 18 Aug 1999 21:51:10 +0000 (21:51 +0000)]
Patches by Michael Reilly to correctly deal with ftp URLs of the form
ftp://user@host//root/path: the double slash in the pathname means to
go to the root directory even if the initial directory isn't the root.
Barry Warsaw [Wed, 18 Aug 1999 20:17:42 +0000 (20:17 +0000)]
__update(): Jeremy Hylton reports occurances of sunaudiodev.error
(interrupted system call) when getting the device information. I've
never seen it, but this patch should take care of the problem.
If we get that exception and we're polling, just return since we'll
wake up again soon and get the right information. If we're not
polling, try 4 times and then give up.
Guido van Rossum [Wed, 18 Aug 1999 17:40:33 +0000 (17:40 +0000)]
Patches by Michael Reilly to correctly deal with ftp URLs of the form
ftp://user@host//root/path: the double slash in the pathname means to
go to the root directory even if the initial directory isn't the root.
Greg Ward [Sat, 14 Aug 1999 23:53:53 +0000 (23:53 +0000)]
Changed to use 'spawn()', now that it exists.
Added 'verbose' and 'dry_run' parameters to constructor.
Changed 'compile()', 'link_*()' to default lists arguments to None
rather than empty list.
Added implementations of the filename-mangling methods mandated by
the CCompiler interface.
Greg Ward [Sat, 14 Aug 1999 23:50:50 +0000 (23:50 +0000)]
Added 'verbose' and 'dry_run' flags to CCompiler constructor and
'new_compiler()' factory function.
Added 'runtime_library_dirs' list (for -R linker option) and methods
to manipulate it.
Deleted some obsolete comments.
Added all the filename manglign methods: 'object_filenames()',
'shared_object_filename()', 'library_filename()',
'shared_library_filename()'.
Added 'spawn()' method (front end to the "real" spawn).
Guido van Rossum [Wed, 11 Aug 1999 02:01:00 +0000 (02:01 +0000)]
Patch inspired by Moshe Zadka to search for the Icons directory in the
same directory as __file__, rather than searching for it along sys.path.
This works better when idle is a package.
Greg Ward [Tue, 10 Aug 1999 20:09:38 +0000 (20:09 +0000)]
Allow comment characters (#) to be escaped:
- did away with 'comment_re' option -- it's just not that simple anymore
- heavily revised the main logic in 'readline()' to accomodate this
Beefed up 'warn()': 'line' can be list or tuple, and 'msg' is
automatically converted to a string.