jenkins-bot has submitted this change and it was merged.

Change subject: Make UploadRobot skip upload of an existing file when aborts = 
True
......................................................................


Make UploadRobot skip upload of an existing file when aborts = True

Otherwise, my own upload script has no way to tell UploadRobot to skip
all such files (already uploaded in previous runs) without prompting
the user.

Change-Id: I6dc13dacbb9397c711c32005110f235e9354201f
---
M scripts/upload.py
1 file changed, 3 insertions(+), 0 deletions(-)

Approvals:
  John Vandenberg: Looks good to me, approved
  XZise: Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/scripts/upload.py b/scripts/upload.py
index e3daa44..6548a36 100755
--- a/scripts/upload.py
+++ b/scripts/upload.py
@@ -249,6 +249,9 @@
                     continue
             potential_file_page = pywikibot.FilePage(self.targetSite, filename)
             if potential_file_page.exists():
+                if self.aborts is True:
+                    pywikibot.output("File exists and you asked to abort. 
Skipping.")
+                    return None
                 if potential_file_page.canBeEdited():
                     if pywikibot.input_yn(u"File with name %s already exists. "
                                           "Would you like to change the name? "

-- 
To view, visit https://gerrit.wikimedia.org/r/192782
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I6dc13dacbb9397c711c32005110f235e9354201f
Gerrit-PatchSet: 2
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Nemo bis <[email protected]>
Gerrit-Reviewer: John Vandenberg <[email protected]>
Gerrit-Reviewer: Ladsgroup <[email protected]>
Gerrit-Reviewer: Merlijn van Deen <[email protected]>
Gerrit-Reviewer: Nemo bis <[email protected]>
Gerrit-Reviewer: XZise <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to