Commit Graph

75 Commits

Author SHA1 Message Date
Greg Ward 1497b61cb0 Dropped the evil and misguided 'set_peer_option()' method -- it's no
longer needed, and can't possibly work anyways.
2000-03-22 00:31:37 +00:00
Greg Ward 7f6ef6ca26 Renamed 'install_path' to 'extra_path'.
Fix 'Command.set_undefined_option()' to call 'ensure_ready()' rather
  than 'finalize_options()' (which is only supposed to be called once,
  which is the whole point of 'ensure_ready()').
Added comment to 'set_peer_option()' to remind myself that this method
  cannot work and is fundamentally wrong-headed.
2000-03-22 00:20:46 +00:00
Greg Ward 89ccb984f0 Oops! Don't call 'ensure_ready()' in 'Distribution.find_command_obj()' --
that broke parsing command-line options.  Instead call it in
'Command.find_peer()', which is why I added it to 'find_command_obj()'
in the first place.
2000-03-18 17:35:12 +00:00
Greg Ward 3ce77fd05e Changed '__rcsid__' to '__revision__'. 2000-03-02 01:49:45 +00:00
Greg Ward 611850bbb3 Added call to 'ensure_ready()' on the command object in
'Distribution.find_command_obj()'.
2000-03-01 14:42:07 +00:00
Greg Ward 7a0620c3a5 Try to deal with pre-1.5.2 IOError exception objects. 2000-02-26 00:49:40 +00:00
Greg Ward 18c05f240e Changed all references to command methods 'set_default_options()' and
'set_final_options()' to 'initialize_options()' and 'finalize_options()'.
2000-02-18 00:36:20 +00:00
Greg Ward 4c96db1a65 Changed references to the command class 'options' attribute to 'user_options'.
Related docstring changes.
Unrelated comment changes.
2000-02-18 00:26:23 +00:00
Greg Ward 592f28272e Command classes are now named identically to their commands, so reflect this
in 'find_command_class()' method.
2000-02-18 00:14:21 +00:00
Greg Ward 1bea7ab7bd Added 'libraries' option for use by the 'build_lib' command.
Typo fix.
2000-02-05 02:24:52 +00:00
Greg Ward f0fd6175b3 Improvements to the help system:
* "--help" can now come either before or after particular commands
    to get help on and can give help on multiple commands, eg.
    "--help install dist" gives help on those two commands
  * added "--help-commands" option, implemented by the 'print_commands()'
    and 'print_command_list()' methods
2000-01-30 18:30:32 +00:00
Greg Ward 9d46b9ce97 When emitting a command-line error message, *say* it's an error. 1999-12-16 01:19:05 +00:00
Greg Ward c9c37b1c6e Made "verbose" mode the default; now you have to supply --quiet if you
want no output.  Still no option for a happy medium though.
Added "--help" global option.
Changed 'parse_command_line()' to recognize help options (both for the
  whole distribution and per-command), and to distinguish "regular run"
  and "user asked for help" by returning false in the latter case.
Also in 'parse_command_line()', detect invalid command name on command
  line by catching DistutilsModuleError.
  a 'negative_opt' class attribute right after 'global_options'; changed
  how we call 'fancy_getopt()' accordingly.
Initialize 'maintainer' and 'maintainer_email' attributes to Distribution
  to avoid AttributeError when 'author' and 'author_email' not defined.
Initialize 'help' attribute in Command constructor (to avoid
  AttributeError when user *doesn't* ask for help).
In 'setup()':
  * show usage message before dying when we catch DistutilsArgError
  * only run commands if 'parse_command_line()' returned true (that
    way, we exit immediately when a help option is found)
  * catch KeyboardInterrupt and IOError from running commands
Bulked up usage message to show --help options.
Comment, docstring, and error message tweaks.
1999-12-12 16:51:44 +00:00
Greg Ward 346e320c6e Qualified use of 'newer_group' function. 1999-10-23 19:06:56 +00:00
Greg Ward 0c35ac62d8 Added 'force' and 'quiet' (negative alias for 'verbose') to the
global options table.
Every Command instance now has its own copies of the global options,
  which automatically fallback to the Distribution instance.  Changes:
  - initialize them in constructor
  - added '__getattr__()' to handle the fallback logic
  - changed every 'self.distribution.{verbose,dry_run}' in Command to
    'self.{verbose,dry_run}'.
  - filesystem utility methods ('copy_file()' et al) don't take 'update'
    parameter anymore -- instead we pass 'not force' to the underlying
    function as 'update'
Changed parsing of command line so that global options apply to all
  commands as well -- that's how (eg.) Command.verbose will be initialized.
Simplified 'make_file()' to use 'newer_group()' (from util module).
Deleted some cruft.
Some docstring tweaks.
1999-10-03 21:02:48 +00:00
Greg Ward 3868eb97c8 Added 'ready' flag and 'ensure_ready()' method to Command: together
they make sure that 'set_final_options()' has been called, but isn't
  called redundantly.
Changed Distribution to call 'ensure_ready()' where it used to call
  'set_final_options()', and in a few extra places as well.
Lots of comment/docstring revisions and additions in both classes.
New one-liner utility methods in Command: 'find_peer()', 'spawn()'.
1999-09-29 12:12:19 +00:00
Greg Ward df0d33586d Ditched the whole notion of "alias options": this meant dropping the
'alias_options' table and getting rid of some hairy code in the
  Distribution constructor.
Resurrected the distribution options that describe the modules present
  in the module distribution ('py_modules', 'ext_modules'), and added
  a bunch more: 'packages', 'package_dir', 'ext_package', 'include_dirs',
  'install_path'.
Updated some comments.
Added 'warn()' method to Command.
'Command.get_command_name()' now stores generated command name in
  self.command_name.
1999-09-21 18:41:36 +00:00
Greg Ward 1ae3246679 Fixed some goofs in 'alias_options'.
Error message tweak in Command.set_option().
Added Command.get_peer_option().
Added Command.move_file() wrapper.
1999-09-13 03:03:01 +00:00
Greg Ward 42926ddc7e 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()'.
1999-09-08 02:41:09 +00:00
Greg Ward 1ea8af2fe0 Patch from Perry Stoll: import types module. 1999-08-29 18:20:32 +00:00
Greg Ward 7f65c65208 Comment tweak. 1999-08-14 23:47:21 +00:00
Greg Ward c997334977 Added the 'have_run' dictionary to Distribution, and changed
'run_command()' to refer to it before attempting to run a command --
  that way, command classes can freely invoke other commands without fear
  of duplicate execution.
Beefed up some comments and docstrings.
1999-06-08 02:02:00 +00:00
Greg Ward 884df454b2 The 'copy_file()' and 'copy_tree()' functions in util.py now have
meaningful return values: respectively, whether the copy was done, and
the list of files that were copied.  This meant some trivial changes in
core.py as well: the Command methods that mirror 'copy_file()' and
'copy_tree()' have to pass on their return values.
1999-05-02 21:42:05 +00:00
Greg Ward 06ca948029 Added all the "external action" methods (to make handling the verbose
and dry-run flags consistently painless): 'execute()', 'mkpath()',
'copy_file()', 'copy_tree()', 'make_file()', and stub for 'make_files()'
(not sure yet if it's useful).
1999-04-04 02:58:07 +00:00
Greg Ward 2689e3ddce First checkin of real Distutils code. 1999-03-22 14:52:19 +00:00