Standards
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
Go Back   Web Development Archives Mailing Lists Standards

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Web Development Archives Sponsor:
  #1  
Old July 3rd, 2008, 05:10 PM
Olivier Thereaux via cvs-syncmail
Guest
Dev Archives Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
perl/modules/W3C/LinkChecker/bin checklink,4.111,4.112

Update of /
In directory hutz:/tmp/cvs-serv5349

Modified Files:
checklink
Log Message:
muting some output in quiet mode. some reorg of output code - Patch courtesy of Michael Ernst

Index: checklink

RCS file: /,v
retrieving revision 4.111
retrieving revision 4.112
diff -u -d -r4.111 -r4.112
checklink 3 Jul 2008 19:48:04 -0000 4.111
checklink 3 Jul 2008 19:50:24 -0000 4.112
@@ -366,6 +366,8 @@

# Time stamp
my $timestamp = &get_timestamp();
+# Per-document header; undefined if already printed. See print_doc_header().
+my $doc_header;

&parse_arguments() if ${Command_Line};

@@ -803,18 +805,42 @@
# Before fetching the document, we don't know if we'll be within the
# recursion scope or not (think redirects).
if (!&in_recursion_scope($response->{absolute_uri})) {
+ hprintf("Not in recursion scope: %s\n")
+ if (${Verbose});
$response->content("");
return;
}
+ }

- print ${HTML} ? '<hr />' : '-' x 40, "\n";
+ # Define the document header, and perhaps print it.
+ # (It might still be defined if the previous document had no errors;
+ # just redefine it in that case.)
+
+ if ($check_num != 1) {
+ if (${HTML}) {
+ $doc_header = "\n<hr>\n";
+ } else {
+ $doc_header = "\n" . ('-' x 40) . "\n";
+ }
+ }
+
+ my $absolute_uri = $response->{absolute_uri}->as_string();
+
+ if (${HTML}) {
+ $doc_header .= ("<h2>\nProcessing\t"
+ . &show_url($absolute_uri)
+ . "\n</h2>\n\n");
+ } else {
+ $doc_header .= "\nProcessing\t$absolute_uri\n\n";
+ }
+
+ if (! ${Quiet}) {
+ print_doc_header();
}

# We are checking a new document
$doc_count++;

- my $absolute_uri = $response->{absolute_uri}->as_string();
-
my $result_anchor = 'results'.$doc_count;

if ($check_num == 1 && !${HTML} && !${S}) {
@@ -921,6 +947,7 @@

if (${Masquerade}) {
if ($abs_link_uri =~ m|^\Q${Masquerade_From}\E|) {
+ print_doc_header();
printf("processing %s in base %s\n",
$abs_link_uri, ${Masquerade_To});
my $nlink = $abs_link_uri;
@@ -1032,7 +1059,7 @@
next if &already_processed($u, $uri);

# Do the job
- print "\n";
+ print "\n" unless ${Quiet};
if (${HTML}) {
if (!${Command_Line}) {
if ($doc_count == ${Max_Documents}) {
@@ -1842,9 +1869,8 @@
} else {
print("Anchors\n\n");
}
- &hprintf("Found %d anchor%s.", $n, ($n == 1) ? '' : 's');
- print('</p>') if ${HTML};
- print("\n");
+ &hprintf("Found %d anchor%s.\n", $n, ($n == 1) ? '' : 's');
+ print('</p>\n') if ${HTML};
}
# List of the duplicates, if any.
my @errors = keys %{$errors};
@@ -1854,6 +1880,7 @@
}
undef $n;

+ print_doc_header();
print('<p>') if ${HTML};
print('List of duplicate and empty anchors');
print <<EF if ${HTML};
@@ -1894,7 +1921,7 @@
my ($links, $results, $broken, $redirects, $urls, $codes, $todo) = @_;

print("\n<dl class=\"report\">") if ${HTML};
- print("\n");
+ print("\n") if (! ${Quiet});

# Process each URL
my ($c, $previous_c);
@@ -2142,14 +2169,15 @@
# Broken links and redirects
if ($#urls < 0) {
if (! ${Quiet}) {
+ print_doc_header();
if (${HTML}) {
- print "<h3>Links</h3>\n<p>Valid links!</p>";
+ print "<h3>Links</h3>\n<p>Valid links!</p>\n";
} else {
- print "\nValid links.";
+ print "\nValid links.\n";
}
- print "\n";
}
} else {
+ print_doc_header();
print('<h3>') if ${HTML};
print("\nList of broken links");
#print(' and redirects') if ${Redirects};
@@ -2213,6 +2241,7 @@

# Show directory redirects
if (${Dir_Redirects} && ($#dir_redirect_urls -1)) {
+ print_doc_header();
print('<h3>') if ${HTML};
print("\nList of redirects");
print("</h3>\n<p>The links below are not broken, but the document does not use the exact URL, and the links were redirected. It may be a good idea to link to the final location, for the sake of speed.</p>") if ${HTML};
@@ -2498,6 +2527,7 @@

sub hprintf (@)
{
+ print_doc_header();
if (! ${HTML}) {
printf(@_);
} else {
@@ -2506,6 +2536,19 @@
return;
}

+# Print the document header, if it hasn't been printed already.
+# This is invoked before most other output operations, in order
+# to enable quiet processing that doesn't clutter the output with
+# "Processing" messages when nothing else will be reported.
+sub print_doc_header ()
+{
+ if (defined($doc_header)) {
+ print $doc_header;
+ undef($doc_header);
+ }
+}
+
+
# Local Variables:
# mode: perl
# indent-tabs-mode: nil

Reply With Quote
Reply

Viewing: Web Development Archives Mailing Lists Standards > perl/modules/W3C/LinkChecker/bin checklink,4.111,4.112


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway