www-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

www/server/source/linc linc.py


From: Pavel Kharitonov
Subject: www/server/source/linc linc.py
Date: Sat, 22 Dec 2012 16:51:23 +0000

CVSROOT:        /web/www
Module name:    www
Changes by:     Pavel Kharitonov <ineiev>       12/12/22 16:51:23

Modified files:
        server/source/linc: linc.py 

Log message:
        Don't report against SSI directives.

CVSWeb URLs:
http://web.cvs.savannah.gnu.org/viewcvs/www/server/source/linc/linc.py?cvsroot=www&r1=1.5&r2=1.6

Patches:
Index: linc.py
===================================================================
RCS file: /web/www/www/server/source/linc/linc.py,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- linc.py     15 Dec 2012 06:38:25 -0000      1.5
+++ linc.py     22 Dec 2012 16:51:22 -0000      1.6
@@ -20,7 +20,7 @@
 
 # defines
 
-LINC_VERSION = 'LINC 0.1'
+LINC_VERSION = 'LINC 0.2'
 COPYRIGHT= \
 'Copyright (C) 2011-2012 Waclaw Jacek\n\
 Copyright (C) 2012 Free Software Foundation, Inc.\n\
@@ -214,8 +214,11 @@
        comment_block_start = haystack.rfind('<!--', 0, match_pos)
        comment_block_end = haystack.rfind('-->', 0, match_pos)
        if comment_block_start > comment_block_end:
-               return True
-       return False
+               if haystack[comment_block_start + len('<!--')] == '#':
+                       return 'ssi'
+               else:
+                       return 'yes'
+       return 'no'
 
 def regexp_search_list(regexp, the_list):
        for list_element in the_list:
@@ -463,6 +466,8 @@
        line_number = link_container['line_number']
        link = link_container['link']
        is_inside_comment = link_container['is_inside_comment']
+       if is_inside_comment == 'ssi':
+               continue;
 
        link_type = None
 
@@ -519,11 +524,11 @@
 
        # Report working links inside comments so that webmasters
        # could uncomment them.
-       if link_error == None and is_inside_comment:
+       if link_error == None and is_inside_comment == 'yes':
                link_error = 'no error detected'
                
        if link_error != None:
-               if is_inside_comment:
+               if is_inside_comment == 'yes':
                        link_error += ' (link commented out)'
                        file_to_write = commented_file
                        postfix = '/c'



reply via email to

[Prev in Thread] Current Thread [Next in Thread]