mirror of
https://github.com/python/cpython.git
synced 2025-10-30 05:01:30 +00:00
do_env_cfuncdesc(): Push as much of the generated HTML into one place
as possible for better readability. Revise a comment.
This commit is contained in:
parent
a8e484c8f5
commit
241551c16c
1 changed files with 8 additions and 8 deletions
|
|
@ -644,23 +644,23 @@ sub do_env_cfuncdesc{
|
||||||
my $idx = make_str_index_entry(
|
my $idx = make_str_index_entry(
|
||||||
"<tt class='cfunction'>$function_name()</tt>" . get_indexsubitem());
|
"<tt class='cfunction'>$function_name()</tt>" . get_indexsubitem());
|
||||||
$idx =~ s/ \(.*\)//;
|
$idx =~ s/ \(.*\)//;
|
||||||
$idx =~ s/\(\)//; # ????
|
$idx =~ s/\(\)//; # ???? - why both of these?
|
||||||
my $result_rc = get_refcount($function_name, '');
|
my $result_rc = get_refcount($function_name, '');
|
||||||
my $rcinfo = '';
|
my $rcinfo = '';
|
||||||
if ($result_rc eq '+1') {
|
if ($result_rc eq '+1') {
|
||||||
$rcinfo = '<span class="label">Return value:</span>'
|
$rcinfo = 'New reference';
|
||||||
. "\n <span class=\"value\">New reference.</span>";
|
|
||||||
}
|
}
|
||||||
elsif ($result_rc eq '0') {
|
elsif ($result_rc eq '0') {
|
||||||
$rcinfo = '<span class="label">Return value:</span>'
|
$rcinfo = 'Borrowed reference';
|
||||||
. "\n <span class=\"value\">Borrowed reference.</span>";
|
|
||||||
}
|
}
|
||||||
elsif ($result_rc eq 'null') {
|
elsif ($result_rc eq 'null') {
|
||||||
$rcinfo = '<span class="label">Return value:</span>'
|
$rcinfo = 'Always <tt class="constant">NULL</tt>';
|
||||||
. "\n <span class=\"value\">Always NULL.</span>";
|
|
||||||
}
|
}
|
||||||
if ($rcinfo ne '') {
|
if ($rcinfo ne '') {
|
||||||
$rcinfo = "\n<div class=\"refcount-info\">\n $rcinfo\n</div>";
|
$rcinfo = ( "\n<div class=\"refcount-info\">"
|
||||||
|
. "\n <span class=\"label\">Return value:</span>"
|
||||||
|
. "\n <span class=\"value\">$rcinfo.</span>"
|
||||||
|
. "\n</div>");
|
||||||
}
|
}
|
||||||
return "<dl><dt>$return_type <b>$idx</b> (<var>$arg_list</var>)\n<dd>"
|
return "<dl><dt>$return_type <b>$idx</b> (<var>$arg_list</var>)\n<dd>"
|
||||||
. $rcinfo
|
. $rcinfo
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue