Changeset 1200 for ValBot/Python/check_interwiki_links.py
- Timestamp:
- Sep 29, 2025, 9:18:16 PM (3 days ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
ValBot/Python/check_interwiki_links.py
r1199 r1200 101 101 if len(canonical_name) > 100: 102 102 # Certain things can cause the trim to fail; report error and avoid slamming the output with massive page source from a failed trim 103 pywikibot.stdout(' ERROR: The {0} link "{1}" is a redirect to "{2} ..." (string overflow).'.format(the_link.iw_prefix, the_link.page_slug, canonical_name[:100]))103 pywikibot.stdout(' ERROR: The {0} link "{1}" is a redirect to "{2}…" (string overflow).'.format(the_link.iw_prefix, the_link.page_slug, canonical_name[:100])) 104 104 errors_issued = errors_issued + 1 105 105 else: … … 107 107 if '#' in the_link.page_slug: 108 108 the_link.page_name_only, _ = the_link.page_slug.split('#') 109 pywikibot.stdout(' The {0} link "{1}" is a redirect to "{2}", which is a valid page. Checking for section on that page ....'.format(the_link.iw_prefix, the_link.page_name_only, the_link.page_name))109 pywikibot.stdout(' The {0} link "{1}" is a redirect to "{2}", which is a valid page. Checking for section on that page….'.format(the_link.iw_prefix, the_link.page_name_only, the_link.page_name)) 110 110 find_section(the_link, True) 111 111 else: … … 126 126 # If linked page is in all caps, e.g. WP:BEANS, it's likely a deliberate use of a redirect 127 127 if the_link.page_slug.startswith('WP:') and the_link.page_slug == the_link.page_slug.upper(): 128 pywikibot.stdout(' Got redirection code "{0}" for {1} link "{2}". This appears to be a deliberate use of a Wikipedia shortcut. Checking the target page ....'.format(the_link.curl_response.history[0], the_link.iw_prefix, the_link.page_slug))128 pywikibot.stdout(' Got redirection code "{0}" for {1} link "{2}". This appears to be a deliberate use of a Wikipedia shortcut. Checking the target page….'.format(the_link.curl_response.history[0], the_link.iw_prefix, the_link.page_slug)) 129 129 find_canonical_link(the_link) 130 130 else: … … 133 133 page_slug_lower = the_link.page_slug.lower() 134 134 if page_slug_lower.startswith(permalink1) or page_slug_lower.startswith(permalink2): 135 pywikibot.stdout(' Got redirection code "{0}" for {1} permanent revision link "{2}". Checking the target page ....'.format(the_link.curl_response.history[0], the_link.iw_prefix, the_link.page_slug))135 pywikibot.stdout(' Got redirection code "{0}" for {1} permanent revision link "{2}". Checking the target page….'.format(the_link.curl_response.history[0], the_link.iw_prefix, the_link.page_slug)) 136 136 find_canonical_link(the_link) 137 137 else: … … 148 148 unintended_redirects_found = unintended_redirects_found + 1 149 149 possibly_print(the_link) 150 pywikibot.stdout(' WARNING: Got silently redirected by {0} link "{1}". Checking the target page ....'.format(the_link.iw_prefix, the_link.page_slug))150 pywikibot.stdout(' WARNING: Got silently redirected by {0} link "{1}". Checking the target page….'.format(the_link.iw_prefix, the_link.page_slug)) 151 151 find_canonical_link(the_link) # calls find_section() at end 152 152 elif '#' in the_link.page_slug:
Note:
See TracChangeset
for help on using the changeset viewer.