jenkins-bot has submitted this change and it was merged.
Change subject: [FIX] Upload: Fixing uploads
......................................................................
[FIX] Upload: Fixing uploads
When there is a page name problem, it reports it and it might then exit
the loop. But if there is no problem it doesn't continue but asks the
user and the loop continues.
It also calls upload_file internally and thus preserving forwarding the
URL, as upload_image was assuming all URLs are a string.
Change-Id: I0020e214db1cf0e276d9267c94d49859802b0a6e
---
M scripts/upload.py
1 file changed, 6 insertions(+), 4 deletions(-)
Approvals:
John Vandenberg: Looks good to me, approved
jenkins-bot: Verified
diff --git a/scripts/upload.py b/scripts/upload.py
index b02068b..ba258b3 100755
--- a/scripts/upload.py
+++ b/scripts/upload.py
@@ -6,7 +6,7 @@
Arguments:
-keep Keep the filename as is
- -filename Target filename
+ -filename Target filename without the namespace prefix
-noverify Do not ask for verification of the upload description if one
is given
-abortonwarn: Abort upload on the specified warning type. If no warning type
@@ -229,8 +229,8 @@
first_check = True
while True:
if not first_check:
- filename = pywikibot.input(u'Enter a better name, '
- 'or press enter to skip:')
+ filename = pywikibot.input('Enter a better name, or press '
+ 'enter to skip the file:')
if not filename:
return None
first_check = False
@@ -270,6 +270,8 @@
"repository and cannot be
overwritten."
% filename)
continue
+ else:
+ break
except pywikibot.NoPage:
break
@@ -372,7 +374,7 @@
if answer:
self.ignoreWarning = True
self.keepFilename = True
- return self.upload_image(debug)
+ return self.upload_file(file_url, debug)
else:
pywikibot.output(u"Upload aborted.")
return
--
To view, visit
https://gerrit.wikimedia.org/r/190560
To unsubscribe, visit
https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I0020e214db1cf0e276d9267c94d49859802b0a6e
Gerrit-PatchSet: 4
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: XZise <CommodoreFabianus(a)gmx.de>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: jenkins-bot <>