Changeset 1176


Ignore:
Timestamp:
Sep 26, 2022, 1:58:33 AM (2 years ago)
Author:
iritscen
Message:

ValBot: check_intrawiki_section_links.py should now always ignore interwiki links.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ValBot/Python/check_intrawiki_section_links.py

    r1173 r1176  
    6969        if not '#' in link_text:
    7070            #pywikibot.stdout('Link doesn\'t have a section anchor in it. Skipping.')
     71            continue
     72
     73        # If this link has an interwiki prefix, it can be ignored
     74        is_interwiki = False
     75        if found_iw_match == False:
     76            for prefix in interwiki_prefixes:
     77                if prefix + ":" in link_text:
     78                    #pywikibot.stdout('Skipping link {} because it is an interwiki link.'.format(link_text))
     79                    is_interwiki = True
     80                    break
     81        if is_interwiki:
    7182            continue
    7283       
     
    130141                    break
    131142       
    132         # If we didn't match the prefix against any intrawiki prefixes, see if it matches
    133         # against an interwiki prefix; if so, this link can be ignored
    134         is_interwiki = False
    135         if found_iw_match == False:
    136             for prefix in interwiki_prefixes:
    137                 if prefix + ":" in link_text:
    138                     #pywikibot.stdout('Skipping link {} because it is an interwiki link.'.format(link_text))
    139                     is_interwiki = True
    140                     break
    141         if is_interwiki:
    142             continue
    143        
    144143        # If we still haven't turned this match into a URL, something's gone wrong
    145144        if (found_iw_match == False) or (iw_url == ""):
Note: See TracChangeset for help on using the changeset viewer.