[Python-checkins] python/dist/src/Doc/dist dist.tex,1.67,1.68

fdrake at users.sourceforge.net fdrake at users.sourceforge.net
Tue Mar 23 13:43:06 EST 2004


Update of /cvsroot/python/python/dist/src/Doc/dist
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31820

Modified Files:
	dist.tex 
Log Message:
merge Anthony Baxter's distutils API reference into the package
author's documentation


Index: dist.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/dist/dist.tex,v
retrieving revision 1.67
retrieving revision 1.68
diff -C2 -d -r1.67 -r1.68
*** dist.tex	22 Mar 2004 21:44:43 -0000	1.67
--- dist.tex	23 Mar 2004 18:43:03 -0000	1.68
***************
*** 13,17 ****
  \input{boilerplate}
  
! \author{Greg Ward}
  \authoraddress{
  	\strong{Python Software Foundation}\\
--- 13,18 ----
  \input{boilerplate}
  
! \author{Greg Ward\\
!         Anthony Baxter}
[...1530 lines suppressed...]
+ \end{methoddesc}
+ 
+ \var{sub_commands} formalizes the notion of a ``family'' of commands,
+ eg. \code{install} as the parent with sub-commands \code{install_lib},
+ \code{install_headers}, etc.  The parent of a family of commands
+ defines \var{sub_commands} as a class attribute; it's a list of
+ 2-tuples \samp{(command_name, predicate)}, with \var{command_name} a string
+ and \var{predicate} an unbound method, a string or None.
+ \var{predicate} is a method of the parent command that
+ determines whether the corresponding command is applicable in the
+ current situation.  (Eg. we \code{install_headers} is only applicable if
+ we have any C header files to install.)  If \var{predicate} is None,
+ that command is always applicable.
+ 
+ \var{sub_commands} is usually defined at the *end* of a class, because
+ predicates can be unbound methods, so they must already have been
+ defined.  The canonical example is the \command{install} command.
+ 
+ 
  \end{document}




More information about the Python-checkins mailing list