Commit Graph

3458 Commits

Author SHA1 Message Date
Fred Drake d254c0095c Remove redundent information from a docstring. 2000-10-02 22:11:47 +00:00
Fred Drake 484d735f1e Delay import of py_compile until needed, since is is only used by the
PyZipFile class.

End sentences in docstrings with periods.

Reformat docstrings to be more similar to those of other modules.
2000-10-02 21:14:52 +00:00
Fred Drake 3944a01713 Do not set Konquerer to be the default browser if $KDEDIR is set -- some
Linux distributions which provide both KDE and Gnome set this environment
variable even if the user is not using KDE.  We do *not* want to start
Konquerer if KDE is not running unless the user actually tells us to!
2000-10-02 03:40:51 +00:00
Greg Ward 0295181fa6 Typo fix. 2000-10-02 02:25:51 +00:00
Greg Ward 73a6c942cd Added the ability to do byte-compilation at build time, currently off
by default (since compiling at install time works just fine).  Details:
  - added 'compile' and 'optimize' options
  - added 'byte_compile()' method
  - changed 'get_outputs()' so it includes bytecode files
A lot of the code added is very similar to code in install_lib.py;
would be nice to factor it out further.
2000-10-02 02:19:04 +00:00
Greg Ward 8161022d4d Added --compile, --optimize options so users have an easy way to
instruct the "install_lib" command from the command-line.
2000-10-02 02:16:04 +00:00
Greg Ward cb9c9aed01 Finished the overhaul of byte-compilation options: there's now a 6-way
choice between (compile, no-compile) * (optimize=0, optimize=1,
optimize=2).  Details:
  - added --no-compile option to complement --compile, which has
    been there for ages
  - changed --optimize (which never worked) to a value option, which
    expects 0, 1, or 2
  - renamed 'bytecompile()' method to 'byte_compile()', and beefed
    it up to handle both 'compile' and 'optimize' options
  - fix '_bytecode_filenames()' to respect the new options
2000-10-02 02:15:08 +00:00
Greg Ward 04cc88df05 Remove the temporary byte-compilation script when we're done with it. 2000-10-02 02:09:55 +00:00
Greg Ward c1acc69018 From 'run()', only call 'bytecompile()' if we actually have
pure Python modules to compile.
2000-10-01 23:50:13 +00:00
Greg Ward f217e2124a Tweaked 'byte_compile()' so it silently skips non-Python files, rather than
blowing up.
2000-10-01 23:49:30 +00:00
Martin v. Löwis 4b6ea798cb Don't rename Tkinter to Tk; closes bug 115714
Subclass Error from Exception.
2000-10-01 17:52:01 +00:00
Barry Warsaw 370a29fe42 Added a zip() test where one of the arguments is an instance whose
class has no __getitem__().  This raises an AttributeError.
2000-10-01 04:28:43 +00:00
Fred Drake cc4adf27f4 Add missing "s" from format string.
This closes SourceForge patch #101714.
2000-09-30 23:59:04 +00:00
Greg Ward 1df6e7b1fc Reduced the 'bytecompile()' method to a one-line wrapper around
'util.byte_compile()'.  Currently just reproduces the existing functionality
-- doesn't use any of the fancy features in the new 'byte_compile()'.
2000-09-30 20:39:09 +00:00
Greg Ward 1297b5ce67 Added 'byte_compile(): an all-singing, all-dancing wrapper around the
standard 'py_compile.compile()' function.  Laundry list of features:
  - handles standard Distutils 'force', 'verbose', 'dry_run' flags
  - handles various levels of optimization: can compile directly in
    this interpreter process, or write a temporary script that is
    then executed by a new interpreter with the appropriate flags
  - can rewrite the source filename by stripping an optional prefix
    and preprending an optional base dir.
2000-09-30 20:37:56 +00:00
Greg Ward 4752769d08 Various docstring tweaks.
Fixed 'subst_vars()' so it actually blows up like the docstring claims
  (and fixed the docstring not to claim it handles ${var}, which it
  doesn't).
2000-09-30 18:49:14 +00:00
Greg Ward b8b263b92f Reformat docstrings. 2000-09-30 18:40:42 +00:00
Greg Ward cb1f4c4d33 Standardized whitespace around function calls. 2000-09-30 18:27:54 +00:00
Greg Ward 963cd2d85d Andrew Kuchling: changed so the '_path_created' dictionary is keyed on
absolute pathnames; this lets it keep working in the face of chdir'ing
around.
2000-09-30 17:47:17 +00:00
Greg Ward 3e6d43801b Fixed 'run()' so it doesn't call 'bytecompile()' if 'install()' returned None. 2000-09-30 17:35:26 +00:00
Greg Ward e564278bfd Expect a tuple (dest_name, copied) from 'copy_file()'. 2000-09-30 17:34:50 +00:00
Greg Ward 3a5a2bd486 Changed 'build_module()' so it returns the result of 'copy_file()'
on the module file -- could be useful for subclasses overriding it.
2000-09-30 17:33:05 +00:00
Greg Ward 0d4a853109 Changed 'copy_file()' so it returns a tuple (dest_name, copied) -- hopefully,
this will please everyone (as if that's possible).
2000-09-30 17:29:35 +00:00
Greg Ward ec84c21ce2 In 'get_platform()', handle so-called POSIX systems that don't have
'uname()' -- specifically NeXTSTEP.
2000-09-30 17:09:39 +00:00
Greg Ward 64d855adca Changed to use the 'sub-commands' machinery:
- added 'sub_commands' class attr
  - added 'has_*()' predicates referenced by the sub-command list
  - rewrote 'run()' so it's a trivial loop over relevant sub-commands
2000-09-30 17:08:12 +00:00
Greg Ward 70b1fd1a99 Moved some things around for better organization. 2000-09-30 17:05:37 +00:00
Martin v. Löwis efffd28c2c Add mimetools testcase. 2000-09-30 17:03:19 +00:00
Martin v. Löwis 25d1692434 Return after writing 7bit or 8bit encodings. Closes bug 115712 2000-09-30 16:52:45 +00:00
Martin v. Löwis af484d5a0c Mention in the module's doc string that other functions of the socket API
appear as methods on socket objects.
2000-09-30 11:34:30 +00:00
Fred Drake 5db246d1fa Always use the same name for the exception defined in this module!
Error reported via email by Pete Shinners <pete@visionart.com>.

Fixed some indentation inconsistencies.
2000-09-29 20:44:48 +00:00
Martin v. Löwis 3f0969f100 Use string functions instead of methods to allow sharing this module with PyXML 2000-09-29 19:00:40 +00:00
Martin v. Löwis 491ded78cc Remove dependency from saxutils when loading xmlreader 2000-09-29 18:59:50 +00:00
Thomas Heller 1dbe9d5247 Removed the extra_dirs and path_file metadata options.
They are unneeded: All this stuff is already done by the
install command which is run by bdist_wininst.

One bug has been fixed:
The root of the fake install tree is install.install_purelib,
not install.install_lib!
They are different if the extra_path option is used in
the setup function.

Rebuild after the changes to wininst.exe.
2000-09-29 11:36:55 +00:00
Thomas Heller 18b9b93df3 Removed the implib_dir instance variable because it is unused.
Removed get_ext_libname() because it is unused.

Fixed get_libraries() to append an '_d' to the python debug
import library. If MSVC is used, do not add 'pythonxx.lib' to
the list of libraries, because this is handled better
by a pragma in config.h.

This should fix bug #115595, but it needs some more testing.
2000-09-28 19:28:35 +00:00
Fred Drake 20af3172ce popen4(): Added for Unix.
Fixed a typo in a docstring.
2000-09-28 19:10:56 +00:00
Fred Drake d75e63a865 popen4(), class Popen4: popen4() support for Unix.
popen2(), popen3():  Reversed order of bufsize and mode parameters to
                     comply with what was here before (Python 1.5.2).

class Popen3:  Factored the __init__() into a more basic initializer and
               a helper method, to allow some re-use by the Popen4 class.
               Use os.dup2() instead of os.dup() to create the proper
               file descriptors in the child process.

This closes SourceForge bug #115330 and partially closes #115353.
2000-09-28 19:07:53 +00:00
Fred Drake 38cb9f1f17 Convert all entries on sys.path to absolute paths, and also update the
__file__ attributes of already-imported modules to be absolute.  This helps
robustify the interpreter against os.chdir() calls from the application.

Only remove setdefaultencoding() from sys if it exists; if this module is
run as a script (since there is a _test() function that gets run), it broke
because the script attempts to remove it again after the import of site
has already done so.  This allows the module to be run as a script again.

makepath():  New function, standardizes all pathname normalization in one
             place.
2000-09-28 16:52:36 +00:00
Fred Drake b4e460ac4b Avoid import of string module; it is only needed for expandvars().
Never assume that os.sep is for the module-specific platform; use the
right separator character directly.
Fix some minor style consistency nits.
2000-09-28 16:25:20 +00:00
Fred Drake c0ab93ef6f Minor style nits. 2000-09-28 16:22:52 +00:00
Fred Drake 22fb839f0c Remove imports of string when string methods will do. 2000-09-28 15:04:39 +00:00
Fred Drake 954383356f Added some tests for the truncate() method; one is commented out because
cStringIO does not get it right (reported as SF bug #115531).

Added test for ValueError when write() is called on a closed StringIO
object.  Commented out because cStringIO does not get it right
(reported as SF bug #115530).
2000-09-28 04:25:33 +00:00
Fred Drake e0a7f4f9d5 Add truncate() method to StringIO objects.
This closes SourceForge bug #115527.
2000-09-28 04:21:06 +00:00
Fred Drake d391a34926 Remove change that had not been saved when the output was generated;
not terribly useful.
Reported by Mark Favas <Mark.Favas@per.dem.csiro.au>.
2000-09-28 04:13:15 +00:00
Fred Drake 8ef6767e00 Regression test for ConfigParser module. 2000-09-27 22:45:25 +00:00
Fred Drake 2a37f9f862 Allow spaces in section names.
Do not expose the __name__ when reporting the list of options available
for a section since that is for internal use.

This closes SourceForge bug #115357.

Additionally, define InterpolationDepthError and MAX_INTERPOLATION_DEPTH.
The exception is raised by get*() when value interpolation cannot be
completed within the defined recursion limit.  The constant is only
informative; changing it will not affect the allowed depth.

Fix the exit from get() so that None is not returned if the depth is met
or exceeded; either return the value of raise InterpolationDepthError.
2000-09-27 22:43:54 +00:00
Marc-André Lemburg 23542dc6eb Updated hash values to match the new encoding (UTF-8) used in the test. 2000-09-27 12:25:14 +00:00
Marc-André Lemburg 67ceca7add Fixed encoding to use an endianness independent format. 2000-09-27 12:24:34 +00:00
Lars Gustäbel 6a7768ae4f Fixed misleading qname in test_xmlgen_ns (reported by loewis). 2000-09-27 08:12:17 +00:00
Greg Ward ef850def44 Bump version to 1.0pre. 2000-09-27 02:26:57 +00:00
Greg Ward 264cf74e1a Remove deprecation warnings on old 'link_*()' methods, ie. they're not
deprecated after all.  But now they're only implemented once, instead
of N times.
2000-09-27 02:24:21 +00:00