From: Fred Drake Date: Fri, 22 Jun 2001 15:51:28 +0000 (+0000) Subject: Add support for the classdesc* environment and the \releaseinfo and X-Git-Tag: v2.1.1c1~69 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5107a51a6584204a8c7fdbae40caf010cfb33dee;p=thirdparty%2FPython%2Fcpython.git Add support for the classdesc* environment and the \releaseinfo and \setreleaseinfo macros added to the CVS head. --- diff --git a/Doc/perl/l2hinit.perl b/Doc/perl/l2hinit.perl index d3720d999747..7ef9ad63d9dd 100644 --- a/Doc/perl/l2hinit.perl +++ b/Doc/perl/l2hinit.perl @@ -181,12 +181,12 @@ sub make_nav_panel { sub get_version_text { if ($PACKAGE_VERSION ne '' && $t_date) { return ("" - . "Release $PACKAGE_VERSION," + . "Release $PACKAGE_VERSION$RELEASE_INFO," . " documentation updated on $t_date."); } if ($PACKAGE_VERSION ne '') { return ("" - . "Release $PACKAGE_VERSION."); + . "Release $PACKAGE_VERSION$RELEASE_INFO."); } if ($t_date) { return ("Documentation released on " @@ -415,7 +415,7 @@ sub do_cmd_textohtmlinfopage { if ($t_date) { # mostly ours $the_version = ",\n$t_date"; if ($PACKAGE_VERSION) { - $the_version .= ", Release $PACKAGE_VERSION"; + $the_version .= ", Release $PACKAGE_VERSION$RELEASE_INFO"; } } $_ = (($INFO == 1) diff --git a/Doc/perl/python.perl b/Doc/perl/python.perl index 7b58d6a0de1f..1e54ae9f9d42 100644 --- a/Doc/perl/python.perl +++ b/Doc/perl/python.perl @@ -104,6 +104,7 @@ sub do_cmd_e{ '\' . @_[0]; } $DEVELOPER_ADDRESS = ''; $SHORT_VERSION = ''; +$RELEASE_INFO = ''; $PACKAGE_VERSION = ''; sub do_cmd_version{ $PACKAGE_VERSION . @_[0]; } @@ -114,6 +115,12 @@ sub do_cmd_release{ return $_; } +sub do_cmd_setreleaseinfo{ + local($_) = @_; + $RELEASE_INFO = next_argument(); + return $_; +} + sub do_cmd_setshortversion{ local($_) = @_; $SHORT_VERSION = next_argument(); @@ -906,6 +913,17 @@ sub do_env_classdesc{ return handle_classlike_descriptor(@_[0], "class"); } +sub do_env_classdescstar{ + local($_) = @_; + $THIS_CLASS = next_argument(); + $idx = make_str_index_entry( + "$THIS_CLASS (class in $THIS_MODULE)"); + $idx =~ s/ \(.*\)//; + return ("
class $idx\n
" + . $_ + . '
'); +} + sub do_env_excclassdesc{ return handle_classlike_descriptor(@_[0], "exception"); } @@ -1296,7 +1314,8 @@ sub make_my_titlepage() { if ($t_date) { $the_title .= "\n

"; if ($PACKAGE_VERSION) { - $the_title .= "Release $PACKAGE_VERSION
\n"; + $the_title .= ('Release ' + . "$PACKAGE_VERSION$RELEASE_INFO
\n"); } $the_title .= "$t_date

" } diff --git a/Doc/texinputs/python.sty b/Doc/texinputs/python.sty index 795882d64da1..e4c60b834b14 100644 --- a/Doc/texinputs/python.sty +++ b/Doc/texinputs/python.sty @@ -623,6 +623,15 @@ \index{#1@{\py@idxcode{#1}} (class in \py@thismodule)}] }{\end{fulllineitems}} +% \begin{classdesc*}{name} +\newenvironment{classdesc*}[1]{ + % Using \renewcommand doesn't work for this, for unknown reasons: + \global\def\py@thisclass{#1} + \begin{fulllineitems} + \item[\strong{class }\code{\bfcode{#1}}% + \index{#1@{\py@idxcode{#1}} (class in \py@thismodule)}] +}{\end{fulllineitems}} + % \begin{excclassdesc}{name}{constructor args} % but indexes as an exception \newenvironment{excclassdesc}[2]{ @@ -633,6 +642,9 @@ \index{#1@{\py@idxcode{#1}} (exception in \py@thismodule)}] }{\end{fulllineitems}} +% There is no corresponding {excclassdesc*} environment. To describe +% a class exception without parameters, use the {excdesc} environment. + \let\py@classbadkey=\@undefined @@ -1036,12 +1048,15 @@ \newcommand{\py@release}{} \newcommand{\version}{} \newcommand{\shortversion}{} +\newcommand{\releaseinfo}{} \newcommand{\releasename}{Release} \newcommand{\release}[1]{% \renewcommand{\py@release}{\releasename\space\version}% \renewcommand{\version}{#1}} \newcommand{\setshortversion}[1]{% \renewcommand{\shortversion}{#1}} +\newcommand{\setreleaseinfo}[1]{% + \renewcommand{\releaseinfo}{#1}} % Allow specification of the author's address separately from the % author's name. This can be used to format them differently, which