| 69 |
|
if not '#' in link_text: |
| 70 |
|
#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: |
| 82 |
+ |
continue |
| 83 |
|
|
| 84 |
|
# If there is a '{' in the link, then probably it's a link built on transcluded text |
| 85 |
|
# like "Quotes/Diary#{{C3}}", which we cannot expand and work with, so skip it |
| 140 |
|
found_iw_match = True |
| 141 |
|
break |
| 142 |
|
|
| 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 |
– |
|
| 143 |
|
# If we still haven't turned this match into a URL, something's gone wrong |
| 144 |
|
if (found_iw_match == False) or (iw_url == ""): |
| 145 |
|
pywikibot.stdout('ERROR: Couldn\'t figure out link {}.'.format(link_text)) |