Commit 2b47fbaf by murtaugh

don't remove links in fixing on fail

parent 25d839b3
......@@ -20,11 +20,10 @@ def fixurlfilelinks (src, wiki, timestamp=None, phpuploader=None, user=None):
url = m.group(1)
page = upload_url_to_wiki(url, wiki, "{{{{Provenance web|URL={0}|Date={1}]}}}}".format(url, timestamp), phpuploader=phpuploader, user=user)
if page == None:
print ("URL failed {0} removing link: {1}".format(m.group(1), m.group(0)), file=sys.stderr)
return ""
print ("URL failed {0} leaving link as is: {1}".format(m.group(1), m.group(0)), file=sys.stderr)
return m.group(0)
else:
return "[[{0}{1}]]".format(page.name, m.group(2) or "")
pass
return re.sub(r"\[\[(?:File|Fichier|Image)\:(https?\://.+?)(\|.+)?\]\]", linksub, src)
def fixlinks (page, wiki, phpuploader=None, user=None):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment